mirror of
https://github.com/asofold/CompatNoCheatPlus.git
synced 2024-11-18 11:16:23 +01:00
Added methods for removing hookjs by name.
This commit is contained in:
parent
84f67ba251
commit
5644f7b01f
@ -291,4 +291,24 @@ public final class NCPHookManager {
|
||||
return hook;
|
||||
}
|
||||
|
||||
public static NCPHook removeHook(String hookName){
|
||||
NCPHook hook = getHookByName(hookName);
|
||||
if (hook == null) return null;
|
||||
removeHook(hook);
|
||||
return hook;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the hook by the hook name.
|
||||
* @param hookName case sensitive (exact match).
|
||||
* @return NCPHook if found, null otherwise.
|
||||
*/
|
||||
public static NCPHook getHookByName(String hookName){
|
||||
for (Integer refId : allHooks.keySet()){
|
||||
NCPHook hook = allHooks.get(refId);
|
||||
if (hook.getHookName().equals(hookName)) return hook;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user