2323import gregtech .api .util .AssemblyLineManager ;
2424import gregtech .api .util .ClipboardUtil ;
2525import gregtech .api .util .GTUtility ;
26+ import gregtech .api .util .LocalizationUtils ;
2627import gregtech .api .util .TextFormattingUtil ;
2728import gregtech .client .utils .TooltipHelper ;
2829import gregtech .integration .RecipeCompatUtil ;
@@ -309,15 +310,22 @@ public List<String> getTooltipStrings(int mouseX, int mouseY) {
309310
310311 @ Override
311312 public void initExtras () {
312- // do not add the X button if no tweaker mod is present
313+ // do not add the info or X button if no tweaker mod is present
313314 if (!RecipeCompatUtil .isTweakerLoaded ()) return ;
314315
315- BooleanSupplier creativePlayerCtPredicate = () -> Minecraft .getMinecraft ().player != null &&
316+ BooleanSupplier creativePlayerPredicate = () -> Minecraft .getMinecraft ().player != null &&
316317 Minecraft .getMinecraft ().player .isCreative ();
318+ BooleanSupplier creativeTweaker = () -> creativePlayerPredicate .getAsBoolean () &&
319+ (recipe .getIsCTRecipe () || recipe .isGroovyRecipe ());
320+ BooleanSupplier creativeDefault = () -> creativePlayerPredicate .getAsBoolean () && !recipe .getIsCTRecipe () &&
321+ !recipe .isGroovyRecipe ();
322+
323+ // X Button
317324 buttons .add (new JeiButton (166 , 2 , 10 , 10 )
318325 .setTextures (GuiTextures .BUTTON_CLEAR_GRID )
319- .setTooltipBuilder (lines -> lines .add ("Copies a " + RecipeCompatUtil .getTweakerName () +
320- " script, to remove this recipe, to the clipboard" ))
326+ .setTooltipBuilder (lines -> lines .add (
327+ LocalizationUtils .format ("gregtech.jei.remove_recipe.tooltip" ,
328+ RecipeCompatUtil .getTweakerName ())))
321329 .setClickAction ((minecraft , mouseX , mouseY , mouseButton ) -> {
322330 String recipeLine = RecipeCompatUtil .getRecipeRemoveLine (recipeMap , recipe );
323331 String output = RecipeCompatUtil .getFirstOutputString (recipe );
@@ -330,7 +338,16 @@ public void initExtras() {
330338 new TextComponentString ("Copied [\u00A7 6" + recipeLine + "\u00A7 r] to the clipboard" ));
331339 return true ;
332340 })
333- .setActiveSupplier (creativePlayerCtPredicate ));
341+ .setActiveSupplier (creativeDefault ));
342+
343+ // CT/GS Info
344+ buttons .add (new JeiButton (166 , 2 , 10 , 10 )
345+ .setTextures (GuiTextures .INFO_ICON )
346+ .setTooltipBuilder (lines -> lines .add (recipe .isGroovyRecipe () ?
347+ LocalizationUtils .format ("gregtech.jei.gs_recipe.tooltip" ) :
348+ LocalizationUtils .format ("gregtech.jei.ct_recipe.tooltip" )))
349+ .setClickAction ((mc , x , y , button ) -> false )
350+ .setActiveSupplier (creativeTweaker ));
334351 }
335352
336353 public ChancedItemOutput getOutputChance (int slot ) {
0 commit comments