fix: switch to 2.0 invui and update of minecraft version
Some checks failed
Format / formatting (push) Failing after 47s
Build / build (push) Failing after 10m31s

This commit is contained in:
unurled 2024-12-31 01:30:31 +01:00
parent 41ae6a2572
commit b157836887
Signed by: unurled
GPG key ID: EFC5F5E709B47DDD
31 changed files with 233 additions and 465 deletions

View file

@ -40,11 +40,9 @@ public class SRPlayerUtils {
float value = (float) ((speed + items) / 500.0f);
value = Math.min(value, 1.0f);
value = Math.max(value, 0f);
AttributeInstance attribute1 =
p.getAttribute(org.bukkit.attribute.Attribute.GENERIC_MOVEMENT_SPEED);
AttributeInstance attribute1 = p.getAttribute(org.bukkit.attribute.Attribute.MOVEMENT_SPEED);
if (attribute1 != null) attribute1.setBaseValue(value);
AttributeInstance attribute2 =
p.getAttribute(org.bukkit.attribute.Attribute.GENERIC_FLYING_SPEED);
AttributeInstance attribute2 = p.getAttribute(org.bukkit.attribute.Attribute.FLYING_SPEED);
if (attribute2 != null) attribute2.setBaseValue(value);
p.setFlySpeed(value);
p.setWalkSpeed(value);
@ -57,7 +55,7 @@ public class SRPlayerUtils {
// default is 100 so 20
double health =
(sr.getAttribute(Attribute.HEALTH) + sr.getTotalItemAttribute(Attribute.HEALTH)) / 5;
AttributeInstance attribute = p.getAttribute(org.bukkit.attribute.Attribute.GENERIC_MAX_HEALTH);
AttributeInstance attribute = p.getAttribute(org.bukkit.attribute.Attribute.MAX_HEALTH);
if (attribute != null) attribute.setBaseValue(health);
p.sendHealthUpdate();
p.updateInventory();