Forgot to cancel the event

im a such stupid xD
This commit is contained in:
marcocorriero 2017-11-14 11:34:49 +01:00 committed by GitHub
parent 8c8c5360c2
commit af11581133
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -43,12 +43,16 @@ public class PvpMonitor extends FreedomService {
// Checks 4 cases
if (player.getGameMode() == GameMode.CREATIVE && plugin.esb.getEssentialsUser(player.getName()).isGodModeEnabled()) { // This checks if player is on creative and god mode on.
player.sendMessage(ChatColor.RED + "Hey! You cannot PVP with God Mode and creative!");
event.setCancelled(true);
} else if (player.getGameMode() == GameMode.CREATIVE && !plugin.esb.getEssentialsUser(player.getName()).isGodModeEnabled()) { // This checks if player is on creative and god mode off.
player.sendMessage(ChatColor.RED + "Hey! You cannot PVP in creative!");
event.setCancelled(true);
} else if (player.getGameMode() == GameMode.SURVIVAL && plugin.esb.getEssentialsUser(player.getName()).isGodModeEnabled()) { // This checks if player is on survival with god mode on.
player.sendMessage(ChatColor.RED + "Hey! You can't PVP with godmode!");
event.setCancelled(true);
} else if (player.getGameMode() == GameMode.ADVENTURE && plugin.esb.getEssentialsUser(player.getName()).isGodModeEnabled()) { // This checks if player is on Adventure with god mode on.
player.sendMessage(ChatColor.RED + "Hey! You can't PVP with godmode!");
event.setCancelled(true);
}
}
@ -66,12 +70,16 @@ public class PvpMonitor extends FreedomService {
if (player.getGameMode() == GameMode.CREATIVE && plugin.esb.getEssentialsUser(player.getName()).isGodModeEnabled()) { // This checks if player is on creative and god mode on.
player.sendMessage(ChatColor.RED + "Hey! You cannot PVP with God Mode and creative!");
event.setCancelled(true);
} else if (player.getGameMode() == GameMode.CREATIVE && !plugin.esb.getEssentialsUser(player.getName()).isGodModeEnabled()) { // This checks if player is on creative and god mode off.
player.sendMessage(ChatColor.RED + "Hey! You cannot PVP in creative!");
event.setCancelled(true);
} else if (player.getGameMode() == GameMode.SURVIVAL && plugin.esb.getEssentialsUser(player.getName()).isGodModeEnabled()) { // This checks if player is on survival with god mode on.
player.sendMessage(ChatColor.RED + "Hey! You can't PVP with godmode!");
event.setCancelled(true);
} else if (player.getGameMode() == GameMode.ADVENTURE && plugin.esb.getEssentialsUser(player.getName()).isGodModeEnabled()) { // This checks if player is on Adventure with god mode on.
player.sendMessage(ChatColor.RED + "Hey! You can't PVP with godmode!");
event.setCancelled(true);
}
}
}