make sure we check for canceled events

This commit is contained in:
hyperdefined
2026-04-05 20:22:30 -04:00
parent 6a13c7fef7
commit 7cd5e8f0d0
19 changed files with 23 additions and 42 deletions

View File

@@ -50,7 +50,7 @@ public class InventoryClose implements Listener {
this.toolStats = toolStats;
}
@EventHandler
@EventHandler(ignoreCancelled = true)
public void onClose(InventoryCloseEvent event) {
if (toolStats.generateLoot.generatedInventory.isEmpty()) {
return;
@@ -106,7 +106,7 @@ public class InventoryClose implements Listener {
}, null, 1);
}
if (holder instanceof Container container) {
if (holder instanceof Container) {
Chunk chestChunk = chestLocation.getChunk();
Bukkit.getRegionScheduler().runDelayed(toolStats, chestLocation.getWorld(), chestChunk.getX(), chestChunk.getZ(), scheduledTask -> {
BlockState blockState = chestLocation.getWorld().getBlockAt(chestLocation).getState();