register(Bukkit.getPluginManager().getPlugin("NoCheatPlus")); // Store instead ?
}
private void unregister() {
final ProtocolManager protocolManager = ProtocolLibrary.getProtocolManager();
final NoCheatPlusAPI api = NCPAPIProvider.getNoCheatPlusAPI();
for (PacketAdapter adapter : registeredPacketAdapters) {
try {
protocolManager.removePacketListener(adapter);
api.removeComponent(adapter); // Bit heavy, but consistent.
} catch (Throwable t) {
LogUtil.logWarning("[NoCheatPlus] Failed to unregister packet level hook: " + adapter.getClass().getName());
}
}
registeredPacketAdapters.clear();