继续修复开火条件判断问题(恼)
This commit is contained in:
parent
07a11ba96f
commit
f510ca7d5d
1 changed files with 6 additions and 4 deletions
|
@ -369,6 +369,7 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
|
|||
if (ammo == 1) {
|
||||
this.entityData.set(DISPLAY_ENTITY, "");
|
||||
this.entityData.set(MAX_AMMO, 1);
|
||||
this.entityData.set(IS_KAMIKAZE, false);
|
||||
this.currentItem = ItemStack.EMPTY;
|
||||
}
|
||||
}
|
||||
|
@ -397,6 +398,8 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
|
|||
this.currentItem = stack.copyWithCount(1);
|
||||
this.entityData.set(DISPLAY_ENTITY, attachmentData.displayEntity());
|
||||
this.entityData.set(AMMO, this.entityData.get(AMMO) + 1);
|
||||
this.entityData.set(IS_KAMIKAZE, attachmentData.isKamikaze);
|
||||
this.entityData.set(MAX_AMMO, attachmentData.count());
|
||||
|
||||
if (!player.isCreative()) {
|
||||
stack.shrink(1);
|
||||
|
@ -420,7 +423,6 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
|
|||
attachmentData.xLength, attachmentData.zLength,
|
||||
(float) attachmentData.tickCount
|
||||
));
|
||||
this.entityData.set(MAX_AMMO, attachmentData.count());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -667,9 +669,9 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
|
|||
var data = CustomData.DRONE_ATTACHMENT.get(getItemId(this.currentItem));
|
||||
if (data == null) return;
|
||||
|
||||
var bomb = EntityType.byString(attachedEntity).map(entityType ->
|
||||
entityType.create(this.level())
|
||||
).orElse(null);
|
||||
var bomb = EntityType.byString(attachedEntity)
|
||||
.map(entityType -> entityType.create(this.level()))
|
||||
.orElse(null);
|
||||
if (bomb == null) return;
|
||||
|
||||
explosion = new CustomExplosion(this.level(), this,
|
||||
|
|
Loading…
Add table
Reference in a new issue