3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-21 05:50:05 +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
}
public int T() {
2011-11-28 01:17:04 +01:00
return this.getSize() * 3;
}
2012-03-01 11:49:23 +01:00
public float b(float f) {
2011-11-28 01:17:04 +01:00
return 1.0F;
}
2012-03-01 11:49:23 +01:00
protected String A() {
2011-11-28 01:17:04 +01:00
return "flame";
}
protected EntitySlime C() {
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-03-01 11:49:23 +01:00
protected int E() {
return super.E() * 4;
2011-11-28 01:17:04 +01:00
}
2012-03-01 11:49:23 +01:00
protected void F() {
2011-11-28 01:17:04 +01:00
this.a *= 0.9F;
}
protected void ac() {
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
}
2012-03-01 11:49:23 +01:00
protected void a(float f) {}
2011-11-28 01:17:04 +01:00
2012-03-01 11:49:23 +01:00
protected boolean G() {
2011-11-28 01:17:04 +01:00
return true;
}
2012-03-01 11:49:23 +01:00
protected int H() {
return super.H() + 2;
2011-11-28 01:17:04 +01:00
}
2012-03-01 11:49:23 +01:00
protected String j() {
2011-11-28 01:17:04 +01:00
return "mob.slime";
}
2012-03-01 11:49:23 +01:00
protected String k() {
2011-11-28 01:17:04 +01:00
return "mob.slime";
}
protected String I() {
2011-11-28 01:17:04 +01:00
return this.getSize() > 1 ? "mob.magmacube.big" : "mob.magmacube.small";
}
public boolean aV() {
2011-11-28 01:17:04 +01:00
return false;
}
2012-03-01 11:49:23 +01:00
protected boolean K() {
2011-11-28 01:17:04 +01:00
return true;
}
}