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

105 Zeilen
2.2 KiB
Java

2011-11-28 01:17:04 +01:00
package net.minecraft.server;
2012-01-12 23:10:13 +01:00
import java.util.List; // CraftBukkit
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
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-01-12 23:10:13 +01:00
this.al = 0.2F;
2011-11-28 01:17:04 +01:00
}
public boolean g() {
2012-01-12 23:10:13 +01:00
return this.world.difficulty > 0 && this.world.containsEntity(this.boundingBox) && this.world.a((Entity) this, this.boundingBox).size() == 0 && !this.world.c(this.boundingBox);
2011-11-28 01:17:04 +01:00
}
2012-01-12 23:10:13 +01:00
public int P() {
2011-11-28 01:17:04 +01:00
return this.getSize() * 3;
}
public float a(float f) {
return 1.0F;
}
2012-01-12 23:10:13 +01:00
protected String v() {
2011-11-28 01:17:04 +01:00
return "flame";
}
2012-01-12 23:10:13 +01:00
protected EntitySlime z() {
return new EntityMagmaCube(this.world);
2011-11-28 01:17:04 +01:00
}
protected int e() {
2012-01-12 23:10:13 +01:00
return Item.MAGMA_CREAM.id;
}
protected void dropDeathLoot(boolean flag, int i) {
// CraftBukkit start - whole method
List<org.bukkit.inventory.ItemStack> loot = new java.util.ArrayList<org.bukkit.inventory.ItemStack>();
int j = this.e();
if (j > 0 && this.getSize() > 1) {
int k = this.random.nextInt(4) - 2;
if (i > 0) {
k += this.random.nextInt(i + 1);
}
loot.add(new org.bukkit.inventory.ItemStack(j, k));
}
CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
2011-11-28 01:17:04 +01:00
}
2012-01-12 23:10:13 +01:00
public boolean A() {
2011-11-28 01:17:04 +01:00
return false;
}
2012-01-12 23:10:13 +01:00
protected int B() {
return super.B() * 4;
2011-11-28 01:17:04 +01:00
}
2012-01-12 23:10:13 +01:00
protected void C() {
2011-11-28 01:17:04 +01:00
this.a *= 0.9F;
}
2012-01-12 23:10:13 +01:00
protected void o_() {
2011-11-28 01:17:04 +01:00
this.motY = (double) (0.42F + (float) this.getSize() * 0.1F);
2012-01-12 23:10:13 +01:00
this.ce = true;
2011-11-28 01:17:04 +01:00
}
protected void b(float f) {}
2012-01-12 23:10:13 +01:00
protected boolean D() {
2011-11-28 01:17:04 +01:00
return true;
}
2012-01-12 23:10:13 +01:00
protected int E() {
return super.E() + 2;
2011-11-28 01:17:04 +01:00
}
protected String m() {
return "mob.slime";
}
protected String n() {
return "mob.slime";
}
2012-01-12 23:10:13 +01:00
protected String F() {
2011-11-28 01:17:04 +01:00
return this.getSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small";
}
2012-01-12 23:10:13 +01:00
public boolean aL() {
2011-11-28 01:17:04 +01:00
return false;
}
2012-01-12 23:10:13 +01:00
protected boolean H() {
2011-11-28 01:17:04 +01:00
return true;
}
}