Ignore getUnlocalizedName(). It has been added by someone else mistakenly and isn't being used anywhere. I'll change getName to getId and getDisplayName to getUnlocalizedName. With getName it wouldn't be advisable to use getUnlocalizedName since that strongly implies getName was the localized one.
Well i think you should keep getDisplayName and just use I18n.translateToLocale() inside of it and mark it as "Its the same as ItemStack.getDisplayName" that would be the best result.... So you do not need to add new stuff...
Edit: Thanks for fixing that. But also why did you change what Estebes did already right?
Estebes version:
public String getUnlocalizedName()
{
return "crop." + getName() + ".name";
}
Players Version:
public String getUnlocalizedName()
{
return getId();
}
Estebes did implement that function already right... Could you one time orient yourself on the Original MC source instead of doing your own thing?
Here is how it should look like:
Speigers Edition:
public String getDisplayName()
{
return I18n.translateToLocal(getUnlocalizedName());
}
public String getUnlocalizedName()
{
return "crop." + getName() + ".name";
}
Display More
Just copy that change getName to getId() and everything would be fine...
Also one feature request on the other side...
Could you allow mulitlayered textures on crops (public List<ResourceLocation> getModelLocation(int cropstage))
I already explained that and why IBlockState and its serialized form are not mirroring each other. They are usually the same, but that's not mandatory - even less with my plans to serialize some unlisted properties. They aren't even the same on the client due to incomplete serialization coverage from unlisted properties. Investigate how block states with Forge's additions work in depth before claiming obviously incorrect facts.
Also Just to point that out. Forge IUnlistedProperties you should only use if you would else do a BlockStateOverflow (Meaning You have more then 1k BlockStates) but even then you should not use it at all... IUnlistedProperty is good in its idea but very bad solved,
It gets deleted when placed into the world and some functions do not call getExtendetState at all and you run into issues with accessing data of that kind. A Global Variable keeps the last accessed data and prevents NullPointExceptions...
And even then it would be better to remove the String variant and provide a tool that converts BlockStates to Strings & back and if a BlockState has unlistedProperties it should not be used at all...
Also just one little thing that make me think: Why did you do this thing...
When you extract a Texture out of the Block you are extracting the position of that vertex data...
I would understand if you use that for checking if the texture used is a full block texture but nope you are just coping the position to remap them...
And here is my question: Why are you doing that, since it has to be given that the Texture used has to be a full block texture because foam can not be a differend sized cube then a full cube...
Or do i missunderstand there something?
Also one thing you should support 2 BlockStates in your Retexture Event not just one, because there is now a model state & renderState, they can be the same but do not have to be the same... (And renderState should be always checkt)