summaryrefslogtreecommitdiffstats
path: root/src/main/java/net/minecraft/server/EntityMagmaCube.java
blob: c2947b7ae173b6847b46b34c70638323de9b024f (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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package net.minecraft.server;

public class EntityMagmaCube extends EntitySlime {

    public EntityMagmaCube(World world) {
        super(world);
        this.fireProof = true;
    }

    protected void az() {
        super.az();
        this.getAttributeInstance(GenericAttributes.d).setValue(0.20000000298023224D);
    }

    public boolean canSpawn() {
        return this.world.difficulty > 0 && this.world.b(this.boundingBox) && this.world.getCubes(this, this.boundingBox).isEmpty() && !this.world.containsLiquid(this.boundingBox);
    }

    public int aQ() {
        return this.getSize() * 3;
    }

    public float d(float f) {
        return 1.0F;
    }

    protected String bJ() {
        return "flame";
    }

    protected EntitySlime bK() {
        return new EntityMagmaCube(this.world);
    }

    protected int getLootId() {
        return Item.MAGMA_CREAM.id;
    }

    protected void dropDeathLoot(boolean flag, int i) {
        // CraftBukkit start - Whole method
        java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
        int j = this.getLootId();

        if (j > 0 && this.getSize() > 1) {
            int k = this.random.nextInt(4) - 2;

            if (i > 0) {
                k += this.random.nextInt(i + 1);
            }

            if (k > 0) {
                loot.add(new org.bukkit.inventory.ItemStack(j, k));
            }
        }

        org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
        // CraftBukkit end
    }

    public boolean isBurning() {
        return false;
    }

    protected int bL() {
        return super.bL() * 4;
    }

    protected void bM() {
        this.h *= 0.9F;
    }

    protected void be() {
        this.motY = (double) (0.42F + (float) this.getSize() * 0.1F);
        this.an = true;
    }

    protected void b(float f) {}

    protected boolean bN() {
        return true;
    }

    protected int bO() {
        return super.bO() + 2;
    }

    protected String aO() {
        return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
    }

    protected String aP() {
        return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
    }

    protected String bP() {
        return this.getSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small";
    }

    public boolean J() {
        return false;
    }

    protected boolean bQ() {
        return true;
    }
}