修复开火条件判断问题
This commit is contained in:
parent
53f998d5ae
commit
07a11ba96f
1 changed files with 3 additions and 5 deletions
|
@ -232,14 +232,13 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
|
||||||
this.hurt(new DamageSource(level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(DamageTypes.EXPLOSION), controller), 0.25f + (float) (2 * lastTickSpeed));
|
this.hurt(new DamageSource(level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(DamageTypes.EXPLOSION), controller), 0.25f + (float) (2 * lastTickSpeed));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this.fire) {
|
if (this.fire && this.entityData.get(AMMO) > 0) {
|
||||||
if (this.entityData.get(AMMO) > 0) {
|
if (!this.entityData.get(IS_KAMIKAZE)) {
|
||||||
this.entityData.set(AMMO, this.entityData.get(AMMO) - 1);
|
this.entityData.set(AMMO, this.entityData.get(AMMO) - 1);
|
||||||
if (controller != null && this.level() instanceof ServerLevel) {
|
if (controller != null && this.level() instanceof ServerLevel) {
|
||||||
droneDrop(controller);
|
droneDrop(controller);
|
||||||
}
|
}
|
||||||
}
|
} else {
|
||||||
if (!this.entityData.get(DISPLAY_ENTITY).isEmpty()) {
|
|
||||||
if (controller != null) {
|
if (controller != null) {
|
||||||
var stack = controller.getMainHandItem();
|
var stack = controller.getMainHandItem();
|
||||||
if (stack.is(ModItems.MONITOR.get())) {
|
if (stack.is(ModItems.MONITOR.get())) {
|
||||||
|
@ -249,7 +248,6 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity {
|
||||||
}
|
}
|
||||||
this.hurt(new DamageSource(level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(DamageTypes.EXPLOSION), controller), 10000);
|
this.hurt(new DamageSource(level().registryAccess().registryOrThrow(Registries.DAMAGE_TYPE).getHolderOrThrow(DamageTypes.EXPLOSION), controller), 10000);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
this.fire = false;
|
this.fire = false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue