diff --git a/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/JavelinItem.java b/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/JavelinItem.java index cc5e961f0..89220f0f4 100644 --- a/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/JavelinItem.java +++ b/src/main/java/com/atsuishio/superbwarfare/item/gun/launcher/JavelinItem.java @@ -154,10 +154,6 @@ public class JavelinItem extends GunItem implements GeoItem, AnimatedItem { } if (seekingEntity != null && tag.getInt("SeekTime") > 20) { -// if (seekingEntity instanceof LivingEntity living) { -// living.addEffect(new MobEffectInstance(MobEffects.GLOWING, 40, 0)); -// } - if (player instanceof ServerPlayer serverPlayer) { SoundTool.playLocalSound(serverPlayer, ModSounds.JAVELIN_LOCKON.get(), 2, 1); } diff --git a/src/main/java/com/atsuishio/superbwarfare/tools/CustomExplosion.java b/src/main/java/com/atsuishio/superbwarfare/tools/CustomExplosion.java index 7ad6336e0..95ba4d05c 100644 --- a/src/main/java/com/atsuishio/superbwarfare/tools/CustomExplosion.java +++ b/src/main/java/com/atsuishio/superbwarfare/tools/CustomExplosion.java @@ -2,6 +2,7 @@ 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; @@ -65,15 +66,13 @@ public class CustomExplosion extends Explosion { public CustomExplosion(Level pLevel, @Nullable Entity pSource, @Nullable DamageSource source, float damage, double pToBlowX, double pToBlowY, double pToBlowZ, float pRadius, Explosion.BlockInteraction pBlockInteraction) { this(pLevel, pSource, source, null, damage, pToBlowX, pToBlowY, pToBlowZ, pRadius, pBlockInteraction); - final Vec3 center = new Vec3(pToBlowX, pToBlowY, pToBlowZ); - for (Entity target : level.getEntitiesOfClass(Entity.class, new AABB(center, center).inflate(4 * radius), e -> true).stream().sorted(Comparator.comparingDouble(e -> e.distanceToSqr(center))).toList()) { - if (target instanceof ServerPlayer serverPlayer) { ModUtils.PACKET_HANDLER.send(PacketDistributor.PLAYER.with(() -> serverPlayer), new ShakeClientMessage(20 + 0.02 * damage,3 * pRadius,50 + 0.05 * damage, pToBlowX, pToBlowY, pToBlowZ)); } } + pLevel.explode(source == null ? null : source.getEntity(), pToBlowX, pToBlowY, pToBlowZ, pRadius / 2, ExplosionDestroyConfig.EXPLOSION_DESTROY.get() ? Level.ExplosionInteraction.BLOCK : Level.ExplosionInteraction.NONE); } public CustomExplosion(Level pLevel, @Nullable Entity pSource, @Nullable DamageSource source, float damage, double pToBlowX, double pToBlowY, double pToBlowZ, float pRadius) {