diff --git a/src/main/java/com/atsuishio/superbwarfare/mobeffect/BurnMobEffect.java b/src/main/java/com/atsuishio/superbwarfare/mobeffect/BurnMobEffect.java index 73cc587a3..05d83da5c 100644 --- a/src/main/java/com/atsuishio/superbwarfare/mobeffect/BurnMobEffect.java +++ b/src/main/java/com/atsuishio/superbwarfare/mobeffect/BurnMobEffect.java @@ -20,7 +20,6 @@ import net.neoforged.neoforge.event.entity.living.MobEffectEvent; import net.neoforged.neoforge.event.tick.EntityTickEvent; import net.neoforged.neoforge.network.PacketDistributor; -// TODO 解决加上效果就立刻消失的问题 @EventBusSubscriber(bus = EventBusSubscriber.Bus.GAME) public class BurnMobEffect extends MobEffect { @@ -44,8 +43,7 @@ public class BurnMobEffect extends MobEffect { player.level().playSound(null, player.blockPosition(), ModSounds.INDICATION.get(), SoundSource.VOICE, 1, 1); PacketDistributor.sendToPlayer(player, new ClientIndicatorMessage(0, 5)); } - - return false; + return true; } @Override diff --git a/src/main/java/com/atsuishio/superbwarfare/mobeffect/ShockMobEffect.java b/src/main/java/com/atsuishio/superbwarfare/mobeffect/ShockMobEffect.java index 6096bd159..93573063c 100644 --- a/src/main/java/com/atsuishio/superbwarfare/mobeffect/ShockMobEffect.java +++ b/src/main/java/com/atsuishio/superbwarfare/mobeffect/ShockMobEffect.java @@ -50,7 +50,7 @@ public class ShockMobEffect extends MobEffect { player.level().playSound(null, player.blockPosition(), ModSounds.INDICATION.get(), SoundSource.VOICE, 1, 1); PacketDistributor.sendToPlayer(player, new ClientIndicatorMessage(0, 5)); } - return false; + return true; } @Override @@ -58,13 +58,12 @@ public class ShockMobEffect extends MobEffect { return duration % 20 == 0; } - @SubscribeEvent public static void onEffectAdded(MobEffectEvent.Added event) { LivingEntity living = event.getEntity(); MobEffectInstance instance = event.getEffectInstance(); - if (instance == null || !ModMobEffects.SHOCK.get().equals(instance.getEffect())) { + if (instance == null || !ModMobEffects.SHOCK.get().equals(instance.getEffect().value())) { return; } @@ -107,7 +106,7 @@ public class ShockMobEffect extends MobEffect { return; } - if (instance.getEffect().equals(ModMobEffects.SHOCK.get())) { + if (instance.getEffect().equals(ModMobEffects.SHOCK)) { living.getPersistentData().remove("TargetShockAttacker"); } }