From 109e31fd2de5da8f0224759dd3aafb9d047cab90 Mon Sep 17 00:00:00 2001 From: Kam Date: Mon, 2 Mar 2026 06:13:40 -0500 Subject: [PATCH] Fix Hooks not Registering --- .../noppes/npcs/constants/EnumScriptType.java | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/main/java/noppes/npcs/constants/EnumScriptType.java b/src/main/java/noppes/npcs/constants/EnumScriptType.java index 01fa36ac2..f6d05d65b 100644 --- a/src/main/java/noppes/npcs/constants/EnumScriptType.java +++ b/src/main/java/noppes/npcs/constants/EnumScriptType.java @@ -155,9 +155,21 @@ public enum EnumScriptType { public String function; + private static final java.util.Map BY_FUNCTION = new java.util.HashMap<>(); + static { + for (EnumScriptType type : values()) { + BY_FUNCTION.put(type.function, type); + } + } + public static EnumScriptType valueOfIgnoreCase(String channelName) { - channelName = channelName.toUpperCase(); - return valueOf(channelName); + // First try by function name (e.g. "abilityStart") + EnumScriptType type = BY_FUNCTION.get(channelName); + if (type != null) { + return type; + } + // Fallback to enum constant name (e.g. "ABILITY_START") + return valueOf(channelName.toUpperCase()); } private EnumScriptType(String function) {