mirror of
https://github.com/hyperdefined/ToolStats.git
synced 2026-04-22 19:11:23 +00:00
make sure we check for canceled events
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user