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

55 lines
1.4 KiB
Java
Raw Normal View History

2011-01-08 08:40:42 +01:00
package net.minecraft.server;
import java.util.Random;
// CraftBukkit start
2011-01-10 03:47:39 +01:00
import org.bukkit.craftbukkit.CraftLivingEntity;
2011-01-08 08:40:42 +01:00
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.event.Event.Type;
import org.bukkit.event.entity.EntityCombustEvent;
// CraftBukkit end
2011-01-08 08:40:42 +01:00
public class EntityZombie extends EntityMobs {
public EntityZombie(World world) {
super(world);
aQ = "/mob/zombie.png";
bD = 0.5F;
f = 5;
}
public void G() {
if (l.b()) {
float f1 = b(1.0F);
if (f1 > 0.5F && l.h(MathHelper.b(p), MathHelper.b(q), MathHelper.b(r)) && W.nextFloat() * 30F < (f1 - 0.4F) * 2.0F) {
// CraftBukkit start
2011-01-10 09:30:34 +01:00
CraftServer server = ((WorldServer) l).getServer();
EntityCombustEvent event = new EntityCombustEvent(Type.ENTITY_COMBUST, new CraftLivingEntity(server, (EntityLiving) this));
server.getPluginManager().callEvent(event);
if (!event.isCancelled()) {
Z = 300;
}
// CraftBukkit end
2011-01-08 08:40:42 +01:00
}
}
super.G();
}
protected String d() {
return "mob.zombie";
}
protected String e() {
return "mob.zombiehurt";
}
protected String f() {
return "mob.zombiedeath";
}
protected int g() {
return Item.J.aW;
}
}