mirror of
https://github.com/asofold/CompatNoCheatPlus.git
synced 2024-11-18 11:16:23 +01:00
add API for all hooks (remove, get).
This commit is contained in:
parent
759872b5d3
commit
3caa3cd96f
@ -2,6 +2,7 @@ package me.asofold.bpl.cncp.hooks.ncp;
|
||||
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@ -331,6 +332,14 @@ public final class NCPHookManager {
|
||||
return hook;
|
||||
}
|
||||
|
||||
public static Collection<NCPHook> removeAllHooks(){
|
||||
Collection<NCPHook> hooks = getAllHooks();
|
||||
for (NCPHook hook : hooks){
|
||||
removeHook(hook);
|
||||
}
|
||||
return hooks;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the hook by the hook name.
|
||||
* @param hookName case sensitive (exact match).
|
||||
@ -344,4 +353,14 @@ public final class NCPHookManager {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a collection of all hooks.
|
||||
* @return
|
||||
*/
|
||||
public static Collection<NCPHook> getAllHooks(){
|
||||
List<NCPHook> hooks = new LinkedList<NCPHook>();
|
||||
hooks.addAll(allHooks.values());
|
||||
return hooks;
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user