Add warning if hideTablist is not compatible with the mc version

(Fixes #680)
This commit is contained in:
games647 2016-04-30 13:05:31 +02:00
parent b32e5da4c5
commit c8b191fda0

View File

@ -8,15 +8,18 @@ import com.comphenix.protocol.events.PacketAdapter;
import com.comphenix.protocol.events.PacketContainer;
import com.comphenix.protocol.events.PacketEvent;
import com.comphenix.protocol.reflect.FieldAccessException;
import com.comphenix.protocol.utility.MinecraftVersion;
import com.comphenix.protocol.wrappers.EnumWrappers.NativeGameMode;
import com.comphenix.protocol.wrappers.EnumWrappers.PlayerInfoAction;
import com.comphenix.protocol.wrappers.PlayerInfoData;
import com.comphenix.protocol.wrappers.WrappedChatComponent;
import com.comphenix.protocol.wrappers.WrappedGameProfile;
import fr.xephi.authme.AuthMe;
import fr.xephi.authme.ConsoleLogger;
import fr.xephi.authme.cache.auth.PlayerCache;
import fr.xephi.authme.util.BukkitService;
import org.bukkit.entity.Player;
import java.lang.reflect.InvocationTargetException;
@ -80,7 +83,12 @@ public class AuthMeTablistPacketAdapter extends PacketAdapter {
}
public void register() {
ProtocolLibrary.getProtocolManager().addPacketListener(this);
if (MinecraftVersion.getCurrentVersion().isAtLeast(MinecraftVersion.BOUNTIFUL_UPDATE)) {
ProtocolLibrary.getProtocolManager().addPacketListener(this);
} else {
ConsoleLogger.info("The hideTablist feature is not compatible with your minecraft version");
ConsoleLogger.info("It requires 1.8+. Disabling the hideTablist feature...");
}
}
public void unregister() {