feat: adapt allay-api 0.2.0

This commit is contained in:
daoge_cmd
2025-03-03 19:52:25 +08:00
parent 83bc2c9022
commit 167a712c0e
2 changed files with 2 additions and 4 deletions
+1 -1
View File
@@ -79,7 +79,7 @@ object Versions {
} }
object Allay { object Allay {
const val api = "0.1.3" const val api = "0.2.0"
} }
object Minestom { object Minestom {
@@ -1,8 +1,6 @@
package com.dfsek.terra.allay.delegate; package com.dfsek.terra.allay.delegate;
import org.allaymc.api.item.data.ItemId;
import org.allaymc.api.item.type.ItemType; import org.allaymc.api.item.type.ItemType;
import org.allaymc.api.registry.Registries;
import com.dfsek.terra.api.inventory.Item; import com.dfsek.terra.api.inventory.Item;
@@ -16,7 +14,7 @@ public final class AllayItemType implements Item {
public AllayItemType(ItemType<?> allayItemType) { public AllayItemType(ItemType<?> allayItemType) {
this.allayItemType = allayItemType; this.allayItemType = allayItemType;
this.maxDurability = Registries.ITEM_DATA.get(ItemId.fromIdentifier(allayItemType.getIdentifier())).maxDamage(); this.maxDurability = allayItemType.getItemData().maxDamage();
} }
@Override @Override