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

104 Zeilen
2.2 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;
2012-07-29 09:33:13 +02:00
this.aG = 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-07-29 09:33:13 +02:00
public int aO() {
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-07-29 09:33:13 +02:00
protected String i() {
2011-11-28 01:17:04 +01:00
return "flame";
}
2012-07-29 09:33:13 +02:00
protected EntitySlime j() {
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;
}
2012-07-29 09:33:13 +02:00
protected int k() {
return super.k() * 4;
2011-11-28 01:17:04 +01:00
}
2012-07-29 09:33:13 +02:00
protected void l() {
2011-11-28 01:17:04 +01:00
this.a *= 0.9F;
}
2012-07-29 09:33:13 +02:00
protected void aZ() {
2011-11-28 01:17:04 +01:00
this.motY = (double) (0.42F + (float) this.getSize() * 0.1F);
2012-07-29 09:33:13 +02:00
this.al = 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-07-29 09:33:13 +02:00
protected boolean m() {
2011-11-28 01:17:04 +01:00
return true;
}
2012-07-29 09:33:13 +02:00
protected int n() {
return super.n() + 2;
2011-11-28 01:17:04 +01:00
}
2012-07-29 09:33:13 +02:00
protected String aR() {
2011-11-28 01:17:04 +01:00
return "mob.slime";
}
2012-07-29 09:33:13 +02:00
protected String aS() {
2011-11-28 01:17:04 +01:00
return "mob.slime";
}
2012-07-29 09:33:13 +02:00
protected String o() {
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;
}
2012-07-29 09:33:13 +02:00
protected boolean p() {
2011-11-28 01:17:04 +01:00
return true;
}
}