diff --git a/src/main/java/com/github/vfyjxf/nee/client/NEEContainerDrawHandler.java b/src/main/java/com/github/vfyjxf/nee/client/NEEContainerDrawHandler.java index 9ee717a..84c6f33 100644 --- a/src/main/java/com/github/vfyjxf/nee/client/NEEContainerDrawHandler.java +++ b/src/main/java/com/github/vfyjxf/nee/client/NEEContainerDrawHandler.java @@ -85,7 +85,9 @@ public void onDrawScreen(GuiScreenEvent.DrawScreenEvent.Post event) { if (this.isCraftingTerm || this.isPatternTerm) { GuiRecipe gui = (GuiRecipe) event.gui; - if (gui.getHandler() != null && NEECraftingHandler.isCraftingTableRecipe(gui.getHandler())) { + IRecipeHandler currentHandler = gui.currenthandlers.get(gui.recipetype); + + if (NEECraftingHandler.isCraftingTableRecipe(currentHandler)) { if (this.trackerMap.isEmpty()) { initIngredientTracker(gui); @@ -208,11 +210,11 @@ private void drawCraftingHelperTooltip(GuiRecipe guiRecipe, int mouseX, int mous if (this.drawRequestTooltip) { if (NEECraftingHelper.isIsPatternInterfaceExists()) { tooltips.add(String.format("%s" + EnumChatFormatting.GRAY + " + " + - EnumChatFormatting.BLUE + I18n.format("neenergistics.gui.tooltip.helper.crafting.text1"), + EnumChatFormatting.BLUE + I18n.format("neenergistics.gui.tooltip.helper.crafting.text2"), EnumChatFormatting.YELLOW + Keyboard.getKeyName(NEIClientConfig.getKeyBinding("nee.preview")))); } else { tooltips.add(String.format("%s" + EnumChatFormatting.GRAY + " + " + - EnumChatFormatting.BLUE + I18n.format("neenergistics.gui.tooltip.helper.crafting.text2"), + EnumChatFormatting.BLUE + I18n.format("neenergistics.gui.tooltip.helper.crafting.text1"), EnumChatFormatting.YELLOW + Keyboard.getKeyName(NEIClientConfig.getKeyBinding("nee.preview")))); } } diff --git a/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingHandler.java b/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingHandler.java index 846a941..aef0418 100644 --- a/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingHandler.java +++ b/src/main/java/com/github/vfyjxf/nee/nei/NEECraftingHandler.java @@ -34,9 +34,13 @@ public class NEECraftingHandler implements IOverlayHandler { public static final NEECraftingHandler INSTANCE = new NEECraftingHandler(); public static boolean isCraftingTableRecipe(IRecipeHandler recipe) { - TemplateRecipeHandler templateRecipeHandler = (TemplateRecipeHandler) recipe; - String overlayIdentifier = templateRecipeHandler.getOverlayIdentifier(); - return "crafting".equals(overlayIdentifier) || "crafting2x2".equals(overlayIdentifier); + if (recipe instanceof TemplateRecipeHandler) { + TemplateRecipeHandler templateRecipeHandler = (TemplateRecipeHandler) recipe; + String overlayIdentifier = templateRecipeHandler.getOverlayIdentifier(); + return "crafting".equals(overlayIdentifier) || "crafting2x2".equals(overlayIdentifier); + } else { + return false; + } } @Override