13
0
geforkt von Mirrors/Paper
Paper/src/main/java/net/minecraft/server/EntityZombie.java

54 Zeilen
1.4 KiB
Java

2011-01-08 08:40:42 +01:00
package net.minecraft.server;
// CraftBukkit start
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
2011-01-29 22:50:29 +01:00
public class EntityZombie extends EntityMonster {
2011-01-08 08:40:42 +01:00
public EntityZombie(World world) {
super(world);
2011-01-29 22:50:29 +01:00
this.texture = "/mob/zombie.png";
2011-02-23 03:37:56 +01:00
this.az = 0.5F;
2011-01-29 22:50:29 +01:00
this.c = 5;
2011-01-08 08:40:42 +01:00
}
2011-02-23 03:37:56 +01:00
public void q() {
if (this.world.c()) {
float f = this.c(1.0F);
2011-01-08 08:40:42 +01:00
2011-01-29 22:50:29 +01:00
if (f > 0.5F && this.world.i(MathHelper.b(this.locX), MathHelper.b(this.locY), MathHelper.b(this.locZ)) && this.random.nextFloat() * 30.0F < (f - 0.4F) * 2.0F) {
// CraftBukkit start
2011-01-29 22:50:29 +01:00
CraftServer server = ((WorldServer) this.world).getServer();
EntityCombustEvent event = new EntityCombustEvent(Type.ENTITY_COMBUST, this.getBukkitEntity());
2011-01-10 09:30:34 +01:00
server.getPluginManager().callEvent(event);
2011-02-23 13:56:36 +01:00
2011-01-10 09:30:34 +01:00
if (!event.isCancelled()) {
2011-01-29 22:50:29 +01:00
this.fireTicks = 300;
2011-01-10 09:30:34 +01:00
}
// CraftBukkit end
2011-01-08 08:40:42 +01:00
}
}
2011-01-29 22:50:29 +01:00
2011-02-23 03:37:56 +01:00
super.q();
2011-01-08 08:40:42 +01:00
}
2011-01-14 14:31:10 +01:00
protected String e() {
2011-01-08 08:40:42 +01:00
return "mob.zombie";
}
2011-01-14 14:31:10 +01:00
protected String f() {
2011-01-08 08:40:42 +01:00
return "mob.zombiehurt";
}
2011-01-14 14:31:10 +01:00
protected String g() {
2011-01-08 08:40:42 +01:00
return "mob.zombiedeath";
}
2011-01-14 14:31:10 +01:00
protected int h() {
2011-01-29 22:50:29 +01:00
return Item.FEATHER.id;
2011-01-08 08:40:42 +01:00
}
}