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 000000000..a9a2ea820 Binary files /dev/null and b/src/main/resources/assets/superbwarfare/textures/particle/generic_0.png differ 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 000000000..973d5c496 Binary files /dev/null and b/src/main/resources/assets/superbwarfare/textures/particle/generic_1.png differ diff --git a/src/main/resources/assets/superbwarfare/textures/particle/generic_2.png b/src/main/resources/assets/superbwarfare/textures/particle/generic_2.png new file mode 100644 index 000000000..1e144c9e4 Binary files /dev/null and b/src/main/resources/assets/superbwarfare/textures/particle/generic_2.png differ 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 000000000..fd455427c Binary files /dev/null and b/src/main/resources/assets/superbwarfare/textures/particle/generic_3.png differ diff --git a/src/main/resources/assets/superbwarfare/textures/particle/generic_4.png b/src/main/resources/assets/superbwarfare/textures/particle/generic_4.png new file mode 100644 index 000000000..c8985260d Binary files /dev/null and b/src/main/resources/assets/superbwarfare/textures/particle/generic_4.png differ 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 000000000..834c3ac25 Binary files /dev/null and b/src/main/resources/assets/superbwarfare/textures/particle/generic_5.png differ diff --git a/src/main/resources/assets/superbwarfare/textures/particle/generic_6.png b/src/main/resources/assets/superbwarfare/textures/particle/generic_6.png new file mode 100644 index 000000000..4961e1c8d Binary files /dev/null and b/src/main/resources/assets/superbwarfare/textures/particle/generic_6.png differ 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 000000000..09b117e04 Binary files /dev/null and b/src/main/resources/assets/superbwarfare/textures/particle/generic_7.png differ