Jump to content

Advanced/Complicated Datagen (At least, I think it's complicated)


Recommended Posts

Posted

So, I am rewriting my mod in an effort to do it MUCH better. I don't want to have to deal with copying, pasting, and editing 5,280 JSON files (yes I counted), so I am working on datagen. I Want to add the features I was saying "ah, I'll do it later" to, so I am doing them.

Etc........

Well, right now I am making a type of block with a custom blockstate property (an integer value of 1-4), which will make it change it's model. I have that done and have it working... with handwritten JSONS. 

Now I am wanting to do it in datagen since I will be making I think 48 actual full blocks, which would need 288 JSON files. Which I would then be doing something similar for Stair, Slab, Fence, and Wall variants. So basically, I really need to do it datagen, just don't know how.

Would any of you folk have suggestions or perhaps github repos that show datagen with custom blockstate properties, or perhaps even just how to use the "getVariantBuilder" thing since I will be doing the whole custom blockstate property to stairs, fences, and walls as well.

Posted

While chugging along making the JSONs by hand (to get an idea of how they need to be generated for each type of block), I cam up with a possibly brilliant idea.

Could I somehow make template JSONs and when a new block of a certain type is being generated it will just pull the template and replace certain keywords like "NAME" and "COLOR" instead of all of this getVariantBuilder stuff

Posted
On 9/17/2021 at 11:41 PM, FireTamer81 said:

While chugging along making the JSONs by hand (to get an idea of how they need to be generated for each type of block), I cam up with a possibly brilliant idea.

Could I somehow make template JSONs and when a new block of a certain type is being generated it will just pull the template and replace certain keywords like "NAME" and "COLOR" instead of all of this getVariantBuilder stuff

Make a method which has the parameters that change (name, colour etc.) and perform the datagen logic inside that method. You can even have a method which generates each of the blocks (regular cube, wall, stairs etc.) for a single name.

Unfortunately I don't have a good example of datagen as the mod I am working on using it for uses either simple cubes or a custom model loader. When I was learning how to use the datagen I spent a lot of time looking through the source and IIRC Tropicraft was my starting point, although I cannot remember what that was like. 

Posted (edited)
34 minutes ago, Alpvax said:

Unfortunately I don't have a good example of datagen

vanilla has examples for the datagen look at the net.minecraft.data package

Edited by Luis_ST

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.