diff --git a/common/src/main/java/dev/anvilcraft/lib/data/provider/AnvilLibItemModelProvider.java b/common/src/main/java/dev/anvilcraft/lib/data/provider/AnvilLibItemModelProvider.java index 8de0832..c627d7f 100644 --- a/common/src/main/java/dev/anvilcraft/lib/data/provider/AnvilLibItemModelProvider.java +++ b/common/src/main/java/dev/anvilcraft/lib/data/provider/AnvilLibItemModelProvider.java @@ -5,6 +5,8 @@ import net.minecraft.data.PackOutput; import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.Item; +import net.minecraft.world.level.ItemLike; +import org.jetbrains.annotations.NotNull; public class AnvilLibItemModelProvider extends ModelProvider { public AnvilLibItemModelProvider( @@ -20,8 +22,8 @@ String getProviderName() { return "ItemModel"; } - public ItemModelFile simple(Item item) { - return simple(BuiltInRegistries.ITEM.getKey(item)); + public ItemModelFile simple(@NotNull ItemLike item) { + return simple(BuiltInRegistries.ITEM.getKey(item.asItem())); } public ItemModelFile simple(ResourceLocation location) { diff --git a/common/src/main/java/dev/anvilcraft/lib/data/provider/LanguageProvider.java b/common/src/main/java/dev/anvilcraft/lib/data/provider/LanguageProvider.java index baed4dd..f4c6a67 100644 --- a/common/src/main/java/dev/anvilcraft/lib/data/provider/LanguageProvider.java +++ b/common/src/main/java/dev/anvilcraft/lib/data/provider/LanguageProvider.java @@ -37,8 +37,8 @@ protected void add(@NotNull TranslationBuilder builder) { } public void add(String translationKey, String value) { - if (value == null) this.translations.remove(translationKey); this.translations.put(translationKey, value); + if (value == null) this.translations.remove(translationKey); } public LanguageProvider(PackOutput dataOutput, String namespace) { diff --git a/fabric/src/test/java/dev/anvilcraft/lib/test/TestRegisters.java b/fabric/src/test/java/dev/anvilcraft/lib/test/TestRegisters.java index 956574e..0b8a576 100644 --- a/fabric/src/test/java/dev/anvilcraft/lib/test/TestRegisters.java +++ b/fabric/src/test/java/dev/anvilcraft/lib/test/TestRegisters.java @@ -25,8 +25,7 @@ public class TestRegisters { .item("test", Item::new) .tag(TEST_ITEM_TAG) .initProperties(() -> Items.APPLE) - .model((entry, provider) -> { - }) + .model((entry, provider) -> provider.simple(entry)) .recipe((entry, provider) -> ShapedRecipeBuilder.shaped(RecipeCategory.MISC, entry) .pattern("xxx") .pattern("xxx")