From 2e45c5d6baaf81a7f845bbf24ad58b1642e34d3d Mon Sep 17 00:00:00 2001 From: BAKKBONE Australia Date: Tue, 29 Oct 2024 12:27:24 +0800 Subject: [PATCH] Check if player in BentoBox world before restricting use/interact --- .../protectionlib/compatibilities/BentoBoxCompat.java | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/main/java/io/th0rgal/protectionlib/compatibilities/BentoBoxCompat.java b/src/main/java/io/th0rgal/protectionlib/compatibilities/BentoBoxCompat.java index 85e06ec..154a850 100644 --- a/src/main/java/io/th0rgal/protectionlib/compatibilities/BentoBoxCompat.java +++ b/src/main/java/io/th0rgal/protectionlib/compatibilities/BentoBoxCompat.java @@ -55,6 +55,10 @@ public boolean canBreak(Player player, Location target) { */ @Override public boolean canInteract(Player player, Location target) { + // Check if in world + if (!plugin.getIWM().inWorld(target)) { + return true; + } // No single interact flag, so just check if player is on their own island return plugin.getIslands().locationIsOnIsland(player, target); } @@ -65,6 +69,10 @@ public boolean canInteract(Player player, Location target) { * @return true if he can use the item at the location */ public boolean canUse(Player player, Location target) { + // Check if in world + if (!plugin.getIWM().inWorld(target)) { + return true; + } // No single use flag, so just check if player is on their own island return plugin.getIslands().locationIsOnIsland(player, target); }