Skip to content

Commit

Permalink
Fix attribute errors on 1.21.3
Browse files Browse the repository at this point in the history
  • Loading branch information
Archy-X committed Nov 5, 2024
1 parent 7226d7e commit 4fcb242
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 14 deletions.
2 changes: 1 addition & 1 deletion bukkit/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ dependencies {
implementation(project(":common"))
implementation(project(":api-bukkit"))
implementation("co.aikar:acf-paper:0.5.1-SNAPSHOT")
implementation("de.tr7zw:item-nbt-api:2.13.3-SNAPSHOT")
implementation("de.tr7zw:item-nbt-api:2.14.0")
implementation("org.bstats:bstats-bukkit:3.0.2")
implementation("net.kyori:adventure-text-minimessage:4.16.0")
implementation("net.kyori:adventure-platform-bukkit:4.3.3")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,20 @@ public class AttributeCompat {
public static Attribute LUCK;

static {
/*
Saved for updating to spigot-api 1.21.3+

if (VersionUtils.isAtLeastVersion(21, 2)) {
MAX_HEALTH = Attribute.MAX_HEALTH;
MOVEMENT_SPEED = Attribute.MOVEMENT_SPEED;
ATTACK_DAMAGE = Attribute.ATTACK_DAMAGE;
ATTACK_SPEED = Attribute.ATTACK_SPEED;
LUCK = Attribute.LUCK;
MAX_HEALTH = fromRegistry("max_health");
MOVEMENT_SPEED = fromRegistry("movement_speed");
ATTACK_DAMAGE = fromRegistry("attack_damage");
ATTACK_SPEED = fromRegistry("attack_speed");
LUCK = fromRegistry("luck");
} else {
*/
MAX_HEALTH = fromRegistry("generic.max_health");
MOVEMENT_SPEED = fromRegistry("generic.movement_speed");
ATTACK_DAMAGE = fromRegistry("generic.attack_damage");
ATTACK_SPEED = fromRegistry("generic.attack_speed");
LUCK = fromRegistry("generic.luck");
MAX_HEALTH = fromRegistry("generic.max_health");
MOVEMENT_SPEED = fromRegistry("generic.movement_speed");
ATTACK_DAMAGE = fromRegistry("generic.attack_damage");
ATTACK_SPEED = fromRegistry("generic.attack_speed");
LUCK = fromRegistry("generic.luck");
}
}

private static Attribute fromRegistry(String key) {
Expand Down

0 comments on commit 4fcb242

Please sign in to comment.