diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-09-08 14:51:03 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-09-08 14:51:03 +0100 |
commit | 85f12b43a2ead7744b6a1427b364eb3bad2151ef (patch) | |
tree | 3b0d047fda95f028e6bb51c3ebc3a560d10a3008 | |
parent | 19f54fa030f83fbb414f43235dd2a0062f36c987 (diff) | |
download | Essentials-85f12b43a2ead7744b6a1427b364eb3bad2151ef.tar Essentials-85f12b43a2ead7744b6a1427b364eb3bad2151ef.tar.gz Essentials-85f12b43a2ead7744b6a1427b364eb3bad2151ef.tar.lz Essentials-85f12b43a2ead7744b6a1427b364eb3bad2151ef.tar.xz Essentials-85f12b43a2ead7744b6a1427b364eb3bad2151ef.zip |
New Permission: essentials.god.pvp
Unless you have this permission you will be unable to attack other players while in god mode.
-rw-r--r-- | Essentials/src/com/earth2me/essentials/EssentialsEntityListener.java | 5 | ||||
-rw-r--r-- | EssentialsGeoIP/src/com/earth2me/essentials/geoip/EssentialsGeoIPPlayerListener.java | 2 |
2 files changed, 6 insertions, 1 deletions
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<String> 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) { |