修复集装箱放置的问题

This commit is contained in:
17146 2025-03-07 02:48:24 +08:00
parent 29545734f0
commit 99518277d1

View file

@ -91,9 +91,14 @@ public class ContainerBlockItem extends BlockItem implements GeoItem {
if (player != null) { if (player != null) {
var tag = BlockItem.getBlockEntityData(stack); var tag = BlockItem.getBlockEntityData(stack);
if (tag != null && tag.get("Entity") != null && res == InteractionResult.SUCCESS) { if (tag != null && tag.get("Entity") != null) {
if (player.level().isClientSide && res == InteractionResult.SUCCESS) {
player.getInventory().removeItem(stack); player.getInventory().removeItem(stack);
} }
if (!player.level().isClientSide && res == InteractionResult.CONSUME) {
player.getInventory().removeItem(stack);
}
}
} }
return res; return res;
} }