Fix block stacking in creative, save stack after update

This commit is contained in:
ceze88 2023-04-10 17:17:44 +02:00
parent a00b6fb7fe
commit 3eeef59c5f
1 changed files with 4 additions and 1 deletions

View File

@ -138,6 +138,7 @@ public class BlockListeners implements Listener {
}
//update hologram
plugin.updateHologram(stack);
plugin.getDataManager().updateBlock(stack);
return;
} else {
if (isSneaking) return;
@ -147,7 +148,9 @@ public class BlockListeners implements Listener {
if (clickAction != Action.RIGHT_CLICK_BLOCK) return;
//Create new stack
event.setCancelled(true);
hand.takeItem(player, 1);
if (player.getGameMode() != GameMode.CREATIVE) {
hand.takeItem(player, 1);
}
BlockStack newStack = blockStackManager.createBlock(block);
plugin.getDataManager().createBlock(newStack);
plugin.updateHologram(newStack);