diff --git a/src/main/java/com/atsuishio/superbwarfare/item/ContainerBlockItem.java b/src/main/java/com/atsuishio/superbwarfare/item/ContainerBlockItem.java index 1df1e7dd9..d5031358f 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/ContainerBlockItem.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/ContainerBlockItem.java @@ -67,13 +67,15 @@ public class ContainerBlockItem extends BlockItem implements GeoItem { public InteractionResult place(BlockPlaceContext pContext) { ItemStack stack = pContext.getItemInHand(); Player player = pContext.getPlayer(); + var res = super.place(pContext); + if (player != null) { var tag = BlockItem.getBlockEntityData(stack); - if (tag != null && tag.get("Entity") != null && pContext.canPlace()) { + if (tag != null && tag.get("Entity") != null && res == InteractionResult.SUCCESS) { player.getInventory().removeItem(stack); } } - return super.place(pContext); + return res; } private PlayState predicate(AnimationState event) {