Skip to content
Snippets Groups Projects
Commit fd4ac99e authored by Zandor Smith's avatar Zandor Smith :computer:
Browse files

+ Added compatibility for armor.

parent 78584484
No related branches found
No related tags found
No related merge requests found
......@@ -16,6 +16,7 @@
package com.zandor300.inventorylock.listener;
import com.zandor300.inventorylock.InventoryLock;
import net.minecraft.server.v1_8_R1.EnchantmentSlotType;
import org.bukkit.event.EventHandler;
import org.bukkit.event.Listener;
import org.bukkit.event.inventory.InventoryClickEvent;
......@@ -30,5 +31,13 @@ public class PlayerListener implements Listener {
public void onInventoryClick(InventoryClickEvent event) {
if(InventoryLock.getLockedSlots().contains(event.getSlot()))
event.setCancelled(true);
if(event.getSlotType().equals(EnchantmentSlotType.ARMOR_HEAD) && InventoryLock.getLockedSlots().contains(36))
event.setCancelled(true);
if(event.getSlotType().equals(EnchantmentSlotType.ARMOR_TORSO) && InventoryLock.getLockedSlots().contains(37))
event.setCancelled(true);
if(event.getSlotType().equals(EnchantmentSlotType.ARMOR_LEGS) && InventoryLock.getLockedSlots().contains(38))
event.setCancelled(true);
if(event.getSlotType().equals(EnchantmentSlotType.ARMOR_FEET) && InventoryLock.getLockedSlots().contains(39))
event.setCancelled(true);
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment