mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-27 21:15:57 +01:00
fixed entity damage events for latest bukkit
This commit is contained in:
parent
aee81f918e
commit
10c47eff7e
@ -49,7 +49,7 @@ public WorldGuardEntityListener(WorldGuardPlugin plugin) {
|
||||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void onEntityDamageByBlock(EntityDamageByBlockEvent event) {
|
||||
Entity defender = event.getEntity();
|
||||
DamageCause type = event.getCause();
|
||||
@ -74,7 +74,7 @@ public void onEntityDamageByBlock(EntityDamageByBlockEvent event) {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
public void onEntityDamageByEntity(EntityDamageByEntityEvent event) {
|
||||
Entity attacker = event.getDamager();
|
||||
Entity defender = event.getEntity();
|
||||
@ -156,7 +156,20 @@ public void onEntityDamageByProjectile(EntityDamageByProjectileEvent event) {
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onEntityDamage(EntityDamageEvent event) {
|
||||
|
||||
if (event instanceof EntityDamageByProjectileEvent) {
|
||||
this.onEntityDamageByProjectile((EntityDamageByProjectileEvent) event);
|
||||
return;
|
||||
} else if (event instanceof EntityDamageByEntityEvent) {
|
||||
this.onEntityDamageByEntity((EntityDamageByEntityEvent) event);
|
||||
return;
|
||||
} else if (event instanceof EntityDamageByBlockEvent) {
|
||||
this.onEntityDamageByBlock((EntityDamageByBlockEvent) event);
|
||||
return;
|
||||
}
|
||||
|
||||
Entity defender = event.getEntity();
|
||||
DamageCause type = event.getCause();
|
||||
|
||||
|
@ -202,9 +202,6 @@ private void registerEvents() {
|
||||
registerEvent(Event.Type.REDSTONE_CHANGE, blockListener, Priority.High);
|
||||
|
||||
registerEvent(Event.Type.ENTITY_DAMAGED, entityListener, Priority.High);
|
||||
registerEvent(Event.Type.ENTITY_DAMAGEDBY_PROJECTILE, entityListener, Priority.High);
|
||||
registerEvent(Event.Type.ENTITY_DAMAGEDBY_BLOCK, entityListener, Priority.High);
|
||||
registerEvent(Event.Type.ENTITY_DAMAGEDBY_ENTITY, entityListener, Priority.High);
|
||||
registerEvent(Event.Type.ENTITY_EXPLODE, entityListener, Priority.High);
|
||||
|
||||
registerEvent(Event.Type.PLAYER_ITEM, playerListener, Priority.High);
|
||||
|
Loading…
Reference in New Issue
Block a user