mirror of
https://github.com/taoneill/war.git
synced 2024-11-27 12:46:11 +01:00
Now checking if War is laoded in entity_death.
This commit is contained in:
parent
b057cac73d
commit
f7e0b73465
@ -440,16 +440,18 @@ public class WarEntityListener extends EntityListener {
|
||||
|
||||
@Override
|
||||
public void onEntityDeath(EntityDeathEvent event) {
|
||||
if (event.getEntity() instanceof Player) {
|
||||
Player player = (Player) event.getEntity();
|
||||
Warzone zone = Warzone.getZoneByPlayerName(player.getName());
|
||||
if (zone != null) {
|
||||
event.getDrops().clear();
|
||||
zone.handleDeath(player);
|
||||
|
||||
for (Team team : zone.getTeams()) {
|
||||
team.teamcast(player.getName() + " died");
|
||||
}
|
||||
if (!War.war.isLoaded() || !(event.getEntity() instanceof Player)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Player player = (Player) event.getEntity();
|
||||
Warzone zone = Warzone.getZoneByPlayerName(player.getName());
|
||||
if (zone != null) {
|
||||
event.getDrops().clear();
|
||||
zone.handleDeath(player);
|
||||
|
||||
for (Team team : zone.getTeams()) {
|
||||
team.teamcast(player.getName() + " died");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user