Made handler tab names customizable

Allow Recipe Handlers to have a different tab name than what's displayed on top of the UI.
This commit is contained in:
YannickMG authored and Jason Mitchell committed 2022-01-30 17:48:14 -08:00
1 parent 7834d72ecf
commit 47951372cb
2 files changed
+12 -2

No files matched your search

@@ -130,7 +130,7 @@ public abstract class GuiRecipeTab extends Widget {
}
public void addTooltips(List<String> tooltip) {
tooltip.add(handler.getRecipeName().trim());
tooltip.add(handler.getRecipeTabName().trim());
String handlerMod = getHandlerMod(handlerName, handlerID);
tooltip.add(EnumChatFormatting.BLUE + handlerMod);
@@ -29,7 +29,17 @@ public interface IRecipeHandler
* @return The name of this inventory.
* To be displayed at the top of the viewing container.
*/
public String getRecipeName();
/**
* For legacy compatibility reasons, this method's default implementation returns the recipe name. This is also the expected behavior
*
* @return The name of this inventory.
* To be displayed in the tooltip in the tab at the top of the viewing container.
*/
default String getRecipeTabName() {
return getRecipeName();
}
/**
*
* @return The number of recipes that this handler contains.