diff --git a/src/main/java/com/atsuishio/superbwarfare/client/ClickHandler.java b/src/main/java/com/atsuishio/superbwarfare/client/ClickHandler.java index 45db8ad30..6094cdc04 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/ClickHandler.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/ClickHandler.java @@ -218,9 +218,6 @@ public class ClickHandler { ClientEventHandler.holdFire = false; ModUtils.PACKET_HANDLER.sendToServer(new EditModeMessage(0)); } - if (key == ModKeyMappings.LAUNCH.getKey().getValue()) { - handleLaunchPress(player); - } if (player.getCapability(ModVariables.PLAYER_VARIABLES_CAPABILITY, null).orElse(new ModVariables.PlayerVariables()).edit) { if (!(stack.getItem() instanceof GunItem gunItem)) return; @@ -473,11 +470,4 @@ public class ClickHandler { } ModUtils.PACKET_HANDLER.sendToServer(new PlayerStopRidingMessage(0)); } - - private static void handleLaunchPress(Player player) { - ItemStack item = player.getMainHandItem(); - if (item.is(ModItems.C4_BOMB.get())) { - item.use(player.level(),player,player.getUsedItemHand()); - } - } } \ No newline at end of file diff --git a/src/main/java/com/atsuishio/superbwarfare/client/overlay/KillMessageOverlay.java b/src/main/java/com/atsuishio/superbwarfare/client/overlay/KillMessageOverlay.java index b382cd011..b2bfe9ea8 100644 --- a/src/main/java/com/atsuishio/superbwarfare/client/overlay/KillMessageOverlay.java +++ b/src/main/java/com/atsuishio/superbwarfare/client/overlay/KillMessageOverlay.java @@ -268,9 +268,7 @@ public class KillMessageOverlay { icon = BEAST; } else if (record.damageType == ModDamageTypes.MINE) { icon = CLAYMORE; - } else if (record.damageType == ModDamageTypes.C4) { - icon = EXPLOSION; - } else if (record.damageType == ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation("dreamaticvoyage", "bleeding"))) { + } else if (record.damageType == ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation("dreamaticvoyage", "bleeding"))) { icon = BLEEDING; } else if (record.damageType == ResourceKey.create(Registries.DAMAGE_TYPE, new ResourceLocation("dreamaticvoyage", "blood_crystal"))) { icon = BLOOD_CRYSTAL; diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/C4Entity.java b/src/main/java/com/atsuishio/superbwarfare/entity/C4Entity.java index 9840abf23..9dba40b8d 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/C4Entity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/C4Entity.java @@ -270,11 +270,12 @@ public class C4Entity extends Entity implements GeoEntity, AnimatedEntity, Ownab } private void triggerExplode(Entity target) { - CustomExplosion explosion = new CustomExplosion(this.level(), this, - ModDamageTypes.causeC4Damage(this.level().registryAccess(), this.getOwner()), ExplosionConfig.C4_EXPLOSION_DAMAGE.get(), + 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); explosion.explode(); - net.minecraftforge.event.ForgeEventFactory.onExplosionStart(this.level(), explosion); + net.minecraftforge.event.ForgeEventFactory.onExplosionStart(level(), explosion); + ParticleTool.spawnHugeExplosionParticles(level(),position()); explosion.finalizeExplosion(false); } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/DroneEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/DroneEntity.java index 13c9b0ebf..4dc9351ba 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/DroneEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/DroneEntity.java @@ -2,6 +2,9 @@ package com.atsuishio.superbwarfare.entity; import com.atsuishio.superbwarfare.config.server.ExplosionConfig; import com.atsuishio.superbwarfare.config.server.ExplosionDestroyConfig; +import com.atsuishio.superbwarfare.entity.projectile.FlareDecoyEntity; +import com.atsuishio.superbwarfare.entity.projectile.LaserEntity; +import com.atsuishio.superbwarfare.entity.projectile.ProjectileEntity; import com.atsuishio.superbwarfare.entity.projectile.RgoGrenadeEntity; import com.atsuishio.superbwarfare.entity.vehicle.MobileVehicleEntity; import com.atsuishio.superbwarfare.init.ModDamageTypes; @@ -31,11 +34,13 @@ import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.damagesource.DamageSource; import net.minecraft.world.damagesource.DamageTypes; +import net.minecraft.world.entity.AreaEffectCloud; import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.MoverType; import net.minecraft.world.entity.item.ItemEntity; import net.minecraft.world.entity.player.Player; +import net.minecraft.world.entity.projectile.Projectile; import net.minecraft.world.item.ItemStack; import net.minecraft.world.level.Explosion; import net.minecraft.world.level.Level; @@ -460,7 +465,8 @@ public class DroneEntity extends MobileVehicleEntity implements GeoEntity { var level = this.level(); final Vec3 center = new Vec3(this.getX(), this.getY(), this.getZ()); for (Entity target : level.getEntitiesOfClass(Entity.class, aabb, e -> true).stream().sorted(Comparator.comparingDouble(e -> e.distanceToSqr(center))).toList()) { - if (this != target && target != null && !(target instanceof RgoGrenadeEntity)) { + if (this != target && target != null + && !(target instanceof ItemEntity || target instanceof Projectile || target instanceof ProjectileEntity || target instanceof LaserEntity || target instanceof FlareDecoyEntity || target instanceof AreaEffectCloud || target instanceof C4Entity)) { hitEntityCrash(controller, target); } } diff --git a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MobileVehicleEntity.java b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MobileVehicleEntity.java index 8ef0d029e..9484100bd 100644 --- a/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MobileVehicleEntity.java +++ b/src/main/java/com/atsuishio/superbwarfare/entity/vehicle/MobileVehicleEntity.java @@ -1,5 +1,6 @@ package com.atsuishio.superbwarfare.entity.vehicle; +import com.atsuishio.superbwarfare.entity.C4Entity; import com.atsuishio.superbwarfare.entity.DroneEntity; import com.atsuishio.superbwarfare.entity.TargetEntity; import com.atsuishio.superbwarfare.entity.projectile.FlareDecoyEntity; @@ -164,7 +165,7 @@ public class MobileVehicleEntity extends EnergyVehicleEntity { var entities = level().getEntities(EntityTypeTest.forClass(Entity.class), frontBox, entity -> entity != this && entity != getFirstPassenger() && entity.getVehicle() == null) .stream().filter(entity -> entity.isAlive() - && !(entity instanceof ItemEntity || entity instanceof Projectile || entity instanceof ProjectileEntity || entity instanceof LaserEntity || entity instanceof FlareDecoyEntity || entity instanceof AreaEffectCloud) + && !(entity instanceof ItemEntity || entity instanceof Projectile || entity instanceof ProjectileEntity || entity instanceof LaserEntity || entity instanceof FlareDecoyEntity || entity instanceof AreaEffectCloud || entity instanceof C4Entity) && !(entity instanceof Player player && (player.isSpectator() || player.isCreative()))) .toList(); diff --git a/src/main/java/com/atsuishio/superbwarfare/init/ModDamageTypes.java b/src/main/java/com/atsuishio/superbwarfare/init/ModDamageTypes.java index 3d3da90cd..38ec98115 100644 --- a/src/main/java/com/atsuishio/superbwarfare/init/ModDamageTypes.java +++ b/src/main/java/com/atsuishio/superbwarfare/init/ModDamageTypes.java @@ -22,7 +22,6 @@ public class ModDamageTypes { public static final ResourceKey GUN_FIRE_HEADSHOT_ABSOLUTE = ResourceKey.create(Registries.DAMAGE_TYPE, ModUtils.loc("gunfire_headshot_absolute")); public static final ResourceKey BURN = ResourceKey.create(Registries.DAMAGE_TYPE, ModUtils.loc("burn")); public static final ResourceKey MINE = ResourceKey.create(Registries.DAMAGE_TYPE, ModUtils.loc("mine")); - public static final ResourceKey C4 = ResourceKey.create(Registries.DAMAGE_TYPE, ModUtils.loc("c4")); public static final ResourceKey BEAST = ResourceKey.create(Registries.DAMAGE_TYPE, ModUtils.loc("beast")); public static final ResourceKey SHOCK = ResourceKey.create(Registries.DAMAGE_TYPE, ModUtils.loc("shock")); public static final ResourceKey PROJECTILE_BOOM = ResourceKey.create(Registries.DAMAGE_TYPE, ModUtils.loc("projectile_boom")); @@ -48,10 +47,6 @@ public class ModDamageTypes { return new DamageMessages(registryAccess.registry(Registries.DAMAGE_TYPE).get().getHolderOrThrow(MINE), entity); } - public static DamageSource causeC4Damage(RegistryAccess registryAccess, @Nullable Entity entity) { - return new DamageMessages(registryAccess.registry(Registries.DAMAGE_TYPE).get().getHolderOrThrow(C4), entity); - } - public static DamageSource causeShockDamage(RegistryAccess registryAccess, @Nullable Entity attacker) { return new DamageMessages(registryAccess.registry(Registries.DAMAGE_TYPE).get().getHolderOrThrow(SHOCK), attacker); } diff --git a/src/main/java/com/atsuishio/superbwarfare/init/ModKeyMappings.java b/src/main/java/com/atsuishio/superbwarfare/init/ModKeyMappings.java index 94d9de2d8..9bc7ebc70 100644 --- a/src/main/java/com/atsuishio/superbwarfare/init/ModKeyMappings.java +++ b/src/main/java/com/atsuishio/superbwarfare/init/ModKeyMappings.java @@ -55,7 +55,6 @@ public class ModKeyMappings { public static final KeyMapping SWITCH_ZOOM = new KeyMapping("key.superbwarfare.switch_zoom", GLFW.GLFW_KEY_UNKNOWN, "key.categories.superbwarfare"); public static final KeyMapping RELEASE_DECOY = new KeyMapping("key.superbwarfare.release_decoy", GLFW.GLFW_KEY_X, "key.categories.superbwarfare"); public static final KeyMapping MELEE = new KeyMapping("key.superbwarfare.melee", GLFW.GLFW_KEY_V, "key.categories.superbwarfare"); - public static final KeyMapping LAUNCH = new KeyMapping("key.superbwarfare.launch", GLFW.GLFW_KEY_H, "key.categories.superbwarfare"); @SubscribeEvent public static void registerKeyMappings(RegisterKeyMappingsEvent event) { @@ -78,7 +77,6 @@ public class ModKeyMappings { event.register(SWITCH_ZOOM); event.register(RELEASE_DECOY); event.register(MELEE); - event.register(LAUNCH); } @Mod.EventBusSubscriber(value = Dist.CLIENT) diff --git a/src/main/resources/assets/superbwarfare/lang/en_us.json b/src/main/resources/assets/superbwarfare/lang/en_us.json index 63147fd4d..c87a9fb2d 100644 --- a/src/main/resources/assets/superbwarfare/lang/en_us.json +++ b/src/main/resources/assets/superbwarfare/lang/en_us.json @@ -340,9 +340,6 @@ "death.attack.mine": "%1$s step on Claymore", "death.attack.mine.entity": "%1$s step on %2$s's Claymore", "death.attack.mine.item": "%1$s step on %2$s's Claymore", - "death.attack.c4": "%1$s gasified", - "death.attack.c4.entity": "%1$s was killed by %2$s's C4", - "death.attack.c4.item": "%1$s was killed by %2$s's C4", "death.attack.shock": "%1$s was shocked", "death.attack.shock.entity": "%1$s was shocked by %2$s", "death.attack.shock.item": "%1$s was shocked by %2$s", diff --git a/src/main/resources/assets/superbwarfare/lang/zh_cn.json b/src/main/resources/assets/superbwarfare/lang/zh_cn.json index 887baa386..903487ce2 100644 --- a/src/main/resources/assets/superbwarfare/lang/zh_cn.json +++ b/src/main/resources/assets/superbwarfare/lang/zh_cn.json @@ -338,9 +338,6 @@ "death.attack.mine": "%1$s不慎踩到了阔剑地雷", "death.attack.mine.entity": "%1$s踩到了%2$s的阔剑地雷", "death.attack.mine.item": "%1$s踩到了%2$s的阔剑地雷", - "death.attack.c4": "%1$s蒸发了", - "death.attack.c4.entity": "%1$s被%2$s的C4炸死了", - "death.attack.c4.item": "%1$s被%2$s的C4炸死了", "death.attack.shock": "%1$s被电麻了", "death.attack.shock.entity": "%1$s被%2$s电麻了", "death.attack.shock.item": "%1$s被%2$s电麻了", diff --git a/src/main/resources/data/superbwarfare/damage_type/c4.json b/src/main/resources/data/superbwarfare/damage_type/c4.json deleted file mode 100644 index aa3a85e06..000000000 --- a/src/main/resources/data/superbwarfare/damage_type/c4.json +++ /dev/null @@ -1,5 +0,0 @@ -{ - "exhaustion": 0, - "message_id": "c4", - "scaling": "never" -} \ No newline at end of file