2012-12-20 19:42:14 +01:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
|
|
|
public class TileEntitySkull extends TileEntity {
|
|
|
|
|
|
|
|
private int a;
|
2013-11-04 14:07:38 +01:00
|
|
|
private int i;
|
|
|
|
private String j = "";
|
2012-12-20 19:42:14 +01:00
|
|
|
|
|
|
|
public TileEntitySkull() {}
|
|
|
|
|
|
|
|
public void b(NBTTagCompound nbttagcompound) {
|
|
|
|
super.b(nbttagcompound);
|
|
|
|
nbttagcompound.setByte("SkullType", (byte) (this.a & 255));
|
2013-11-04 14:07:38 +01:00
|
|
|
nbttagcompound.setByte("Rot", (byte) (this.i & 255));
|
|
|
|
nbttagcompound.setString("ExtraType", this.j);
|
2012-12-20 19:42:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void a(NBTTagCompound nbttagcompound) {
|
|
|
|
super.a(nbttagcompound);
|
|
|
|
this.a = nbttagcompound.getByte("SkullType");
|
2013-11-04 14:07:38 +01:00
|
|
|
this.i = nbttagcompound.getByte("Rot");
|
|
|
|
if (nbttagcompound.hasKeyOfType("ExtraType", 8)) {
|
|
|
|
this.j = nbttagcompound.getString("ExtraType");
|
2012-12-20 19:42:14 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public Packet getUpdatePacket() {
|
|
|
|
NBTTagCompound nbttagcompound = new NBTTagCompound();
|
|
|
|
|
|
|
|
this.b(nbttagcompound);
|
2013-11-04 14:07:38 +01:00
|
|
|
return new PacketPlayOutTileEntityData(this.x, this.y, this.z, 4, nbttagcompound);
|
2012-12-20 19:42:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public void setSkullType(int i, String s) {
|
|
|
|
this.a = i;
|
2013-11-04 14:07:38 +01:00
|
|
|
this.j = s;
|
2012-12-20 19:42:14 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
public int getSkullType() {
|
|
|
|
return this.a;
|
|
|
|
}
|
|
|
|
|
|
|
|
public void setRotation(int i) {
|
2013-11-04 14:07:38 +01:00
|
|
|
this.i = i;
|
2012-12-20 19:42:14 +01:00
|
|
|
}
|
|
|
|
|
2012-12-22 00:44:56 +01:00
|
|
|
// CraftBukkit start
|
|
|
|
public int getRotation() {
|
2013-11-04 14:07:38 +01:00
|
|
|
return this.i;
|
2012-12-22 00:44:56 +01:00
|
|
|
}
|
|
|
|
// CraftBukkit end
|
|
|
|
|
2012-12-20 19:42:14 +01:00
|
|
|
public String getExtraType() {
|
2013-11-04 14:07:38 +01:00
|
|
|
return this.j;
|
2012-12-20 19:42:14 +01:00
|
|
|
}
|
|
|
|
}
|