From e3600dc185fec1208ef1256e61584494c2d39fe5 Mon Sep 17 00:00:00 2001 From: Atsuishio <842960157@qq.com> Date: Mon, 26 May 2025 12:22:24 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96=E8=BD=BD=E5=85=B7=E7=83=9F?= =?UTF-8?q?=E9=9B=BE=E5=BC=B9=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/particle/CustomCloudParticle.java | 5 ----- .../client/particle/CustomSmokeParticle.java | 5 ----- .../entity/projectile/SmokeDecoyEntity.java | 5 ++++- .../entity/vehicle/Bmp2Entity.java | 9 ++++++++- .../entity/vehicle/Lav150Entity.java | 9 ++++++++- .../entity/vehicle/PrismTankEntity.java | 9 ++++++++- .../entity/vehicle/Yx100Entity.java | 9 ++++++++- .../vehicle/base/MobileVehicleEntity.java | 15 ++++++++------- .../superbwarfare/particles/custom_smoke.json | 16 ++++++++-------- .../textures/particle/generic_0.png | Bin 0 -> 159 bytes .../textures/particle/generic_1.png | Bin 0 -> 197 bytes .../textures/particle/generic_2.png | Bin 0 -> 266 bytes .../textures/particle/generic_3.png | Bin 0 -> 351 bytes .../textures/particle/generic_4.png | Bin 0 -> 410 bytes .../textures/particle/generic_5.png | Bin 0 -> 472 bytes .../textures/particle/generic_6.png | Bin 0 -> 490 bytes .../textures/particle/generic_7.png | Bin 0 -> 487 bytes 17 files changed, 52 insertions(+), 30 deletions(-) create mode 100644 src/main/resources/assets/superbwarfare/textures/particle/generic_0.png create mode 100644 src/main/resources/assets/superbwarfare/textures/particle/generic_1.png create mode 100644 src/main/resources/assets/superbwarfare/textures/particle/generic_2.png create mode 100644 src/main/resources/assets/superbwarfare/textures/particle/generic_3.png create mode 100644 src/main/resources/assets/superbwarfare/textures/particle/generic_4.png create mode 100644 src/main/resources/assets/superbwarfare/textures/particle/generic_5.png create mode 100644 src/main/resources/assets/superbwarfare/textures/particle/generic_6.png create mode 100644 src/main/resources/assets/superbwarfare/textures/particle/generic_7.png diff --git a/src/main/java/com/atsuishio/superbwarfare/client/particle/CustomCloudParticle.java b/src/main/java/com/atsuishio/superbwarfare/client/particle/CustomCloudParticle.java index d9aed434f..1dda9b9ad 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/particle/CustomCloudParticle.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/particle/CustomCloudParticle.java @@ -41,11 +41,6 @@ public class CustomCloudParticle extends TextureSheetParticle { this.setSpriteFromAge(spriteSet); } - @Override - public int getLightColor(float partialTick) { - return 15728880; - } - @Override public @NotNull ParticleRenderType getRenderType() { return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; diff --git a/src/main/java/com/atsuishio/superbwarfare/client/particle/CustomSmokeParticle.java b/src/main/java/com/atsuishio/superbwarfare/client/particle/CustomSmokeParticle.java index 1e548fdfc..173288320 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/particle/CustomSmokeParticle.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/particle/CustomSmokeParticle.java @@ -41,11 +41,6 @@ public class CustomSmokeParticle extends TextureSheetParticle { this.setSpriteFromAge(spriteSet); } - @Override - public int getLightColor(float partialTick) { - return 15728880; - } - @Override public @NotNull ParticleRenderType getRenderType() { return ParticleRenderType.PARTICLE_SHEET_TRANSLUCENT; diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmokeDecoyEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmokeDecoyEntity.java index afb87d2a8..b75a30b43 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmokeDecoyEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmokeDecoyEntity.java @@ -4,6 +4,7 @@ import com.atsuishio.superbwarfare.init.ModEntities; import com.atsuishio.superbwarfare.init.ModParticleTypes; import com.atsuishio.superbwarfare.init.ModSounds; import com.atsuishio.superbwarfare.tools.ParticleTool; +import net.minecraft.core.particles.ParticleTypes; import net.minecraft.nbt.CompoundTag; import net.minecraft.network.syncher.SynchedEntityData; import net.minecraft.server.level.ServerLevel; @@ -55,7 +56,9 @@ public class SmokeDecoyEntity extends Entity implements DecoyEntity { if (tickCount == this.igniteTime) { if (this.level() instanceof ServerLevel serverLevel) { ParticleTool.sendParticle(serverLevel, ModParticleTypes.CUSTOM_SMOKE.get(), this.xo, this.yo, this.zo, - 100, 0, 0, 0, 0.07, true); + 50, 0, 0, 0, 0.07, true); + ParticleTool.sendParticle(serverLevel, ParticleTypes.LARGE_SMOKE, this.xo, this.yo, this.zo, 10, 1, 1, 1, 0.1, true); + ParticleTool.sendParticle(serverLevel, ModParticleTypes.FIRE_STAR.get(), this.xo, this.yo, this.zo, 30, 0, 0, 0, 0.2, true); } this.level().playSound(null, this, ModSounds.SMOKE_FIRE.get(), this.getSoundSource(), 1, random.nextFloat() * 0.05f + 1); this.setDeltaMovement(Vec3.ZERO); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java index b8d7b7dc1..ece50460c 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java @@ -218,7 +218,7 @@ public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntit this.terrainCompact(4f, 5f); inertiaRotate(1); - releaseSmokeDecoy(); + releaseSmokeDecoy(getTurretVector(1)); lowHealthWarning(); this.refreshDimensions(); @@ -557,6 +557,13 @@ public class Bmp2Entity extends ContainerMobileVehicleEntity implements GeoEntit return transformT; } + public Vec3 getTurretVector(float pPartialTicks) { + Matrix4f transform = getTurretTransform(pPartialTicks); + Vector4f rootPosition = transformPosition(transform, 0, 0, 0); + Vector4f targetPosition = transformPosition(transform, 0, 0, 1); + return new Vec3(rootPosition.x, rootPosition.y, rootPosition.z).vectorTo(new Vec3(targetPosition.x, targetPosition.y, targetPosition.z)); + } + public Matrix4f getTurretTransform(float ticks) { Matrix4f transformV = getVehicleTransform(ticks); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java index 80649d02a..8f296a48c 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java @@ -171,7 +171,7 @@ public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEnt this.terrainCompact(2.7f, 3.61f); inertiaRotate(1.25f); - releaseSmokeDecoy(); + releaseSmokeDecoy(getTurretVector(1)); this.refreshDimensions(); } @@ -429,6 +429,13 @@ public class Lav150Entity extends ContainerMobileVehicleEntity implements GeoEnt return transformT; } + public Vec3 getTurretVector(float pPartialTicks) { + Matrix4f transform = getTurretTransform(pPartialTicks); + Vector4f rootPosition = transformPosition(transform, 0, 0, 0); + Vector4f targetPosition = transformPosition(transform, 0, 0, 1); + return new Vec3(rootPosition.x, rootPosition.y, rootPosition.z).vectorTo(new Vec3(targetPosition.x, targetPosition.y, targetPosition.z)); + } + public Matrix4f getTurretTransform(float ticks) { Matrix4f transformV = getVehicleTransform(ticks); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/PrismTankEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/PrismTankEntity.java index 990f821f3..f882c9835 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/PrismTankEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/PrismTankEntity.java @@ -195,7 +195,7 @@ public class PrismTankEntity extends ContainerMobileVehicleEntity implements Geo this.terrainCompact(4.6375f, 5.171875f); inertiaRotate(1); - releaseSmokeDecoy(); + releaseSmokeDecoy(getTurretVector(1)); if (this.getFirstPassenger() instanceof Player player && fireInputDown && getWeaponIndex(0) == 1 && getEnergy() > VehicleConfig.PRISM_TANK_SHOOT_COST_MODE_2.get() && !cannotFire) { vehicleShoot(player, 0); @@ -609,6 +609,13 @@ public class PrismTankEntity extends ContainerMobileVehicleEntity implements Geo return transformT; } + public Vec3 getTurretVector(float pPartialTicks) { + Matrix4f transform = getTurretTransform(pPartialTicks); + Vector4f rootPosition = transformPosition(transform, 0, 0, 0); + Vector4f targetPosition = transformPosition(transform, 0, 0, 1); + return new Vec3(rootPosition.x, rootPosition.y, rootPosition.z).vectorTo(new Vec3(targetPosition.x, targetPosition.y, targetPosition.z)); + } + public Matrix4f getTurretTransform(float ticks) { Matrix4f transformV = getVehicleTransform(ticks); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java index fc4d93d9f..71ca4c790 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Yx100Entity.java @@ -320,7 +320,7 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti inertiaRotate(1.2f); - releaseSmokeDecoy(); + releaseSmokeDecoy(getTurretVector(1)); this.refreshDimensions(); } @@ -795,6 +795,13 @@ public class Yx100Entity extends ContainerMobileVehicleEntity implements GeoEnti return new Vec3(rootPosition.x, rootPosition.y, rootPosition.z).vectorTo(new Vec3(targetPosition.x, targetPosition.y, targetPosition.z)); } + public Vec3 getTurretVector(float pPartialTicks) { + Matrix4f transform = getTurretTransform(pPartialTicks); + Vector4f rootPosition = transformPosition(transform, 0, 0, 0); + Vector4f targetPosition = transformPosition(transform, 0, 0, 1); + return new Vec3(rootPosition.x, rootPosition.y, rootPosition.z).vectorTo(new Vec3(targetPosition.x, targetPosition.y, targetPosition.z)); + } + public Vec3 getGunnerVector(float pPartialTicks) { Matrix4f transform = getGunnerBarrelTransform(pPartialTicks); Vector4f rootPosition = transformPosition(transform, 0, 0, 0); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java index 83432850d..7f369f24c 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/base/MobileVehicleEntity.java @@ -288,17 +288,18 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements } //烟雾诱饵 - public void releaseSmokeDecoy() { + public void releaseSmokeDecoy(Vec3 vec3) { if (decoyInputDown) { if (this.entityData.get(DECOY_COUNT) > 0 && this.level() instanceof ServerLevel) { - for (int i = 0; i < 16; i++) { - SmokeDecoyEntity smokeDecoyEntity = new SmokeDecoyEntity(this.level()); - smokeDecoyEntity.setPos(this.getX(), this.getY() + 2, this.getZ()); - smokeDecoyEntity.decoyShoot(this, this.getViewVector(1).yRot((11.25F + 22.5F * i) * Mth.DEG_TO_RAD), 3.2f, 8); + Entity passenger = getFirstPassenger(); + for (int i = 0; i < 8; i++) { + SmokeDecoyEntity smokeDecoyEntity = new SmokeDecoyEntity((LivingEntity) passenger, this.level()); + smokeDecoyEntity.setPos(this.getX(), this.getY() + getBbHeight(), this.getZ()); + smokeDecoyEntity.decoyShoot(this, vec3.yRot((-78.75f + 22.5F * i) * Mth.DEG_TO_RAD), 4f, 8); this.level().addFreshEntity(smokeDecoyEntity); } this.level().playSound(null, this, ModSounds.DECOY_FIRE.get(), this.getSoundSource(), 1, 1); - decoyReloadCoolDown = 400; + decoyReloadCoolDown = 500; this.getEntityData().set(DECOY_COUNT, this.getEntityData().get(DECOY_COUNT) - 1); } decoyInputDown = false; @@ -306,7 +307,7 @@ public abstract class MobileVehicleEntity extends EnergyVehicleEntity implements if (this.entityData.get(DECOY_COUNT) < 1 && decoyReloadCoolDown == 0 && this.level() instanceof ServerLevel) { this.entityData.set(DECOY_COUNT, this.entityData.get(DECOY_COUNT) + 1); this.level().playSound(null, this, ModSounds.DECOY_RELOAD.get(), this.getSoundSource(), 1, 1); - decoyReloadCoolDown = 400; + decoyReloadCoolDown = 500; } } diff --git a/src/main/resources/assets/superbwarfare/particles/custom_smoke.json b/src/main/resources/assets/superbwarfare/particles/custom_smoke.json index f970e447f..a490d01ff 100644 --- a/src/main/resources/assets/superbwarfare/particles/custom_smoke.json +++ b/src/main/resources/assets/superbwarfare/particles/custom_smoke.json @@ -1,12 +1,12 @@ { "textures": [ - "minecraft:generic_0", - "minecraft:generic_1", - "minecraft:generic_2", - "minecraft:generic_3", - "minecraft:generic_4", - "minecraft:generic_5", - "minecraft:generic_6", - "minecraft:generic_7" + "superbwarfare:generic_0", + "superbwarfare:generic_1", + "superbwarfare:generic_2", + "superbwarfare:generic_3", + "superbwarfare:generic_4", + "superbwarfare:generic_5", + "superbwarfare:generic_6", + "superbwarfare:generic_7" ] } \ No newline at end of file diff --git a/src/main/resources/assets/superbwarfare/textures/particle/generic_0.png b/src/main/resources/assets/superbwarfare/textures/particle/generic_0.png new file mode 100644 index 0000000000000000000000000000000000000000..a9a2ea820573e0fcb3db1d389de88d89dc307817 GIT binary patch literal 159 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DWNC>ZGJ z;usRq`u4&`-U9|4tbub}Z#>gKsg`qCWl7f*HD13ikMB}ihfk(4FeC)0eLMI2>$ODB z#j(dt94@U|b$r2jW~D`U@2=~3$)D5NvCp4@q3$IM`!y*^#(PGqfQB=8y85}Sb4q9e E0L23}PXGV_ literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/superbwarfare/textures/particle/generic_1.png b/src/main/resources/assets/superbwarfare/textures/particle/generic_1.png new file mode 100644 index 0000000000000000000000000000000000000000..973d5c4969d98b0d13c240ec48d5c3d41cd11e46 GIT binary patch literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^3LwnE1|*BCs=fdz&H|6fVg?3oVGw3ym^DWNC|K_4 z;usRq`u5UA-UbC8mJ5%RaxVMM=<>~*?bj49c79izGhHp~FP}ogV~hVD=XTcI zUie6T$vY30(@zbLUErRy_c}|}LEFyFA3DzGy*PFAqU ze96(Vf-C*m>F{#bmhfZdq8SUBt8G4UFuv+?S2`0j_qLFSChN{0G8KFmn?9XaW|CSd zAUInnY}qoGkR^+*HD8HX#ct4(pn62APWmN_;MA$>_Gmq{=-YgnaeF}>mzWGM2hbl3 Mp00i_>zopr050-qI{*Lx literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/superbwarfare/textures/particle/generic_3.png b/src/main/resources/assets/superbwarfare/textures/particle/generic_3.png new file mode 100644 index 0000000000000000000000000000000000000000..fd455427c195979a875322bb5bb5df19d908742f GIT binary patch literal 351 zcmV-l0igbgP)@7FbG9)cMGrsy0H_hvJ<*V2~^;I?8M11K)`h$ zAGtq{d2kO9Bf!wm2@%mwMEkEfRQ)a3S9N)dWWf4f$KElUvLM>{vMdu3?d>xf^N|72 zj9aiXm2gShY`ow#a|_VZ&6||wr4)7DwrwU{uR10`rksdq!qr$-HM%W`LIAufgox(6 z2BB7%dghOfT2;<>h+|m z0gTT+8xr6fAtJ~BB#+?Z1AH4UQ9_+qXCiXgpGVf3_pr?d!>F~Ql(LD)k#pYEF6SKb z-85oH96+rV0FY90_rDatNIIK!&n^9fP%B9&`a#w*_LVa#2)FKC-NxD5?>*c8tsX6;; zeZVX!umTN6)zWe3y+6|v-dVSPczx=_!waTI_`_G=0eFEW-%(YB761SM07*qoM6N<$ Eg2Z9DV*mgE literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/superbwarfare/textures/particle/generic_5.png b/src/main/resources/assets/superbwarfare/textures/particle/generic_5.png new file mode 100644 index 0000000000000000000000000000000000000000..834c3ac2588a293f9b1e28b995af9a7dc9fdd768 GIT binary patch literal 472 zcmV;}0Vn>6P)od)q>CXUR6tE)ZeqS zw$JXVYProwGG2`_Uf$subTR$F;Vtiu^ zLGDx$UI7$g&j$f$yw}g@v0D*IIY4qchAAL^=X1(yVdJzsNV|fMI4F+mC^E!K|vYu+H&?>4(zY z7HnE&L%X^+>*(oG|97E#Th6TbRw7VHu5v)U7| zNMQd*UbE4R&xbjH#hA@+G$9Q>>>?xr{;>BTs$^yy_n2{!r=zq6P=p^Za(&_Wz$$RCEp8Xm8zVCZT&OWCAkbCutL}eJEwPt2^lDF1Q+fd(Ba0F%`ArN_# zQm!qSfg(5iNdSKbA$|g31)y97pB3xL&4LQNx?~h0ax+%}^~$V-ANH4KV20e=ZU(Nx z$_j8S7IIlcC=I{2>NOe#?*PVQ1^xmMuw)Ocz(oME=Q6Eo0mtH3@)Y1d9Kh%hD#6Mg zwqRuVydTcO&dn+z8Wkdy5B`a zd=rWUUOq;VLM1|F-vfG&xSQE`KR6?PhNIe)UMTzV@TvbdP9qLR`^LxVOpwIG^ gz*B&LUb$D|3tl#t-J7u4umAu607*qoM6N<$g236_ivR!s literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/superbwarfare/textures/particle/generic_7.png b/src/main/resources/assets/superbwarfare/textures/particle/generic_7.png new file mode 100644 index 0000000000000000000000000000000000000000..09b117e04c40496df1dfa9e5127a1693bb0bad80 GIT binary patch literal 487 zcmV6}P9# z<|7bM127)Y0sXIHCSIAJiamJ+9_k5yz{A5Q1tSBzHxRKsiu5Pqihfr-3#!>%CXR^h zRTaJ>(>ZU%Oq`iVIoH6vDCUyTtPcZXi! zZ!w>Ab;K7oqv$HNVoaqZiwI1+VU`iI@u(lnjF@)AnP_ys^Xn`$)h$HioCQ@QBC-rN z=xn_qqIT*95phIN1rfbtD!O;RZ^c=V_zhRh%ZuB6QQ1Ec`ykRy(HD{>^{1>NEJPX6 d%4gaYegGcwpJhNbIf(!O002ovPDHLkV1oPX+mrwR literal 0 HcmV?d00001