修复了集装箱放置失败时消耗物品的问题

This commit is contained in:
17146 2025-02-07 00:11:23 +08:00
parent 1a638dc7e0
commit 5d6f63c9de

View file

@ -69,7 +69,7 @@ public class ContainerBlockItem extends BlockItem implements GeoItem {
Player player = pContext.getPlayer(); Player player = pContext.getPlayer();
if (player != null) { if (player != null) {
var tag = BlockItem.getBlockEntityData(stack); var tag = BlockItem.getBlockEntityData(stack);
if (tag != null && tag.get("Entity") != null) { if (tag != null && tag.get("Entity") != null && pContext.canPlace()) {
player.getInventory().removeItem(stack); player.getInventory().removeItem(stack);
} }
} }