diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java index b4e7bc0df..d35349d47 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java @@ -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,