diff options
author | ementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-03-31 22:39:08 +0000 |
---|---|---|
committer | ementalo <ementalo@e251c2fe-e539-e718-e476-b85c1f46cddb> | 2011-03-31 22:39:08 +0000 |
commit | 65312004df0008caaa9741645b8b3fed9c160144 (patch) | |
tree | cc8a5a1fdb5fadfcad788a2f32820f94f17912ae /EssentialsProtect/src/com/earth2me/essentials | |
parent | fb8086996112b8eeec916ad8070513dcc198aaf6 (diff) | |
download | Essentials-65312004df0008caaa9741645b8b3fed9c160144.tar Essentials-65312004df0008caaa9741645b8b3fed9c160144.tar.gz Essentials-65312004df0008caaa9741645b8b3fed9c160144.tar.lz Essentials-65312004df0008caaa9741645b8b3fed9c160144.tar.xz Essentials-65312004df0008caaa9741645b8b3fed9c160144.zip |
NULL item is when we click on stuff like doors.
git-svn-id: https://svn.java.net/svn/essentials~svn/trunk@1053 e251c2fe-e539-e718-e476-b85c1f46cddb
Diffstat (limited to 'EssentialsProtect/src/com/earth2me/essentials')
-rw-r--r-- | EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java index ce37dd368..0c9cddec5 100644 --- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java +++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java @@ -44,11 +44,12 @@ public class EssentialsProtectPlayerListener extends PlayerListener return; } - if (EssentialsProtect.checkProtectionItems(EssentialsProtect.usageList, item.getTypeId()) && !user.isAuthorized("essentials.protect.exemptusage")) - { - event.setCancelled(true); - return; - } + + if (item != null && EssentialsProtect.checkProtectionItems(EssentialsProtect.usageList, item.getTypeId()) && !user.isAuthorized("essentials.protect.exemptusage")) + { + event.setCancelled(true); + return; + } if (user.isAuthorized("essentials.protect.admin")) { @@ -60,12 +61,12 @@ public class EssentialsProtectPlayerListener extends PlayerListener + ownerName); } } - if (EssentialsProtect.onUseAlert.contains(String.valueOf(item.getTypeId()))) + if (item != null && EssentialsProtect.onUseAlert.contains(String.valueOf(item.getTypeId()))) { parent.alert(user, item.getType().toString(), "used: "); } - if (item.getTypeId() == 323) + if (item != null && item.getTypeId() == 323) { if (EssentialsProtect.genSettings.get("protect.protect.signs")) { @@ -88,6 +89,6 @@ public class EssentialsProtectPlayerListener extends PlayerListener } } } - + } } |