From 2efd7d39431e326658a58a94d77aad1ec1caa1ab Mon Sep 17 00:00:00 2001 From: Jenny Date: Wed, 5 Feb 2025 17:41:14 +0100 Subject: [PATCH] init --- .../jenny/datagen/ModItemModelProvider.java | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/main/java/com/jenny/datagen/ModItemModelProvider.java diff --git a/src/main/java/com/jenny/datagen/ModItemModelProvider.java b/src/main/java/com/jenny/datagen/ModItemModelProvider.java new file mode 100644 index 0000000..2c71c96 --- /dev/null +++ b/src/main/java/com/jenny/datagen/ModItemModelProvider.java @@ -0,0 +1,24 @@ +package com.jenny.datagen; + +import net.minecraft.data.PackOutput; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.world.item.Item; +import net.minecraftforge.client.model.generators.ItemModelBuilder; +import net.minecraftforge.client.model.generators.ItemModelProvider; +import net.minecraftforge.common.data.ExistingFileHelper; +import net.minecraftforge.registries.RegistryObject; + +abstract public class ModItemModelProvider extends ItemModelProvider { + + public ModItemModelProvider(String modID, PackOutput output, ExistingFileHelper existingFileHelper) { + super(output, modID, existingFileHelper); + } + @Override + public abstract void registerModels(); + + protected ItemModelBuilder simpleItem(RegistryObject item) { + return withExistingParent(item.getId().getPath(), + new ResourceLocation("item/generated")).texture("layer0", + new ResourceLocation(this.modid,"item/" + item.getId().getPath())); + } +}