Jump to content

Data Generation not working...


GabrielMa07

Recommended Posts

 

 

So, i tried so many things and that simply do not work! I tried searching everywhere, watched so many videos and even read some documents specifically about Data Generation, coming here is my last atempt to find a problem to solve it... 

Here's my code:

 

 

Data Generation:

	@Mod.EventBusSubscriber(modid = Enderian.MOD_ID, bus = Mod.EventBusSubscriber.Bus.MOD) public class DataGenerators { @SubscribeEvent public static void gatherData(GatherDataEvent event) { DataGenerator generator = event.getGenerator(); PackOutput packOutput = generator.getPackOutput(); ExistingFileHelper existingFileHelper = event.getExistingFileHelper(); CompletableFuture<HolderLookup.Provider> lookupProvider = event.getLookupProvider(); generator.addProvider(event.includeClient(), new RecipeProvider(packOutput)); generator.addProvider(event.includeClient(), new BlockStateProvider(packOutput, existingFileHelper)); generator.addProvider(event.includeClient(), new ItemModelProvider(packOutput, existingFileHelper)); BlockTagGenerator blockTagGenerator = generator.addProvider(event.includeServer(), new BlockTagGenerator(packOutput, lookupProvider, existingFileHelper)); generator.addProvider(event.includeServer(), new ItemTagGenerator(packOutput, lookupProvider, blockTagGenerator.contentsGetter(), existingFileHelper)); } }
	

Block State Provider:

	public class BlockStateProvider extends net.minecraftforge.client.model.generators.BlockStateProvider { public BlockStateProvider(PackOutput output, ExistingFileHelper exFileHelper) { super(output, Enderian.MOD_ID, exFileHelper); } @Override protected void registerStatesAndModels() { blockWithItem(blocks.PLATINUM_BLOCK); blockWithItem(blocks.DEEPSLATE_PLATINUM); blockWithItem(blocks.PLATINUM_ORE); blockWithItem(blocks.END_PLATINUM); } private void blockWithItem(RegistryObject<Block> blockRegistryObject) { simpleBlockWithItem(blockRegistryObject.get(), cubeAll(blockRegistryObject.get())); }
	

Item Model Provider:

	public class ItemModelProvider extends net.minecraftforge.client.model.generators.ItemModelProvider { public ItemModelProvider(PackOutput output, ExistingFileHelper existingFileHelper) { super(output, Enderian.MOD_ID, existingFileHelper); } @Override protected void registerModels() { simpleItem(items.BAKED_PLATINUM_POTATO); simpleItem(items.PLATINUM_POTATO); simpleItem(items.FUR); simpleItem(items.RAW_PLATINUM); simpleItem(items.PLATINUM_INGOT); simpleItem(items.PLATINUM_NUGGET); handheldItem(items.EMERALD_SWORD); handheldItem(items.EMERALD_PICKAXE); handheldItem(items.EMERALD_AXE); handheldItem(items.EMERALD_SHOVEL); handheldItem(items.EMERALD_HOE); } private ItemModelBuilder simpleItem(RegistryObject<Item> item){ return withExistingParent(item.getId().getPath(), new ResourceLocation("item/generated")).texture("layer0", new ResourceLocation(Enderian.MOD_ID, "item/" + item.getId().getPath())); } private ItemModelBuilder handheldItem(RegistryObject<Item> item){ return withExistingParent(item.getId().getPath(), new ResourceLocation("item/handheld")).texture("layer0", new ResourceLocation(Enderian.MOD_ID, "item/" + item.getId().getPath())); } }
	

 

BTW, 1.20.1 with Oracle 22.0.1

 

 

Edited by GabrielMa07
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Announcements



×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.