3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-26 16:12:37 +01:00
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;
2013-03-13 23:33:27 +01:00
this.aO = 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
}
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;
}
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) {
2013-03-25 05:22:32 +01:00
// 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
}
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
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
}
2013-03-13 23:33:27 +01:00
protected String bc() {
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() {
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";
}
2013-03-13 23:33:27 +01:00
public boolean I() {
2011-11-28 01:17:04 +01:00
return false;
}
protected boolean o() {
2011-11-28 01:17:04 +01:00
return true;
}
}