From 1e80b5320a8003b088c09c78ed7aa9a44ad8a8cc Mon Sep 17 00:00:00 2001 From: asofold Date: Thu, 26 Nov 2015 11:20:50 +0100 Subject: [PATCH] Don't enable EntityUseAdapter on 1.6.4 and before. --- .../checks/net/protocollib/ProtocolLibComponent.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/NCPCompatProtocolLib/src/main/java/fr/neatmonster/nocheatplus/checks/net/protocollib/ProtocolLibComponent.java b/NCPCompatProtocolLib/src/main/java/fr/neatmonster/nocheatplus/checks/net/protocollib/ProtocolLibComponent.java index 7e3cd197..9a721b07 100644 --- a/NCPCompatProtocolLib/src/main/java/fr/neatmonster/nocheatplus/checks/net/protocollib/ProtocolLibComponent.java +++ b/NCPCompatProtocolLib/src/main/java/fr/neatmonster/nocheatplus/checks/net/protocollib/ProtocolLibComponent.java @@ -25,6 +25,7 @@ import fr.neatmonster.nocheatplus.checks.net.NetConfigCache; import fr.neatmonster.nocheatplus.checks.net.NetData; import fr.neatmonster.nocheatplus.checks.net.NetDataFactory; import fr.neatmonster.nocheatplus.checks.net.model.DataPacketFlying; +import fr.neatmonster.nocheatplus.compat.versions.ServerVersion; import fr.neatmonster.nocheatplus.components.DisableListener; import fr.neatmonster.nocheatplus.components.INotifyReload; import fr.neatmonster.nocheatplus.components.JoinLeaveListener; @@ -32,6 +33,7 @@ import fr.neatmonster.nocheatplus.components.NoCheatPlusAPI; import fr.neatmonster.nocheatplus.config.ConfPaths; import fr.neatmonster.nocheatplus.config.ConfigManager; import fr.neatmonster.nocheatplus.logging.StaticLog; +import fr.neatmonster.nocheatplus.logging.Streams; import fr.neatmonster.nocheatplus.stats.Counters; import fr.neatmonster.nocheatplus.utilities.StringUtil; @@ -62,7 +64,11 @@ public class ProtocolLibComponent implements DisableListener, INotifyReload, Joi register("fr.neatmonster.nocheatplus.checks.net.protocollib.DebugAdapter", plugin); } // Actual checks. - if (ConfigManager.isTrueForAnyConfig(ConfPaths.NET_ATTACKFREQUENCY_ACTIVE)) { + if (ServerVersion.compareMinecraftVersion("1.6.4") <= 0) { + // Don't use this listener. + NCPAPIProvider.getNoCheatPlusAPI().getLogManager().info(Streams.STATUS, "Disable EntityUseAdapter due to incompatibilities. Use fight.speed instead of net.attackfrequency."); + } + else if (ConfigManager.isTrueForAnyConfig(ConfPaths.NET_ATTACKFREQUENCY_ACTIVE)) { // (Also sets lastKeepAliveTime, if enabled.) register("fr.neatmonster.nocheatplus.checks.net.protocollib.UseEntityAdapter", plugin); }