尝试写撬棍敲一下发射一发的功能
This commit is contained in:
parent
514c6ed288
commit
2edc769362
1 changed files with 17 additions and 13 deletions
|
@ -190,20 +190,24 @@ public class Type63Entity extends ContainerMobileVehicleEntity implements GeoEnt
|
||||||
setChanged();
|
setChanged();
|
||||||
|
|
||||||
if (stack.is(ModTags.Items.CROWBAR)) {
|
if (stack.is(ModTags.Items.CROWBAR)) {
|
||||||
if (player.isShiftKeyDown() && this.getPassengers().isEmpty()) {
|
if (player.isShiftKeyDown()) {
|
||||||
ItemStack container = ContainerBlockItem.createInstance(this);
|
if (this.getPassengers().isEmpty()) {
|
||||||
if (!player.addItem(container)) {
|
ItemStack container = ContainerBlockItem.createInstance(this);
|
||||||
player.drop(container, false);
|
if (!player.addItem(container)) {
|
||||||
|
player.drop(container, false);
|
||||||
|
}
|
||||||
|
this.remove(RemovalReason.DISCARDED);
|
||||||
|
this.discard();
|
||||||
|
return InteractionResult.SUCCESS;
|
||||||
}
|
}
|
||||||
this.remove(RemovalReason.DISCARDED);
|
} else {
|
||||||
this.discard();
|
//TODO 正确实现扣除炮弹
|
||||||
return InteractionResult.SUCCESS;
|
for (int i = 0; i < 12; i++) {
|
||||||
}
|
if (items.get(i).getItem() instanceof MediumRocketItem) {
|
||||||
|
items.remove(i);
|
||||||
for (int i = 0; i < 12; i++) {
|
player.swing(InteractionHand.MAIN_HAND);
|
||||||
if (!items.get(i).isEmpty()) {
|
break;
|
||||||
items.remove(i);
|
}
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue