Skip to content

Commit

Permalink
fix #74
Browse files Browse the repository at this point in the history
  • Loading branch information
YouHaveTrouble committed Jun 25, 2024
1 parent e3256c8 commit 9d1e0ba
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import net.kyori.adventure.text.Component;
import net.kyori.adventure.text.minimessage.MiniMessage;
import org.bukkit.block.BlockState;
import org.bukkit.block.DecoratedPot;
import org.bukkit.block.Vault;
import org.bukkit.event.EventHandler;
import org.bukkit.event.EventPriority;
Expand Down Expand Up @@ -62,6 +63,8 @@ public boolean shouldEnable() {

@EventHandler(priority = EventPriority.HIGHEST, ignoreCancelled = true)
public void onDestroyBlockWithLoot(BlockBreakEvent event) {
// decorated pots are only lootable by breaking them
if (event.getBlock().getState() instanceof DecoratedPot) return;
if (event.getBlock().getState() instanceof Lootable lootable) {
if (!lootable.hasLootTable()) return;
handleLootBlockDestruction(event);
Expand Down

0 comments on commit 9d1e0ba

Please sign in to comment.