2011-11-28 01:17:04 +01:00
|
|
|
package net.minecraft.server;
|
|
|
|
|
2011-11-30 00:17:43 +01:00
|
|
|
public class EntityMagmaCube extends EntitySlime {
|
2011-11-28 01:17:04 +01:00
|
|
|
|
2011-11-30 00:17:43 +01:00
|
|
|
public EntityMagmaCube(World world) {
|
2011-11-28 01:17:04 +01:00
|
|
|
super(world);
|
|
|
|
this.texture = "/mob/lava.png";
|
|
|
|
this.fireProof = true;
|
2013-03-13 23:33:27 +01:00
|
|
|
this.aO = 0.2F;
|
2011-11-28 01:17:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-14 21:03:48 +01:00
|
|
|
public boolean canSpawn() {
|
2012-07-29 09:33:13 +02:00
|
|
|
return this.world.difficulty > 0 && this.world.b(this.boundingBox) && this.world.getCubes(this, this.boundingBox).isEmpty() && !this.world.containsLiquid(this.boundingBox);
|
2011-11-28 01:17:04 +01:00
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
public int aZ() {
|
2011-11-28 01:17:04 +01:00
|
|
|
return this.getSize() * 3;
|
|
|
|
}
|
|
|
|
|
2012-07-29 09:33:13 +02:00
|
|
|
public float c(float f) {
|
2011-11-28 01:17:04 +01:00
|
|
|
return 1.0F;
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
protected String h() {
|
2011-11-28 01:17:04 +01:00
|
|
|
return "flame";
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
protected EntitySlime i() {
|
2011-11-30 00:17:43 +01:00
|
|
|
return new EntityMagmaCube(this.world);
|
2011-11-28 01:17:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-14 21:03:48 +01:00
|
|
|
protected int getLootId() {
|
2012-01-12 23:10:13 +01:00
|
|
|
return Item.MAGMA_CREAM.id;
|
|
|
|
}
|
|
|
|
|
|
|
|
protected void dropDeathLoot(boolean flag, int i) {
|
|
|
|
// CraftBukkit start - whole method
|
2012-07-22 08:18:00 +02:00
|
|
|
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
|
2012-01-14 21:03:48 +01:00
|
|
|
int j = this.getLootId();
|
2012-01-12 23:10:13 +01:00
|
|
|
|
|
|
|
if (j > 0 && this.getSize() > 1) {
|
|
|
|
int k = this.random.nextInt(4) - 2;
|
|
|
|
|
|
|
|
if (i > 0) {
|
|
|
|
k += this.random.nextInt(i + 1);
|
|
|
|
}
|
|
|
|
|
2012-03-25 13:29:23 +02:00
|
|
|
if (k > 0) {
|
|
|
|
loot.add(new org.bukkit.inventory.ItemStack(j, k));
|
|
|
|
}
|
2012-01-12 23:10:13 +01:00
|
|
|
}
|
|
|
|
|
2012-07-22 08:18:00 +02:00
|
|
|
org.bukkit.craftbukkit.event.CraftEventFactory.callEntityDeathEvent(this, loot);
|
2012-01-12 23:10:13 +01:00
|
|
|
// CraftBukkit end
|
2011-11-28 01:17:04 +01:00
|
|
|
}
|
|
|
|
|
2012-01-14 21:03:48 +01:00
|
|
|
public boolean isBurning() {
|
2011-11-28 01:17:04 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
protected int j() {
|
|
|
|
return super.j() * 4;
|
2011-11-28 01:17:04 +01:00
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
protected void k() {
|
|
|
|
this.b *= 0.9F;
|
2011-11-28 01:17:04 +01:00
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
protected void bl() {
|
2011-11-28 01:17:04 +01:00
|
|
|
this.motY = (double) (0.42F + (float) this.getSize() * 0.1F);
|
2013-03-13 23:33:27 +01:00
|
|
|
this.an = true;
|
2011-11-28 01:17:04 +01:00
|
|
|
}
|
|
|
|
|
2012-03-01 11:49:23 +01:00
|
|
|
protected void a(float f) {}
|
2011-11-28 01:17:04 +01:00
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
protected boolean l() {
|
2011-11-28 01:17:04 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
protected int m() {
|
|
|
|
return super.m() + 2;
|
2011-11-28 01:17:04 +01:00
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
protected String bc() {
|
2012-10-25 05:53:23 +02:00
|
|
|
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
|
2011-11-28 01:17:04 +01:00
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
protected String bd() {
|
2012-10-25 05:53:23 +02:00
|
|
|
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
|
2011-11-28 01:17:04 +01:00
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
protected String n() {
|
2011-11-28 01:17:04 +01:00
|
|
|
return this.getSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small";
|
|
|
|
}
|
|
|
|
|
2013-03-13 23:33:27 +01:00
|
|
|
public boolean I() {
|
2011-11-28 01:17:04 +01:00
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
2012-10-25 05:53:23 +02:00
|
|
|
protected boolean o() {
|
2011-11-28 01:17:04 +01:00
|
|
|
return true;
|
|
|
|
}
|
|
|
|
}
|