From 553410f2768fce4a03be173e624cc84a06e9417f Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Tue, 4 Feb 2025 01:54:33 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4serverconfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/config/ServerConfig.java | 3 --- .../config/server/ExplosionConfig.java | 14 ++++++++------ .../config/server/ExplosionDestroyConfig.java | 18 ------------------ .../superbwarfare/entity/C4Entity.java | 3 +-- .../superbwarfare/entity/ClaymoreEntity.java | 6 +++--- .../entity/projectile/CannonShellEntity.java | 12 ++++++------ .../entity/projectile/HeliRocketEntity.java | 4 ++-- .../projectile/JavelinMissileEntity.java | 4 ++-- .../entity/projectile/RgoGrenadeEntity.java | 3 +-- .../entity/projectile/RpgRocketEntity.java | 4 ++-- .../projectile/SmallCannonShellEntity.java | 6 +++--- .../entity/projectile/WgMissileEntity.java | 4 ++-- .../entity/vehicle/Ah6Entity.java | 4 ++-- .../entity/vehicle/AnnihilatorEntity.java | 10 +++++----- .../entity/vehicle/Bmp2Entity.java | 3 +-- .../entity/vehicle/DroneEntity.java | 5 ++--- .../entity/vehicle/Lav150Entity.java | 4 ++-- .../entity/vehicle/Mk42Entity.java | 4 ++-- .../entity/vehicle/Mle1934Entity.java | 4 ++-- .../entity/vehicle/SpeedboatEntity.java | 4 ++-- .../entity/vehicle/Tom6Entity.java | 6 +++--- .../entity/vehicle/WheelChairEntity.java | 4 ++-- .../superbwarfare/item/HandGrenade.java | 8 ++++---- .../superbwarfare/item/RgoGrenade.java | 8 ++++---- .../message/LungeMineAttackMessage.java | 6 +++--- .../superbwarfare/tools/CustomExplosion.java | 3 +-- .../superbwarfare/tools/ProjectileTool.java | 4 ++-- 27 files changed, 67 insertions(+), 91 deletions(-) delete mode 100644 src/main/java/com/atsuishio/superbwarfare/config/server/ExplosionDestroyConfig.java diff --git a/src/main/java/com/atsuishio/superbwarfare/config/ServerConfig.java b/src/main/java/com/atsuishio/superbwarfare/config/ServerConfig.java index dedd563b8..ec1bc343c 100644 --- a/src/main/java/com/atsuishio/superbwarfare/config/ServerConfig.java +++ b/src/main/java/com/atsuishio/superbwarfare/config/ServerConfig.java @@ -1,7 +1,6 @@ package com.atsuishio.superbwarfare.config; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; import com.atsuishio.superbwarfare.config.server.SpawnConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig; import net.minecraftforge.common.ForgeConfigSpec; @@ -12,11 +11,9 @@ public class ServerConfig { ForgeConfigSpec.Builder builder = new ForgeConfigSpec.Builder(); SpawnConfig.init(builder); - ExplosionDestroyConfig.init(builder); ExplosionConfig.init(builder); VehicleConfig.init(builder); return builder.build(); } - } diff --git a/src/main/java/com/atsuishio/superbwarfare/config/server/ExplosionConfig.java b/src/main/java/com/atsuishio/superbwarfare/config/server/ExplosionConfig.java index 70f38b4c6..8673dc1e2 100644 --- a/src/main/java/com/atsuishio/superbwarfare/config/server/ExplosionConfig.java +++ b/src/main/java/com/atsuishio/superbwarfare/config/server/ExplosionConfig.java @@ -5,6 +5,7 @@ import net.minecraftforge.common.ForgeConfigSpec; public class ExplosionConfig { public static ForgeConfigSpec.IntValue EXPLOSION_PENETRATION_RATIO; + public static ForgeConfigSpec.BooleanValue EXPLOSION_DESTROY; public static ForgeConfigSpec.IntValue RGO_GRENADE_EXPLOSION_DAMAGE; public static ForgeConfigSpec.IntValue RGO_GRENADE_EXPLOSION_RADIUS; @@ -32,10 +33,10 @@ public class ExplosionConfig { builder.push("explosion"); builder.comment("The percentage of explosion damage you take behind cover"); - EXPLOSION_PENETRATION_RATIO = builder.defineInRange("explosion_destroy", 15, 0, 100); - - builder.pop(); + EXPLOSION_PENETRATION_RATIO = builder.defineInRange("explosion_penetration_ratio", 15, 0, 100); + builder.comment("Set TRUE to allow Explosion to destroy blocks"); + EXPLOSION_DESTROY = builder.define("explosion_destroy", false); builder.push("RGO Grenade"); @@ -59,7 +60,7 @@ public class ExplosionConfig { builder.pop(); - builder.push("Mortar shell"); + builder.push("Mortar Shell"); builder.comment("The explosion damage of Mortar shell"); MORTAR_SHELL_EXPLOSION_DAMAGE = builder.defineInRange("mortar_shell_explosion_damage", 160, 1, 10000000); @@ -98,7 +99,7 @@ public class ExplosionConfig { builder.pop(); - builder.push("Wire_Guide_Missile"); + builder.push("Wire Guide Missile"); builder.comment("The damage of wire guide missile"); WIRE_GUIDE_MISSILE_DAMAGE = builder.defineInRange("wire_guide_missile_damage", 500, 1, Integer.MAX_VALUE); @@ -110,6 +111,7 @@ public class ExplosionConfig { WIRE_GUIDE_MISSILE_EXPLOSION_RADIUS = builder.defineInRange("wire_guide_missile_explosion_radius", 6, 1, Integer.MAX_VALUE); builder.pop(); - } + builder.pop(); + } } diff --git a/src/main/java/com/atsuishio/superbwarfare/config/server/ExplosionDestroyConfig.java b/src/main/java/com/atsuishio/superbwarfare/config/server/ExplosionDestroyConfig.java deleted file mode 100644 index fba11386d..000000000 --- a/src/main/java/com/atsuishio/superbwarfare/config/server/ExplosionDestroyConfig.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.atsuishio.superbwarfare.config.server; - -import net.minecraftforge.common.ForgeConfigSpec; - -public class ExplosionDestroyConfig { - - public static ForgeConfigSpec.BooleanValue EXPLOSION_DESTROY; - - public static void init(ForgeConfigSpec.Builder builder) { - builder.push("explosion_destroy"); - - builder.comment("Set TRUE to allow Explosion to destroy blocks"); - EXPLOSION_DESTROY = builder.define("explosion_destroy", false); - - builder.pop(); - } - -} diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/C4Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/C4Entity.java index 23b67e5b9..d7ba13c8f 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/C4Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/C4Entity.java @@ -2,7 +2,6 @@ package com.atsuishio.superbwarfare.entity; import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; @@ -228,7 +227,7 @@ public class C4Entity extends Entity implements GeoEntity, AnimatedEntity, Ownab private void triggerExplode(Entity target) { CustomExplosion explosion = new CustomExplosion(level(), this, ModDamageTypes.causeProjectileBoomDamage(level().registryAccess(), getOwner(), getOwner()), ExplosionConfig.C4_EXPLOSION_DAMAGE.get(), - target.getX(), target.getY(), target.getZ(), ExplosionConfig.C4_EXPLOSION_RADIUS.get(), ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + target.getX(), target.getY(), target.getZ(), ExplosionConfig.C4_EXPLOSION_RADIUS.get(), ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(level(), explosion); ParticleTool.spawnHugeExplosionParticles(level(), position()); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/ClaymoreEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/ClaymoreEntity.java index 0a8cb2958..72979dfa8 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/ClaymoreEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/ClaymoreEntity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity; import com.atsuishio.superbwarfare.init.*; import com.atsuishio.superbwarfare.tools.CustomExplosion; @@ -232,7 +232,7 @@ public class ClaymoreEntity extends Entity implements GeoEntity, AnimatedEntity, Entity attacker = EntityFindUtil.findEntity(this.level(), this.entityData.get(LAST_ATTACKER_UUID)); CustomExplosion explosion = new CustomExplosion(this.level(), attacker == null ? this : attacker, ModDamageTypes.causeCustomExplosionDamage(this.level().registryAccess(), attacker == null ? this : attacker, attacker == null ? this : attacker), 25.0f, - this.getX(), this.getY(), this.getZ(), 5f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), 5f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); @@ -244,7 +244,7 @@ public class ClaymoreEntity extends Entity implements GeoEntity, AnimatedEntity, private void triggerExplode() { CustomExplosion explosion = new CustomExplosion(this.level(), this, ModDamageTypes.causeMineDamage(this.level().registryAccess(), this.getOwner()), 140f, - this.getX(), this.getEyeY(), this.getZ(), 4f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getEyeY(), this.getZ(), 4f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java index 613c10790..ff1ff8a11 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/CannonShellEntity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.entity.AnimatedEntity; import com.atsuishio.superbwarfare.init.*; import com.atsuishio.superbwarfare.network.message.ClientIndicatorMessage; @@ -213,7 +213,7 @@ public class CannonShellEntity extends ThrowableItemProjectile implements GeoEnt float hardness = this.level().getBlockState(BlockPos.containing(x, y, z)).getBlock().defaultDestroyTime(); this.durability -= (int) hardness; - if (ExplosionDestroyConfig.EXPLOSION_DESTROY.get() && hardness != -1 && hardness <= 50) { + if (ExplosionConfig.EXPLOSION_DESTROY.get() && hardness != -1 && hardness <= 50) { BlockPos blockPos = BlockPos.containing(x, y, z); Block.dropResources(this.level().getBlockState(blockPos), this.level(), BlockPos.containing(x, y, z), null); this.level().destroyBlock(blockPos, true); @@ -241,7 +241,7 @@ public class CannonShellEntity extends ThrowableItemProjectile implements GeoEnt } } else { if (!this.level().isClientSide()) { - if (ExplosionDestroyConfig.EXPLOSION_DESTROY.get()) { + if (ExplosionConfig.EXPLOSION_DESTROY.get()) { if (this.firstHit) { ParticleTool.cannonHitParticles(this.level(), this.position()); causeExplodeBlock(blockHitResult); @@ -298,7 +298,7 @@ public class CannonShellEntity extends ThrowableItemProjectile implements GeoEnt entity.getY() + 0.5 * entity.getBbHeight(), entity.getZ(), radius, - ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). + ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). setDamageMultiplier(1).setFireTime(fireTime); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); @@ -329,7 +329,7 @@ public class CannonShellEntity extends ThrowableItemProjectile implements GeoEnt result.getLocation().y, result.getLocation().z, radius, - ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). + ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). setDamageMultiplier(1).setFireTime(fireTime); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); @@ -356,7 +356,7 @@ public class CannonShellEntity extends ThrowableItemProjectile implements GeoEnt result.getLocation().y, result.getLocation().z, radius, - ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). + ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). setDamageMultiplier(1).setFireTime(fireTime); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/HeliRocketEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/HeliRocketEntity.java index 80ca3bfb6..32886f038 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/HeliRocketEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/HeliRocketEntity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.entity.AnimatedEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; @@ -150,7 +150,7 @@ public class HeliRocketEntity extends ThrowableItemProjectile implements GeoEnti public static void causeRocketExplode(ThrowableItemProjectile projectile, @Nullable DamageSource source, Entity target, float damage, float radius, float damageMultiplier) { CustomExplosion explosion = new CustomExplosion(projectile.level(), projectile, source, damage, - projectile.getX(), projectile.getY(), projectile.getZ(), radius, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(damageMultiplier); + projectile.getX(), projectile.getY(), projectile.getZ(), radius, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(damageMultiplier); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(projectile.level(), explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/JavelinMissileEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/JavelinMissileEntity.java index 197b89ae2..e24ff5fb1 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/JavelinMissileEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/JavelinMissileEntity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.entity.AnimatedEntity; import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; @@ -278,7 +278,7 @@ public class JavelinMissileEntity extends ThrowableItemProjectile implements Geo this.getEyeY(), this.getZ(), explosion_radius, - ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). + ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). setDamageMultiplier(this.monsterMultiplier); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RgoGrenadeEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RgoGrenadeEntity.java index 86910922d..e47a1cea0 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RgoGrenadeEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RgoGrenadeEntity.java @@ -2,7 +2,6 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; import com.atsuishio.superbwarfare.entity.vehicle.DroneEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; @@ -113,7 +112,7 @@ public class RgoGrenadeEntity extends ThrowableItemProjectile implements GeoEnti public static void causeRgoExplode(ThrowableItemProjectile projectile, @Nullable DamageSource source, Entity entity, float damage, float radius, float damageMultiplier) { CustomExplosion explosion = new CustomExplosion(projectile.level(), projectile, source, damage, - projectile.getX(), projectile.getY(), projectile.getZ(), radius, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(damageMultiplier); + projectile.getX(), projectile.getY(), projectile.getZ(), radius, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(damageMultiplier); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(projectile.level(), explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RpgRocketEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RpgRocketEntity.java index e287ce52c..af4fd29a2 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RpgRocketEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/RpgRocketEntity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.entity.AnimatedEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; @@ -178,7 +178,7 @@ public class RpgRocketEntity extends ThrowableItemProjectile implements GeoEntit public static void causeRpgExplode(ThrowableItemProjectile projectile, @Nullable DamageSource source, Entity target, float damage, float radius, float damageMultiplier) { CustomExplosion explosion = new CustomExplosion(projectile.level(), projectile, source, damage, - projectile.getX(), projectile.getY(), projectile.getZ(), radius, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(damageMultiplier); + projectile.getX(), projectile.getY(), projectile.getZ(), radius, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(damageMultiplier); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(projectile.level(), explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java index 4a0d029a6..ad4a22092 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/SmallCannonShellEntity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; import com.atsuishio.superbwarfare.init.ModItems; @@ -123,7 +123,7 @@ public class SmallCannonShellEntity extends ThrowableItemProjectile implements G entity.getY() + 0.6 * entity.getBbHeight(), entity.getZ(), explosionRadius, - ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). + ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). setDamageMultiplier(1.25f); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); @@ -144,7 +144,7 @@ public class SmallCannonShellEntity extends ThrowableItemProjectile implements G result.getLocation().y, result.getLocation().z, explosionRadius, - ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). + ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP). setDamageMultiplier(1.25f); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/WgMissileEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/WgMissileEntity.java index ec02b0665..342df39d1 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/projectile/WgMissileEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/projectile/WgMissileEntity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.projectile; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.entity.AnimatedEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; @@ -172,7 +172,7 @@ public class WgMissileEntity extends ThrowableItemProjectile implements GeoEntit public static void causeMissileExplode(ThrowableItemProjectile projectile, @Nullable DamageSource source, Entity target, float damage, float radius) { CustomExplosion explosion = new CustomExplosion(projectile.level(), projectile, source, damage, - target.getX(), target.getEyeY(), target.getZ(), radius, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1.25f); + target.getX(), target.getEyeY(), target.getZ(), radius, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1.25f); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(projectile.level(), explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java index 3ef047c8a..4b21aafd7 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Ah6Entity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.vehicle; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.entity.projectile.FlareDecoyEntity; import com.atsuishio.superbwarfare.entity.projectile.HeliRocketEntity; @@ -514,7 +514,7 @@ public class Ah6Entity extends ContainerMobileEntity implements GeoEntity, IHeli if (level() instanceof ServerLevel) { CustomExplosion explosion = new CustomExplosion(this.level(), this, ModDamageTypes.causeCustomExplosionDamage(this.level().registryAccess(), this, attacker), 300.0f, - this.getX(), this.getY(), this.getZ(), 8f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), 8f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java index 65a85d8a0..9e1cdb000 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/AnnihilatorEntity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.vehicle; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.init.*; import com.atsuishio.superbwarfare.network.message.ShakeClientMessage; @@ -271,7 +271,7 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, float hardness = this.level().getBlockState(_pos).getBlock().defaultDestroyTime(); - if (ExplosionDestroyConfig.EXPLOSION_DESTROY.get() && hardness != -1) { + if (ExplosionConfig.EXPLOSION_DESTROY.get() && hardness != -1) { Block.dropResources(this.level().getBlockState(_pos), this.level(), _pos, null); this.level().destroyBlock(_pos, true); } @@ -279,7 +279,7 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, if (this.entityData.get(COOL_DOWN) > 98) { laserExplosion(hitPos); } - this.level().explode(this, hitPos.x, hitPos.y, hitPos.z, 5, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Level.ExplosionInteraction.BLOCK : Level.ExplosionInteraction.NONE); + this.level().explode(this, hitPos.x, hitPos.y, hitPos.z, 5, ExplosionConfig.EXPLOSION_DESTROY.get() ? Level.ExplosionInteraction.BLOCK : Level.ExplosionInteraction.NONE); } @@ -332,7 +332,7 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, CustomExplosion explosion = new CustomExplosion(this.level(), passenger, ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), passenger, passenger), 300f, - pos.x, pos.y, pos.z, 15f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + pos.x, pos.y, pos.z, 15f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); @@ -346,7 +346,7 @@ public class AnnihilatorEntity extends EnergyVehicleEntity implements GeoEntity, if (level() instanceof ServerLevel) { CustomExplosion explosion = new CustomExplosion(this.level(), this, ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), attacker, attacker), 600f, - this.getX(), this.getY(), this.getZ(), 15f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), 15f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); 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 92a21a651..e6ac06837 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Bmp2Entity.java @@ -2,7 +2,6 @@ package com.atsuishio.superbwarfare.entity.vehicle; import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity; import com.atsuishio.superbwarfare.entity.projectile.SmallCannonShellEntity; @@ -700,7 +699,7 @@ public class Bmp2Entity extends ContainerMobileEntity implements GeoEntity, ICha if (level() instanceof ServerLevel) { CustomExplosion explosion = new CustomExplosion(this.level(), this, ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), attacker, attacker), 80f, - this.getX(), this.getY(), this.getZ(), 5f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), 5f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); 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 db6faf374..039f29965 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/DroneEntity.java @@ -1,7 +1,6 @@ package com.atsuishio.superbwarfare.entity.vehicle; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; import com.atsuishio.superbwarfare.entity.C4Entity; import com.atsuishio.superbwarfare.entity.projectile.FlareDecoyEntity; import com.atsuishio.superbwarfare.entity.projectile.LaserEntity; @@ -566,11 +565,11 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity { CustomExplosion explosion = switch (mode) { case 1 -> new CustomExplosion(this.level(), this, ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), attacker, attacker), ExplosionConfig.DRONE_KAMIKAZE_EXPLOSION_DAMAGE.get(), - this.getX(), this.getY(), this.getZ(), ExplosionConfig.DRONE_KAMIKAZE_EXPLOSION_RADIUS.get(), ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), ExplosionConfig.DRONE_KAMIKAZE_EXPLOSION_RADIUS.get(), ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); case 2 -> new CustomExplosion(this.level(), this, ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), attacker, attacker), ExplosionConfig.C4_EXPLOSION_DAMAGE.get(), - this.getX(), this.getY(), this.getZ(), ExplosionConfig.C4_EXPLOSION_RADIUS.get(), ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), ExplosionConfig.C4_EXPLOSION_RADIUS.get(), ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); default -> null; }; 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 fe5d798c9..8f7cfdc08 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Lav150Entity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.vehicle; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity; import com.atsuishio.superbwarfare.entity.projectile.SmallCannonShellEntity; @@ -669,7 +669,7 @@ public class Lav150Entity extends ContainerMobileEntity implements GeoEntity, IC if (level() instanceof ServerLevel) { CustomExplosion explosion = new CustomExplosion(this.level(), this, ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), attacker, attacker), 80f, - this.getX(), this.getY(), this.getZ(), 5f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), 5f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java index 755a34fbd..64838ed69 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mk42Entity.java @@ -2,7 +2,7 @@ package com.atsuishio.superbwarfare.entity.vehicle; import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.client.gui.RangeHelper; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.entity.projectile.CannonShellEntity; import com.atsuishio.superbwarfare.init.*; @@ -202,7 +202,7 @@ public class Mk42Entity extends VehicleEntity implements GeoEntity, ICannonEntit if (level() instanceof ServerLevel) { CustomExplosion explosion = new CustomExplosion(this.level(), this, ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), attacker, attacker), 100f, - this.getX(), this.getY(), this.getZ(), 7f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), 7f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java index 20a95efb6..4d20051ca 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Mle1934Entity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.vehicle; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.entity.projectile.CannonShellEntity; import com.atsuishio.superbwarfare.init.*; @@ -209,7 +209,7 @@ public class Mle1934Entity extends VehicleEntity implements GeoEntity, ICannonEn if (level() instanceof ServerLevel) { CustomExplosion explosion = new CustomExplosion(this.level(), this, ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), attacker, attacker), 120f, - this.getX(), this.getY(), this.getZ(), 6f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), 6f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java index 8b9e70867..221409e92 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/SpeedboatEntity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.vehicle; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity; import com.atsuishio.superbwarfare.init.*; @@ -458,7 +458,7 @@ public class SpeedboatEntity extends ContainerMobileEntity implements GeoEntity, if (level() instanceof ServerLevel) { CustomExplosion explosion = new CustomExplosion(this.level(), this, ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), attacker, attacker), 80f, - this.getX(), this.getY(), this.getZ(), 5f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), 5f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java index ec1b4b169..cedd2bfbc 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/Tom6Entity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.vehicle; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.config.server.VehicleConfig; import com.atsuishio.superbwarfare.entity.projectile.MelonBombEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; @@ -323,7 +323,7 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { if (entityData.get(MELON)) { CustomExplosion explosion = new CustomExplosion(this.level(), this, ModDamageTypes.causeCustomExplosionDamage(this.level().registryAccess(), this, attacker), VehicleConfig.TOM_6_BOMB_EXPLOSION_DAMAGE.get(), - this.getX(), this.getY(), this.getZ(), VehicleConfig.TOM_6_BOMB_EXPLOSION_RADIUS.get().floatValue(), ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), VehicleConfig.TOM_6_BOMB_EXPLOSION_RADIUS.get().floatValue(), ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); @@ -331,7 +331,7 @@ public class Tom6Entity extends MobileVehicleEntity implements GeoEntity { } else { CustomExplosion explosion = new CustomExplosion(this.level(), this, ModDamageTypes.causeCustomExplosionDamage(this.level().registryAccess(), this, attacker), 15.0f, - this.getX(), this.getY(), this.getZ(), 2f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), 2f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java index 2f849f71f..69c90b634 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/WheelChairEntity.java @@ -1,7 +1,7 @@ package com.atsuishio.superbwarfare.entity.vehicle; import com.atsuishio.superbwarfare.ModUtils; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.entity.MortarEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModEntities; @@ -276,7 +276,7 @@ public class WheelChairEntity extends MobileVehicleEntity implements GeoEntity { if (level() instanceof ServerLevel) { CustomExplosion explosion = new CustomExplosion(this.level(), this, ModDamageTypes.causeProjectileBoomDamage(this.level().registryAccess(), attacker, attacker), 10f, - this.getX(), this.getY(), this.getZ(), 2f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); + this.getX(), this.getY(), this.getZ(), 2f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/item/HandGrenade.java b/src/main/java/com/atsuishio/superbwarfare/item/HandGrenade.java index 3de70aa65..ffba9052b 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/HandGrenade.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/HandGrenade.java @@ -1,11 +1,11 @@ package com.atsuishio.superbwarfare.item; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.entity.projectile.HandGrenadeEntity; -import com.atsuishio.superbwarfare.tools.CustomExplosion; -import com.atsuishio.superbwarfare.tools.ParticleTool; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModSounds; +import com.atsuishio.superbwarfare.tools.CustomExplosion; +import com.atsuishio.superbwarfare.tools.ParticleTool; import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; @@ -71,7 +71,7 @@ public class HandGrenade extends Item { if (!pLevel.isClientSide) { CustomExplosion explosion = new CustomExplosion(pLevel, null, ModDamageTypes.causeProjectileBoomDamage(pLevel.registryAccess(), pLivingEntity, pLivingEntity), 90, - pLivingEntity.getX(), pLivingEntity.getY(), pLivingEntity.getZ(), 6.5f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1.25f); + pLivingEntity.getX(), pLivingEntity.getY(), pLivingEntity.getZ(), 6.5f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1.25f); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(pLevel, explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/item/RgoGrenade.java b/src/main/java/com/atsuishio/superbwarfare/item/RgoGrenade.java index 47a0476d9..0e5f640fd 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/RgoGrenade.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/RgoGrenade.java @@ -1,11 +1,11 @@ package com.atsuishio.superbwarfare.item; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.entity.projectile.RgoGrenadeEntity; -import com.atsuishio.superbwarfare.tools.CustomExplosion; -import com.atsuishio.superbwarfare.tools.ParticleTool; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModSounds; +import com.atsuishio.superbwarfare.tools.CustomExplosion; +import com.atsuishio.superbwarfare.tools.ParticleTool; import net.minecraft.server.level.ServerPlayer; import net.minecraft.sounds.SoundSource; import net.minecraft.world.InteractionHand; @@ -71,7 +71,7 @@ public class RgoGrenade extends Item { if (!pLevel.isClientSide) { CustomExplosion explosion = new CustomExplosion(pLevel, null, ModDamageTypes.causeProjectileBoomDamage(pLevel.registryAccess(), pLivingEntity, pLivingEntity), 75, - pLivingEntity.getX(), pLivingEntity.getY(), pLivingEntity.getZ(), 5.75f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1.25f); + pLivingEntity.getX(), pLivingEntity.getY(), pLivingEntity.getZ(), 5.75f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1.25f); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(pLevel, explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/network/message/LungeMineAttackMessage.java b/src/main/java/com/atsuishio/superbwarfare/network/message/LungeMineAttackMessage.java index 6deaeba50..f7e7e08ce 100644 --- a/src/main/java/com/atsuishio/superbwarfare/network/message/LungeMineAttackMessage.java +++ b/src/main/java/com/atsuishio/superbwarfare/network/message/LungeMineAttackMessage.java @@ -1,6 +1,6 @@ package com.atsuishio.superbwarfare.network.message; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.entity.vehicle.VehicleEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; import com.atsuishio.superbwarfare.init.ModItems; @@ -66,7 +66,7 @@ public class LungeMineAttackMessage { } CustomExplosion explosion = new CustomExplosion(player.level(), null, ModDamageTypes.causeProjectileBoomDamage(player.level().registryAccess(), player, player), 60, - message.hitResult.getLocation().x, message.hitResult.getLocation().y, message.hitResult.getLocation().z, 4f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1.25f); + message.hitResult.getLocation().x, message.hitResult.getLocation().y, message.hitResult.getLocation().z, 4f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1.25f); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(player.level(), explosion); explosion.finalizeExplosion(false); @@ -83,7 +83,7 @@ public class LungeMineAttackMessage { public static void causeLungeMineExplode(Level pLevel, Entity entity, Entity pLivingEntity) { CustomExplosion explosion = new CustomExplosion(pLevel, pLivingEntity, ModDamageTypes.causeProjectileBoomDamage(pLevel.registryAccess(), pLivingEntity, entity), 60, - pLivingEntity.getX(), pLivingEntity.getEyeY(), pLivingEntity.getZ(), 4f, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1.25f); + pLivingEntity.getX(), pLivingEntity.getEyeY(), pLivingEntity.getZ(), 4f, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(1.25f); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(pLevel, explosion); explosion.finalizeExplosion(false); diff --git a/src/main/java/com/atsuishio/superbwarfare/tools/CustomExplosion.java b/src/main/java/com/atsuishio/superbwarfare/tools/CustomExplosion.java index 25dc2dac4..e22e14687 100644 --- a/src/main/java/com/atsuishio/superbwarfare/tools/CustomExplosion.java +++ b/src/main/java/com/atsuishio/superbwarfare/tools/CustomExplosion.java @@ -2,7 +2,6 @@ package com.atsuishio.superbwarfare.tools; import com.atsuishio.superbwarfare.ModUtils; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; import com.atsuishio.superbwarfare.network.message.ShakeClientMessage; import com.google.common.collect.Sets; import net.minecraft.core.BlockPos; @@ -72,7 +71,7 @@ public class CustomExplosion extends Explosion { } } if (pLevel instanceof ServerLevel) { - pLevel.explode(source == null ? null : source.getEntity(), pToBlowX, pToBlowY, pToBlowZ, 0.5f * pRadius , ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Level.ExplosionInteraction.BLOCK : Level.ExplosionInteraction.NONE); + pLevel.explode(source == null ? null : source.getEntity(), pToBlowX, pToBlowY, pToBlowZ, 0.5f * pRadius , ExplosionConfig.EXPLOSION_DESTROY.get() ? Level.ExplosionInteraction.BLOCK : Level.ExplosionInteraction.NONE); } } diff --git a/src/main/java/com/atsuishio/superbwarfare/tools/ProjectileTool.java b/src/main/java/com/atsuishio/superbwarfare/tools/ProjectileTool.java index bea5ae199..94e481682 100644 --- a/src/main/java/com/atsuishio/superbwarfare/tools/ProjectileTool.java +++ b/src/main/java/com/atsuishio/superbwarfare/tools/ProjectileTool.java @@ -1,6 +1,6 @@ package com.atsuishio.superbwarfare.tools; -import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.init.ModDamageTypes; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.entity.Entity; @@ -16,7 +16,7 @@ public class ProjectileTool { target.getX(), target.getY() + 0.5 * target.getBbHeight(), target.getZ(), - radius, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(damageMultiplier); + radius, ExplosionConfig.EXPLOSION_DESTROY.get() ? Explosion.BlockInteraction.DESTROY : Explosion.BlockInteraction.KEEP).setDamageMultiplier(damageMultiplier); explosion.explode(); net.minecraftforge.event.ForgeEventFactory.onExplosionStart(projectile.level(), explosion); explosion.finalizeExplosion(false);