Only count death if it is enabled for this world

#164
This commit is contained in:
Florian CUNY 2018-10-07 10:35:15 +02:00 committed by GitHub
parent 87c54aaf08
commit a6d25d68a9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -26,7 +26,7 @@ public class DeathListener implements Listener {
@EventHandler(priority = EventPriority.NORMAL, ignoreCancelled = true)
public void onPlayerDeathEvent(PlayerDeathEvent e) {
if (plugin.getIWM().inWorld(e.getEntity().getLocation())) {
if (plugin.getIWM().inWorld(e.getEntity().getLocation()) && plugin.getIWM().getWorldSettings(e.getEntity().getLocation().getWorld()).isDeathsCounted()) {
plugin.getPlayers().addDeath(e.getEntity().getWorld(), e.getEntity().getUniqueId());
}
}