diff --git a/pom.xml b/pom.xml
index d0b2b1a..d47a073 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
me.NVus
NVus_Prison_Setup
- 0.1-SNAPSHOT
+ 0.1.1-SNAPSHOT
jar
PrisonSetup
diff --git a/src/main/java/me/nvus/nvus_prison_setup/Listeners/PlayerArmor.java b/src/main/java/me/nvus/nvus_prison_setup/Listeners/PlayerArmor.java
index 8c9f2a5..21a6e7c 100644
--- a/src/main/java/me/nvus/nvus_prison_setup/Listeners/PlayerArmor.java
+++ b/src/main/java/me/nvus/nvus_prison_setup/Listeners/PlayerArmor.java
@@ -1,5 +1,6 @@
package me.nvus.nvus_prison_setup.Listeners;
+import org.bukkit.entity.Player;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener;
@@ -10,18 +11,15 @@ public class PlayerArmor implements Listener {
// Prevent Armor Unequip??
@EventHandler(priority = EventPriority.LOWEST)
- public void onInventoryClick(InventoryClickEvent event)
- {
- if (event.getClickedInventory().getType() == InventoryType.PLAYER)
- {
- if (event.getSlotType() == InventoryType.SlotType.ARMOR)
- {
- event.setCancelled(true);
+ public void onInventoryClick(InventoryClickEvent event) {
+ if (event.getClickedInventory() != null && event.getClickedInventory().getType() == InventoryType.PLAYER) {
+ if (event.getSlotType() == InventoryType.SlotType.ARMOR) {
+ Player player = (Player) event.getWhoClicked();
+ // Check if the player is an actual prisoner before cancelling ;)
+ if (player.hasPermission("nvus.prisoner")) {
+ event.setCancelled(true);
+ }
}
}
}
-
-
-
-
}