Implement DamageType.VOID

This commit is contained in:
Gunther De Wachter 2011-03-17 18:24:36 +01:00 committed by Erik Broes
parent 28c9439f94
commit d732457354

View File

@ -10,6 +10,7 @@ import org.bukkit.craftbukkit.CraftWorld;
import org.bukkit.craftbukkit.entity.CraftEntity;
import org.bukkit.craftbukkit.TrigMath;
import org.bukkit.event.Event.Type;
import org.bukkit.event.entity.EntityDamageByBlockEvent;
import org.bukkit.event.entity.EntityDamageEvent;
import org.bukkit.event.entity.EntityDamageEvent.DamageCause;
import org.bukkit.event.entity.EntityDeathEvent;
@ -796,7 +797,21 @@ public abstract class EntityLiving extends Entity {
}
protected void M() {
this.a((Entity) null, 4);
// CraftBukkit start
CraftServer server = ((WorldServer) this.world).getServer();
DamageCause damageType = EntityDamageEvent.DamageCause.VOID;
org.bukkit.block.Block damager = null;
org.bukkit.entity.Entity damagee = this.getBukkitEntity();
int damageDone = 4;
EntityDamageByBlockEvent event = new EntityDamageByBlockEvent(damager, damagee, damageType, damageDone);
server.getPluginManager().callEvent(event);
if (event.isCancelled()) {
return;
}
damageDone = event.getDamage();
this.a((Entity) null, damageDone);
// CraftBukkit end
}
public Vec3D N() {