diff --git a/main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java b/main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java index 45de9a50e..597c9b430 100644 --- a/main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java +++ b/main/src/main/java/net/citizensnpcs/npc/CitizensNPC.java @@ -399,7 +399,7 @@ public class CitizensNPC extends AbstractNPC { if (type == EntityType.PLAYER || Util.isHorse(type)) { if (SUPPORT_ATTRIBUTES && !hasTrait(AttributeTrait.class) - || !getTrait(AttributeTrait.class).hasAttribute(Attribute.GENERIC_STEP_HEIGHT)) { + || !getTrait(AttributeTrait.class).hasAttribute(Attribute.STEP_HEIGHT)) { NMS.setStepHeight(entity, 1); } } diff --git a/main/src/main/java/net/citizensnpcs/trait/AttributeTrait.java b/main/src/main/java/net/citizensnpcs/trait/AttributeTrait.java index 156317590..b98150496 100644 --- a/main/src/main/java/net/citizensnpcs/trait/AttributeTrait.java +++ b/main/src/main/java/net/citizensnpcs/trait/AttributeTrait.java @@ -15,7 +15,7 @@ import net.citizensnpcs.api.trait.TraitName; @TraitName("attributetrait") public class AttributeTrait extends Trait { @Persist(keyType = Attribute.class) - private final Map attributes = Maps.newEnumMap(Attribute.class); + private final Map attributes = Maps.newHashMap(); public AttributeTrait() { super("attributetrait"); diff --git a/main/src/main/java/net/citizensnpcs/trait/HologramTrait.java b/main/src/main/java/net/citizensnpcs/trait/HologramTrait.java index 9542c3c92..6381aaaab 100644 --- a/main/src/main/java/net/citizensnpcs/trait/HologramTrait.java +++ b/main/src/main/java/net/citizensnpcs/trait/HologramTrait.java @@ -918,7 +918,7 @@ public class HologramTrait extends Trait { disp.setBackgroundColor(color); } if (SpigotUtil.getVersion()[1] >= 21 && base.getEntity() instanceof LivingEntity) { - AttributeInstance inst = ((LivingEntity) base.getEntity()).getAttribute(Attribute.GENERIC_SCALE); + AttributeInstance inst = ((LivingEntity) base.getEntity()).getAttribute(Attribute.SCALE); if (inst != null) { Transformation tf = disp.getTransformation(); tf.getScale().set(inst.getValue()); diff --git a/main/src/main/java/net/citizensnpcs/trait/versioned/BossBarTrait.java b/main/src/main/java/net/citizensnpcs/trait/versioned/BossBarTrait.java index b145eb058..1aae80b7f 100644 --- a/main/src/main/java/net/citizensnpcs/trait/versioned/BossBarTrait.java +++ b/main/src/main/java/net/citizensnpcs/trait/versioned/BossBarTrait.java @@ -143,7 +143,7 @@ public class BossBarTrait extends Trait { double maxHealth = entity.getMaxHealth(); if (SUPPORT_ATTRIBUTES) { try { - maxHealth = entity.getAttribute(Attribute.GENERIC_MAX_HEALTH).getValue(); + maxHealth = entity.getAttribute(Attribute.MAX_HEALTH).getValue(); } catch (Throwable t) { SUPPORT_ATTRIBUTES = false; } diff --git a/main/src/main/java/net/citizensnpcs/util/NMS.java b/main/src/main/java/net/citizensnpcs/util/NMS.java index bc14659ce..79606c0c5 100644 --- a/main/src/main/java/net/citizensnpcs/util/NMS.java +++ b/main/src/main/java/net/citizensnpcs/util/NMS.java @@ -130,7 +130,7 @@ public class NMS { return; if (SUPPORT_KNOCKBACK_RESISTANCE && npc.getEntity() instanceof Attributable) { AttributeInstance attribute = ((Attributable) npc.getEntity()) - .getAttribute(Attribute.GENERIC_KNOCKBACK_RESISTANCE); + .getAttribute(Attribute.KNOCKBACK_RESISTANCE); if (attribute != null) { strength *= 1 - attribute.getValue(); }