tterrag1098 / Registrate

Your mod's best friend - keep your registry objects simple and organized
Mozilla Public License 2.0
117 stars 33 forks source link

Add the functionality of disabling data generation of a certain type for specified entries. #49

Closed SammySemicolon closed 1 year ago

SammySemicolon commented 2 years ago

I'm not sure if this is already a feature, but I think it would be very useful if I could specifically tell registrate to, let's say. "Ignore this block entry when we are generating loot tables" Currently, I don't see any way to tell registrate to simply use an already defined (outside of generated directory) loot table, which is a bummer. Cheers.

SammySemicolon commented 2 years ago

In the named example, my attempt at achieving the desired functionality came in the form of simply calling .loot((b, l) -> {}) in my block entry, which triggers this very mean looking error that I don't like: https://hastebin.skyra.pw/ohaxebepos.bash I believe the issue is rooted in vanilla, but it would be nice to have a solution in place by default.

RuochenFu21 commented 1 year ago

Quite same question, trying make it not generating lang files

tterrag1098 commented 1 year ago

The problem with adding an empty loot generator is that the loot provider makes sure that all blocks have a generated table unless they specifically declare noLoot() in the builder. Is there a reason you have predefined json files?

SammySemicolon commented 1 year ago

Sometimes writing the generator for something, that I know only one block ever will use, is just kind of pointless. Especially when I already have the file just there

tterrag1098 commented 1 year ago

Consider that in the future, your plans change, and you may want to alter this table or reuse it, or break it up into logical parts. Or, the format for loot tables changes, and rather than having to manually update json, you can just re-run datagenerators.

SammySemicolon commented 1 year ago

I understand the appeal of datagenerators perfectly. But consider for example, a mod done for a commission. Everything is pretty much set in stone for the programmer. An even better example. An addon to another mod that doesn't use datagenerators. They already have the json file manually written, and unless I'm gonna need to copy paste it like... well more than once, I don't see any reason to write a datagenerator for it.

SammySemicolon commented 1 year ago

Any update on this?

tterrag1098 commented 1 year ago

I believe fixing this is out of scope, as the error comes from a check done by vanilla. You could create a custom ProviderType and implement the generation however you want.