This commit is contained in:
Jenny 2025-02-05 17:41:14 +01:00
commit 2efd7d3943
Signed by: Jenny
GPG Key ID: 2072A14E40940632

View File

@ -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> item) {
return withExistingParent(item.getId().getPath(),
new ResourceLocation("item/generated")).texture("layer0",
new ResourceLocation(this.modid,"item/" + item.getId().getPath()));
}
}