From 429ca5d447c47b28e621b944aaa9a59a4f0bfbe1 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Sun, 13 Jan 2013 15:44:16 +0100 Subject: [PATCH] Don't update hooks if we don't need to. --- .../src/main/java/com/comphenix/protocol/ProtocolLibrary.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolLibrary.java b/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolLibrary.java index 2f5e0322..1a64565d 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolLibrary.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/ProtocolLibrary.java @@ -142,9 +142,9 @@ public class ProtocolLibrary extends JavaPlugin { PlayerInjectHooks hook = config.getInjectionMethod(); // Only update the hook if it's different - if (protocolManager.getPlayerHook().equals(hook)) { + if (!protocolManager.getPlayerHook().equals(hook)) { + logger.info("Changing player hook from " + protocolManager.getPlayerHook() + " to " + hook); protocolManager.setPlayerHook(hook); - logger.info("Changing player hook to " + hook); } } catch (IllegalArgumentException e) { detailedReporter.reportWarning(config, "Cannot parse injection method. Using default.", e);