fix: switch to 2.0 invui and update of minecraft version
This commit is contained in:
parent
41ae6a2572
commit
b157836887
31 changed files with 233 additions and 465 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue