diff --git a/src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java b/src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java index 7d57191..d294a40 100644 --- a/src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java +++ b/src/main/java/me/ryanhamshire/GriefPrevention/PlayerEventHandler.java @@ -27,6 +27,7 @@ import org.bukkit.Chunk; import org.bukkit.GameMode; import org.bukkit.Location; import org.bukkit.Material; +import org.bukkit.Nameable; import org.bukkit.OfflinePlayer; import org.bukkit.Tag; import org.bukkit.World; @@ -1326,6 +1327,21 @@ class PlayerEventHandler implements Listener return; } + // there's no need to check for claims as this is a claiming bypass? + Block block = event.getClickedBlock(); + // TODO : doesn't cover cartography tables add these... + /* This should cover all chests, enderchests, barrels, furnacetypes, lectern, ....*/ + if(block.getState() instanceof InventoryHolder) { + if (block.getState() instanceof Nameable) { + Nameable nameable = (Nameable) block.getState(); + if (nameable.getCustomName() != null) { + if (ChatColor.stripColor(nameable.getCustomName()).equalsIgnoreCase("public")) { + return; + } + } + } + } + //otherwise check permissions for the claim the player is in Claim claim = this.dataStore.getClaimAt(clickedBlock.getLocation(), false, playerData.lastClaim); if (claim != null)