Skip to content

Commit

Permalink
crazy fix
Browse files Browse the repository at this point in the history
  • Loading branch information
not-coded committed Dec 28, 2024
1 parent 5e90cdd commit 7b8089d
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
import com.nexia.base.player.NexiaPlayer;
import com.nexia.ffa.uhc.utilities.FfaUhcUtil;
import com.nexia.nexus.api.event.entity.LivingEntityHealEvent;
import com.nexia.nexus.api.world.entity.player.Player;

public class LivingEntityHealListener {
public void registerListener() {
LivingEntityHealEvent.BACKEND.register(livingEntityHealEvent -> {
if (!(livingEntityHealEvent.getEntity() instanceof NexiaPlayer nexiaPlayer)) return;
if (!(livingEntityHealEvent.getEntity() instanceof Player player)) return;
NexiaPlayer nexiaPlayer = new NexiaPlayer(player);

if (FfaUhcUtil.INSTANCE.isFfaPlayer(nexiaPlayer) && livingEntityHealEvent.getCause() == LivingEntityHealEvent.HealCause.NATURAL_REGENERATION) {
livingEntityHealEvent.setCancelled(true);
Expand Down

0 comments on commit 7b8089d

Please sign in to comment.