Paper/src/main/java/net/minecraft/server/EntityMagmaCube.java

104 Zeilen
2.3 KiB
Java

2011-11-28 01:17:04 +01:00
package net.minecraft.server;
public class EntityMagmaCube extends EntitySlime {
2011-11-28 01:17:04 +01:00
public EntityMagmaCube(World world) {
2011-11-28 01:17:04 +01:00
super(world);
this.texture = "/mob/lava.png";
this.fireProof = true;
this.aM = 0.2F;
2011-11-28 01:17:04 +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
}
2012-11-06 13:05:28 +01:00
public int aW() {
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;
}
protected String h() {
2011-11-28 01:17:04 +01:00
return "flame";
}
protected EntitySlime i() {
return new EntityMagmaCube(this.world);
2011-11-28 01:17:04 +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
java.util.List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
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);
}
if (k > 0) {
loot.add(new org.bukkit.inventory.ItemStack(j, k));
}
2012-01-12 23:10:13 +01: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
}
public boolean isBurning() {
2011-11-28 01:17:04 +01:00
return false;
}
protected int j() {
return super.j() * 4;
2011-11-28 01:17:04 +01:00
}
protected void k() {
this.b *= 0.9F;
2011-11-28 01:17:04 +01:00
}
2012-11-06 13:05:28 +01:00
protected void bi() {
2011-11-28 01:17:04 +01:00
this.motY = (double) (0.42F + (float) this.getSize() * 0.1F);
this.am = 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
protected boolean l() {
2011-11-28 01:17:04 +01:00
return true;
}
protected int m() {
return super.m() + 2;
2011-11-28 01:17:04 +01:00
}
2012-11-06 13:05:28 +01:00
protected String aZ() {
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
2011-11-28 01:17:04 +01:00
}
2012-11-06 13:05:28 +01:00
protected String ba() {
return "mob.slime." + (this.getSize() > 1 ? "big" : "small");
2011-11-28 01:17:04 +01:00
}
protected String n() {
2011-11-28 01:17:04 +01:00
return this.getSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small";
}
2012-07-29 09:33:13 +02:00
public boolean J() {
2011-11-28 01:17:04 +01:00
return false;
}
protected boolean o() {
2011-11-28 01:17:04 +01:00
return true;
}
}