From 4d53066174989f86ba07798f3f5229629d44c28d Mon Sep 17 00:00:00 2001 From: Ztrolix Date: Sat, 16 Nov 2024 21:15:17 +1100 Subject: [PATCH] Fixed Some of #36 It still crashes but fixed some part of it. --- src/main/java/dev/xdpxi/xdlib/api/mod/custom.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/dev/xdpxi/xdlib/api/mod/custom.java b/src/main/java/dev/xdpxi/xdlib/api/mod/custom.java index 4fa331a..b8a6160 100644 --- a/src/main/java/dev/xdpxi/xdlib/api/mod/custom.java +++ b/src/main/java/dev/xdpxi/xdlib/api/mod/custom.java @@ -47,7 +47,8 @@ public static Item Item(String itemID, String modID, RegistryKey item modID = modID.toLowerCase(); Identifier identifier = Identifier.of(modID, itemID); - Item item = new Item(new Item.Settings()); + Item.Settings settings = new Item.Settings(); + Item item = new Item(settings); Registry.register(Registries.ITEM, identifier, item); if (itemGroup != null) { @@ -88,7 +89,8 @@ public static Item Weapon(String weaponID, String modID, ToolMaterial material, modID = modID.toLowerCase(); Identifier identifier = Identifier.of(modID, weaponID); - SwordItem weapon = new SwordItem(material, new Item.Settings().maxDamage(material.getDurability())); + SwordItem weapon = new SwordItem(material, new Item.Settings() + .maxDamage(material.getDurability())); Registry.register(Registries.ITEM, identifier, weapon); if (itemGroup != null) {