summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/TileEntitySkull.java
blob: b49f731614ca30f11cc1edeaabf08c44ef90ca75 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
package net.minecraft.server;

public class TileEntitySkull extends TileEntity {

    private int a;
    private int b;
    private String c = "";

    public TileEntitySkull() {}

    public void b(NBTTagCompound nbttagcompound) {
        super.b(nbttagcompound);
        nbttagcompound.setByte("SkullType", (byte) (this.a & 255));
        nbttagcompound.setByte("Rot", (byte) (this.b & 255));
        nbttagcompound.setString("ExtraType", this.c);
    }

    public void a(NBTTagCompound nbttagcompound) {
        super.a(nbttagcompound);
        this.a = nbttagcompound.getByte("SkullType");
        this.b = nbttagcompound.getByte("Rot");
        if (nbttagcompound.hasKey("ExtraType")) {
            this.c = nbttagcompound.getString("ExtraType");
        }
    }

    public Packet getUpdatePacket() {
        NBTTagCompound nbttagcompound = new NBTTagCompound();

        this.b(nbttagcompound);
        return new Packet132TileEntityData(this.x, this.y, this.z, 4, nbttagcompound);
    }

    public void setSkullType(int i, String s) {
        this.a = i;
        this.c = s;
    }

    public int getSkullType() {
        return this.a;
    }

    public void setRotation(int i) {
        this.b = i;
    }

    // CraftBukkit start
    public int getRotation() {
        return this.b;
    }
    // CraftBukkit end

    public String getExtraType() {
        return this.c;
    }
}