summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityPig.java
blob: e44e7a6001692af07f920e7975c3ba731fb34ea1 (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
57
58
59
60
61
package net.minecraft.server;

public class EntityPig extends EntityAnimals {

    public EntityPig(World world) {
        super(world);
        aP = "/mob/pig.png";
        a(0.9F, 0.9F);
    }

    protected void a() {
        af.a(16, ((Byte.valueOf((byte) 0))));
    }

    public void a(NBTTagCompound nbttagcompound) {
        super.a(nbttagcompound);
        nbttagcompound.a("Saddle", K());
    }

    public void b(NBTTagCompound nbttagcompound) {
        super.b(nbttagcompound);
        a(nbttagcompound.l("Saddle"));
    }

    protected String e() {
        return "mob.pig";
    }

    protected String f() {
        return "mob.pig";
    }

    protected String g() {
        return "mob.pigdeath";
    }

    public boolean a(EntityPlayer entityplayer) {
        if (K() && !l.z && (j == null || j == entityplayer)) {
            entityplayer.e(((Entity) (this)));
            return true;
        } else {
            return false;
        }
    }

    protected int h() {
        return Item.ao.ba;
    }

    public boolean K() {
        return (af.a(16) & 1) != 0;
    }

    public void a(boolean flag) {
        if (flag) {
            af.b(16, ((Byte.valueOf((byte) 1))));
        } else {
            af.b(16, ((Byte.valueOf((byte) 0))));
        }
    }
}