Disenchanter (The Disenchanter Mod)

Disenchanter (The Disenchanter Mod)

21M Downloads

Custom StateMapper with UnlocalizedName

Impelon opened this issue ยท 4 comments

commented

As I've mentioned in this commit (a35951b),
I have registered the DisenchantmentTable with a custom StateMapper in 1.8.9+.
This is because I do not want to (and I'm not supposed to) change the registry name, but I want all my files to be lowercase (as is enforced in 1.11).

So what I've done is that the UnlocalizedName is the RegistryName, but lowercase.

this.setRegistryName(DisenchanterMain.MODID, "disenchantmentTable");
this.setUnlocalizedName(this.getRegistryName().toString().toLowerCase());

This worked fine for the language files, and item models (that needed registering anyways). But for the Blockmodels I was forced to do the hacky stuff using substring/splits/etc. I did in the CombinedClientProxy.

new ModelResourceLocation(disenchantmentTable.getUnlocalizedName()
.substring(5), state.toString().split("[\\[\\]]")[1])

I'm wondering if my solution is considered bad practice and if there is a better solution... Anyone?

commented

I'm really struggling to think of a good solution here, to be honest... Does anyone have an idea how to get the name of your variants?

commented

So, from the bit of research that I have done, it seems that the custom state mapper/custom model location is the cause of all the above. Though: The issues only occur, if the respective mod also does something wrong when registering the textures/models. For example Buildcraft seems to have fixed this by using ModelBakeEvent and State Mappers together...

commented

Will be fixed in the 1.6 update.

commented

Fixed in all affected versions!