diff --git a/src/main/java/codechicken/nei/ClientHandler.java b/src/main/java/codechicken/nei/ClientHandler.java index 586f65624..b859823d4 100644 --- a/src/main/java/codechicken/nei/ClientHandler.java +++ b/src/main/java/codechicken/nei/ClientHandler.java @@ -235,7 +235,6 @@ public static void load() { public static void postInit() { loadHandlerOrdering(); - loadPluginsList(); GuiContainerManager.registerReloadResourceListener(); } diff --git a/src/main/java/codechicken/nei/NEIClientConfig.java b/src/main/java/codechicken/nei/NEIClientConfig.java index 07f9e45e7..afcc93bb6 100644 --- a/src/main/java/codechicken/nei/NEIClientConfig.java +++ b/src/main/java/codechicken/nei/NEIClientConfig.java @@ -634,7 +634,7 @@ public static boolean isKeyHashDown(String string) { public static String getKeyName(String keyBind) { final int hash = getKeyBinding(keyBind); - if (NEIClientUtils.unHashKey(hash) == Keyboard.CHAR_NONE) { + if (hash == Keyboard.CHAR_NONE) { return null; } @@ -665,7 +665,7 @@ public void run() { config.loadConfig(); NEIModContainer.plugins.add(config); logger.debug("Loaded {}", clazz.getName()); - } catch (Exception e) { + } catch (Throwable e) { logger.error("Failed to Load {}", clazz.getName(), e); } }); diff --git a/src/main/java/codechicken/nei/NEIClientUtils.java b/src/main/java/codechicken/nei/NEIClientUtils.java index c0808842e..6f46ccf81 100644 --- a/src/main/java/codechicken/nei/NEIClientUtils.java +++ b/src/main/java/codechicken/nei/NEIClientUtils.java @@ -466,11 +466,23 @@ public static String getKeyHashName(int keyBind) { keyText.add(NEIClientUtils.translate("key.alt")); } - return keyText.add("").toString(); + return keyText.toString(); } public static String getKeyName(int keyBind) { - return NEIClientUtils.getKeyHashName(keyBind) + Keyboard.getKeyName(NEIClientUtils.unHashKey(keyBind)); + StringJoiner keyText = new StringJoiner(" + "); + String hashText = NEIClientUtils.getKeyHashName(keyBind); + int keyID = NEIClientUtils.unHashKey(keyBind); + + if (!hashText.isEmpty()) { + keyText.add(hashText); + } + + if (keyID != Keyboard.CHAR_NONE || hashText.isEmpty()) { + keyText.add(Keyboard.getKeyName(keyID)); + } + + return keyText.toString(); } public static int unHashKey(int keyBind) { diff --git a/src/main/java/codechicken/nei/NEIModContainer.java b/src/main/java/codechicken/nei/NEIModContainer.java index 650ed75fc..fae676706 100644 --- a/src/main/java/codechicken/nei/NEIModContainer.java +++ b/src/main/java/codechicken/nei/NEIModContainer.java @@ -127,6 +127,7 @@ public void postInit(FMLPostInitializationEvent event) { public void loadComplete(FMLLoadCompleteEvent event) { if (CommonUtils.isClient()) { GuiRecipeTab.loadHandlerInfo(); + ClientHandler.loadPluginsList(); } }