From f510ca7d5d278552d6cbe36714f56565017e5e80 Mon Sep 17 00:00:00 2001 From: Light_Quanta Date: Fri, 4 Jul 2025 00:37:10 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=A7=E7=BB=AD=E4=BF=AE=E5=A4=8D=E5=BC=80?= =?UTF-8?q?=E7=81=AB=E6=9D=A1=E4=BB=B6=E5=88=A4=E6=96=AD=E9=97=AE=E9=A2=98?= =?UTF-8?q?=EF=BC=88=E6=81=BC=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/entity/vehicle/DroneEntity.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) 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,