restore keybinds, update hard deps (#54)

This commit is contained in:
lc-1337 authored and GitHub committed 2025-12-14 00:08:38 +01:00
1 parent 4952db57aa
commit 104ffc99a1
2 files changed
+39 -1

No files matched your search

@@ -33,7 +33,10 @@ public class NotEnoughEnergistics {
public static final String MODID = "neenergistics";
public static final String NAME = "NotEnoughEnergistics";
public static final String VERSION = Tags.VERSION;
public static final String DEPENDENCIES = "required-after:NotEnoughItems;required-after:appliedenergistics2@[rv3.beta.22,),[rv3.beta-22,),[rv3-beta.22,),[rv3-beta-22,);after:ae2wct;after:ae2fc";
public static final String DEPENDENCIES = "required-after:" + "NotEnoughItems;required-after:"
+ "appliedenergistics2@[rv3-beta-754-GTNH,);after:"
+ "ae2wct@[1.12.10,);after:"
+ "ae2fc@[1.5.30-gtnh,);";
public static final String GUI_FACTORY = "com.github.vfyjxf.nee.config.NEEConfigGuiFactory";
public static final Logger logger = LogManager.getLogger("NotEnoughEnergistics");
@@ -1,8 +1,10 @@
package com.github.vfyjxf.nee.nei;
import java.util.List;
import java.util.Map;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.resources.I18n;
import org.lwjgl.opengl.GL11;
@@ -18,6 +20,7 @@ import codechicken.nei.recipe.GuiOverlayButton;
import codechicken.nei.recipe.GuiRecipe;
import codechicken.nei.recipe.GuiRecipeButton;
import codechicken.nei.recipe.RecipeHandlerRef;
import codechicken.nei.util.NEIMouseUtils;
public class NEETerminalOverlayButton extends GuiOverlayButton {
@@ -101,6 +104,38 @@ public class NEETerminalOverlayButton extends GuiOverlayButton {
}
}
@Override
public Map<String, String> handleHotkeys(int mousex, int mousey, Map<String, String> hotkeys) {
hotkeys = super.handleHotkeys(mousex, mousey, hotkeys);
if (ingredientsOverlay().stream().allMatch(
state -> state.isPresent()
|| state instanceof NEEItemOverlayState overlayState && showCraftingHotkeys(overlayState))) {
if (NEECraftingPreviewHandler.instance
.canCraftRecipeResult(this.firstGui, this.handlerRef.handler, handlerRef.recipeIndex)) {
hotkeys.put(
NEIClientConfig.getKeyName("nee.preview", 0, NEIMouseUtils.MOUSE_BTN_LMB),
I18n.format("neenergistics.gui.tooltip.crafting.preview.result"));
hotkeys.put(
NEIClientConfig.getKeyName("nee.nopreview", 0, NEIMouseUtils.MOUSE_BTN_LMB),
I18n.format("neenergistics.gui.tooltip.crafting.nopreview.result"));
} else {
hotkeys.put(
NEIClientConfig.getKeyName("nee.preview", 0, NEIMouseUtils.MOUSE_BTN_LMB),
I18n.format("neenergistics.gui.tooltip.crafting.preview"));
hotkeys.put(
NEIClientConfig.getKeyName("nee.nopreview", 0, NEIMouseUtils.MOUSE_BTN_LMB),
I18n.format("neenergistics.gui.tooltip.crafting.nopreview"));
}
}
return hotkeys;
}
private static boolean showCraftingHotkeys(NEEItemOverlayState button) {
return button.getIngredient().isCraftable() || !button.getIngredient().requiresToCraft();
}