3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-20 21:40:06 +01:00
Paper/src/main/java/net/minecraft/server/EntityMagmaCube.java

105 Zeilen
2.3 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 canSpawn() {
2012-02-29 22:31:04 +01:00
return this.world.difficulty > 0 && this.world.containsEntity(this.boundingBox) && this.world.getCubes(this, this.boundingBox).size() == 0 && !this.world.containsLiquid(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 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
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);
}
loot.add(new org.bukkit.inventory.ItemStack(j, k));
}
CraftEventFactory.callEntityDeathEvent(this, loot);
// CraftBukkit end
2011-11-28 01:17:04 +01:00
}
public boolean isBurning() {
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;
}
}