diff --git a/CompatNoCheatPlus/src/me/asofold/bpl/cncp/hooks/ncp/NCPHookManager.java b/CompatNoCheatPlus/src/me/asofold/bpl/cncp/hooks/ncp/NCPHookManager.java index a6b361f..126adfc 100644 --- a/CompatNoCheatPlus/src/me/asofold/bpl/cncp/hooks/ncp/NCPHookManager.java +++ b/CompatNoCheatPlus/src/me/asofold/bpl/cncp/hooks/ncp/NCPHookManager.java @@ -4,9 +4,11 @@ package me.asofold.bpl.cncp.hooks.ncp; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; +import java.util.HashSet; import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.Set; import org.bukkit.Bukkit; import org.bukkit.entity.Player; @@ -333,6 +335,20 @@ public final class NCPHookManager { return hook; } + /** + * Remove a collection of hooks. + * @param hooks + * @return A set of the removed hooks ids. + */ + public static Set removeHooks( Collection hooks){ + Set ids = new HashSet(); + for (NCPHook hook : hooks){ + Integer id = removeHook(hook); + if (id != null) ids.add(id); + } + return ids; + } + public static Collection removeAllHooks(){ Collection hooks = getAllHooks(); for (NCPHook hook : hooks){