From b1b09ea542379ae5cbc6f6db26fd4d1d3452d311 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 8 Sep 2012 14:51:03 +0100 Subject: New Permission: essentials.god.pvp Unless you have this permission you will be unable to attack other players while in god mode. --- Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java | 5 +++++ .../com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java index c43cc8e31..bfa11f5e4 100644 --- a/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java +++ b/Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java @@ -46,6 +46,11 @@ public class EssentialsEntityListener implements Listener { event.setCancelled(true); } + + if (attacker.isGodModeEnabled() && !attacker.isAuthorized("essentials.god.pvp")) + { + event.setCancelled(true); + } attacker.updateActivity(true); final List commandList = attacker.getPowertool(attacker.getItemInHand()); diff --git a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java index c8de953cf..733d7212b 100644 --- a/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java +++ b/EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java @@ -40,7 +40,7 @@ public class EssentialsGeoIPPlayerListener implements Listener, IConf config.setTemplateName("/config.yml", EssentialsGeoIP.class); reloadConfig(); } - + @EventHandler(priority = EventPriority.MONITOR) public void onPlayerJoin(final PlayerJoinEvent event) { -- cgit v1.2.3