Do not protect chests with a loottable
This commit is contained in:
parent
2a7fd7c557
commit
5a57c5180e
|
|
@ -18,6 +18,7 @@
|
|||
|
||||
package me.ryanhamshire.GriefPrevention;
|
||||
|
||||
import com.destroystokyo.paper.loottable.LootableBlockInventory;
|
||||
import me.ryanhamshire.GriefPrevention.events.ClaimInspectionEvent;
|
||||
import me.ryanhamshire.GriefPrevention.events.VisualizationEvent;
|
||||
import org.bukkit.BanList;
|
||||
|
|
@ -87,6 +88,7 @@ import org.bukkit.event.raid.RaidTriggerEvent;
|
|||
import org.bukkit.inventory.EquipmentSlot;
|
||||
import org.bukkit.inventory.InventoryHolder;
|
||||
import org.bukkit.inventory.ItemStack;
|
||||
import org.bukkit.loot.Lootable;
|
||||
import org.bukkit.metadata.MetadataValue;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
|
@ -1123,8 +1125,7 @@ class PlayerEventHandler implements Listener
|
|||
// 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 (block.getState() instanceof Nameable nameable) {
|
||||
if (nameable.getCustomName() != null) {
|
||||
if (ChatColor.stripColor(nameable.getCustomName()).equalsIgnoreCase("public")) {
|
||||
return;
|
||||
|
|
@ -1132,6 +1133,10 @@ class PlayerEventHandler implements Listener
|
|||
}
|
||||
}
|
||||
}
|
||||
if(block.getState() instanceof LootableBlockInventory lootable) {
|
||||
if (lootable.hasLootTable())
|
||||
return;
|
||||
}
|
||||
|
||||
//otherwise check permissions for the claim the player is in
|
||||
Claim claim = this.dataStore.getClaimAt(clickedBlock.getLocation(), false, playerData.lastClaim);
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user