From c392b62a9779cb672875e1155f686d17e722402d Mon Sep 17 00:00:00 2001 From: Atsuihsio <842960157@qq.com> Date: Sat, 21 Dec 2024 01:47:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=B7=B7=E5=90=88=E7=88=86?= =?UTF-8?q?=E7=82=B8=E6=95=88=E6=9E=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../superbwarfare/item/gun/launcher/JavelinItem.java | 4 ---- .../com/atsuishio/superbwarfare/tools/CustomExplosion.java | 5 ++--- 2 files changed, 2 insertions(+), 7 deletions(-) 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) {