修复集装箱放置的问题
This commit is contained in:
parent
29545734f0
commit
99518277d1
1 changed files with 7 additions and 2 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue