Skip to content

Commit

Permalink
Merge pull request #40 from bakkbone/master
Browse files Browse the repository at this point in the history
Check if player in BentoBox world before restricting use/interact
  • Loading branch information
Th0rgal authored Nov 30, 2024
2 parents 51309bc + 2e45c5d commit 7fbf8cb
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand Down

0 comments on commit 7fbf8cb

Please sign in to comment.