Crafting Station

Crafting Station

12M Downloads

Support tile names

DoctorFTB opened this issue ยท 4 comments

commented

Hello.
Can you add support tiles which not implements INamedContainerProvider?
My variant realisation:
Add Map<String, String> where key is tile.getClass().getName() and value is key for I18n.
And
https://github.com/Tfarcenim/crafting-station/blob/rewrite/src/main/java/com/tfar/craftingstation/CraftingStationContainer.java#L136
Changed to:
containerNames.add(te instanceof INamedContainerProvider ? ((INamedContainerProvider)te).getDisplayName() : myMap.containsKey(te.getClass().getName()) && LanguageMap.getInstance().exists(myMap.get(te.getClass().getName())) ? new TranslationTextComponent(myMap.get(te.getClass().getName())) : new StringTextComponent("placeholder"));
(Yeah, its one line, but you can use other realisation, its example)
And example for use:
SomeClass.myMap.put(MyClassTile.class.getName(), "translate");

commented

for which mc version

commented

1.14+

commented

Not understand your question..
Make map, every mod can add localization for support placeholder.

commented

hmm, any option that doesn't need hardcoded support for every mod, or rather mods that break the vanilla standard of TEs that don't implement INamedContainerProvider?