fix the build after paper update

This commit is contained in:
2025-05-13 23:47:46 +02:00
parent eb3f7888ea
commit cb848460c0
@@ -17,12 +17,13 @@ import org.bukkit.event.EventPriority;
import org.bukkit.event.Listener; import org.bukkit.event.Listener;
import org.bukkit.event.entity.EntityDamageByEntityEvent; import org.bukkit.event.entity.EntityDamageByEntityEvent;
import org.bukkit.inventory.EntityEquipment; import org.bukkit.inventory.EntityEquipment;
import org.jetbrains.annotations.NotNull;
@SuppressWarnings("UnstableApiUsage") @SuppressWarnings("UnstableApiUsage")
public class ExecutionerListener implements Listener { public class ExecutionerListener implements Listener {
private final Registry<Enchantment> registry = RegistryAccess.registryAccess().getRegistry(RegistryKey.ENCHANTMENT); private final Registry<@NotNull Enchantment> registry = RegistryAccess.registryAccess().getRegistry(RegistryKey.ENCHANTMENT);
private final Enchantment executioner = registry.get(ExecutionerEnchant.KEY); private final Enchantment executioner = registry.get(ExecutionerEnchant.KEY);
@EventHandler(ignoreCancelled = true, priority = EventPriority.NORMAL) @EventHandler(ignoreCancelled = true, priority = EventPriority.NORMAL)
@@ -43,7 +44,7 @@ public class ExecutionerListener implements Listener {
Entity target = event.getEntity(); Entity target = event.getEntity();
if (!(target instanceof LivingEntity livingEntity)) return; if (!(target instanceof LivingEntity livingEntity)) return;
AttributeInstance maxHealthAttribute = livingEntity.getAttribute(Attribute.GENERIC_MAX_HEALTH); AttributeInstance maxHealthAttribute = livingEntity.getAttribute(Attribute.MAX_HEALTH);
if (maxHealthAttribute == null) return; if (maxHealthAttribute == null) return;
double targetMaxHealth = maxHealthAttribute.getValue(); double targetMaxHealth = maxHealthAttribute.getValue();