From 5ac84a893802fc986450e6a76a20e38722b8b30f Mon Sep 17 00:00:00 2001 From: Atsuishio <842960157@qq.com> Date: Tue, 17 Jun 2025 00:47:00 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E4=BA=8C=E6=AC=A1=E7=81=BE?= =?UTF-8?q?=E5=8F=98=E5=8A=A8=E7=94=BB=E7=BC=BA=E5=A4=B1=EF=BC=8C=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E5=9C=A8=E5=AD=90=E5=BC=B9=E5=87=BB=E4=B8=AD=E8=BD=BD?= =?UTF-8?q?=E5=85=B7=E7=B2=BE=E7=A1=AE=E4=BD=8D=E7=BD=AE=E7=9A=84=E7=89=B9?= =?UTF-8?q?=E6=95=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/entity/projectile/ProjectileEntity.java | 8 +++++++- .../atsuishio/superbwarfare/event/GunEventHandler.java | 2 +- .../data/superbwarfare/guns/secondary_cataclysm.json | 1 + 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java index ad4fb2bca..f94b30688 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/ProjectileEntity.java @@ -65,7 +65,9 @@ import java.util.function.BiFunction; import java.util.function.Function; import java.util.function.Predicate; -@SuppressWarnings({"unused", "UnusedReturnValue"}) +import static com.atsuishio.superbwarfare.tools.ParticleTool.sendParticle; + +@SuppressWarnings({"unused", "UnusedReturnValue", "SuspiciousNameCombination"}) public class ProjectileEntity extends Projectile implements IEntityWithComplexSpawn, GeoEntity, CustomSyncMotionEntity { public static final EntityDataAccessor COLOR_R = SynchedEntityData.defineId(ProjectileEntity.class, EntityDataSerializers.FLOAT); @@ -187,6 +189,10 @@ public class ProjectileEntity extends Projectile implements IEntityWithComplexSp var obbVec = obb.clip(startVec.toVector3f(), endVec.toVector3f()).orElse(null); if (obbVec != null) { hitPos = new Vec3(obbVec); + if (this.level() instanceof ServerLevel serverLevel) { + sendParticle(serverLevel, ModParticleTypes.FIRE_STAR.get(), hitPos.x, hitPos.y, hitPos.z, 2, 0, 0, 0, 0.2, false); + sendParticle(serverLevel, ParticleTypes.SMOKE, hitPos.x, hitPos.y, hitPos.z, 3, 0, 0, 0, 0.01, false); + } } } } else { diff --git a/src/main/java/com/atsuishio/superbwarfare/event/GunEventHandler.java b/src/main/java/com/atsuishio/superbwarfare/event/GunEventHandler.java index ab366f9fd..05f09f7c2 100644 --- a/src/main/java/com/atsuishio/superbwarfare/event/GunEventHandler.java +++ b/src/main/java/com/atsuishio/superbwarfare/event/GunEventHandler.java @@ -229,7 +229,7 @@ public class GunEventHandler { if (reload.singleReloadStarter.start()) { NeoForge.EVENT_BUS.post(new ReloadEvent.Pre(player, data)); - if (data.defaultPrepareLoadTime() != 0 && data.ammo.get() == 0) { + if (data.defaultPrepareLoadTime() != 0 && (data.ammo.get() == 0 || stack.is(ModItems.SECONDARY_CATACLYSM.get()))) { // 此处判断空仓换弹的时候,是否在准备阶段就需要装填一发,如M870 playGunPrepareLoadReloadSounds(player); int prepareLoadTime = data.defaultPrepareLoadTime(); diff --git a/src/main/resources/data/superbwarfare/guns/secondary_cataclysm.json b/src/main/resources/data/superbwarfare/guns/secondary_cataclysm.json index 5a6a9b23a..05d05b82e 100644 --- a/src/main/resources/data/superbwarfare/guns/secondary_cataclysm.json +++ b/src/main/resources/data/superbwarfare/guns/secondary_cataclysm.json @@ -13,6 +13,7 @@ "ReloadTypes": [ "Iterative" ], + "PrepareTime": 31, "PrepareLoadTime": 31, "PrepareAmmoLoadTime": 3, "IterativeTime": 20,