From 22344624241bdb0b4daff6de11e4ce518c648ac1 Mon Sep 17 00:00:00 2001 From: Brianna O'Keefe Date: Sun, 17 Feb 2019 22:32:30 -0500 Subject: [PATCH] Offhand protection stackables. --- src/main/java/me/goodandevil/skyblock/listeners/Interact.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/me/goodandevil/skyblock/listeners/Interact.java b/src/main/java/me/goodandevil/skyblock/listeners/Interact.java index ee0341a9..48ab1bab 100644 --- a/src/main/java/me/goodandevil/skyblock/listeners/Interact.java +++ b/src/main/java/me/goodandevil/skyblock/listeners/Interact.java @@ -24,6 +24,7 @@ import org.bukkit.event.player.PlayerInteractEntityEvent; import org.bukkit.event.player.PlayerInteractEvent; import org.bukkit.event.vehicle.VehicleDamageEvent; import org.bukkit.event.vehicle.VehicleDestroyEvent; +import org.bukkit.inventory.EquipmentSlot; import org.bukkit.inventory.ItemStack; import me.goodandevil.skyblock.SkyBlock; @@ -64,6 +65,9 @@ public class Interact implements Listener { && stackableManager.getStackableMaterials().contains(event.getMaterial()) && event.getClickedBlock().getType() == event.getMaterial() && !player.isSneaking()) { + if (NMSUtil.getVersionNumber() > 8) { + if (event.getHand() == EquipmentSlot.OFF_HAND) return; + } Location location = event.getClickedBlock().getLocation(); if (stackableManager.isStacked(location)) { Stackable stackable = stackableManager.getStack(location, event.getMaterial());