Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
fix slimefun block turning into a vanilla block if there are viewers
Browse files Browse the repository at this point in the history
  • Loading branch information
J3fftw1 committed Jan 17, 2024
1 parent f7b42a1 commit 5c6810b
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,10 @@ private void callBlockHandler(BlockBreakEvent e, ItemStack item, List<ItemStack>
// The main fix is in SlimefunItemInteractListener preventing opening to begin with
// Close the inventory for all viewers of this block
BlockMenu inventory = BlockStorage.getInventory(e.getBlock());
// TODO(future): Remove this check when MockBukkit supports viewers
if (inventory != null && !Slimefun.instance().isUnitTest()) {
inventory.toInventory().getViewers().forEach(HumanEntity::closeInventory);
if (inventory != null) {
for (HumanEntity human : new ArrayList<>(inventory.toInventory().getViewers())) {
human.closeInventory();
}
}
// Remove the block data
BlockStorage.clearBlockInfo(e.getBlock());
Expand Down

0 comments on commit 5c6810b

Please sign in to comment.