From ab0ef6d37cfece353ddc156cf1c734015a294890 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Tue, 10 Dec 2013 16:27:30 +0100 Subject: [PATCH] A couple of small last minute bug fixes. --- .../main/java/com/comphenix/protocol/CommandPacket.java | 2 +- .../com/comphenix/protocol/events/PacketContainer.java | 2 +- .../java/com/comphenix/protocol/wrappers/EnumWrappers.java | 7 +++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/CommandPacket.java b/ProtocolLib/src/main/java/com/comphenix/protocol/CommandPacket.java index 7f7d3b57..60c62025 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/CommandPacket.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/CommandPacket.java @@ -260,7 +260,7 @@ class CommandPacket extends CommandBase { if (subCommand == SubCommand.ADD) { // The add command is dangerous - don't default on the connection side if (args.length == 1) { - sender.sendMessage(ChatColor.RED + "Please specify a connectionn side."); + sender.sendMessage(ChatColor.RED + "Please specify a connection side."); return false; } diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java index 7977749c..8caa7e11 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java @@ -595,7 +595,7 @@ public class PacketContainer implements Serializable { * Retrieve a read/write structure for the NativeGameMode enum in 1.7.2. * @return A modifier for NativeGameMode enum fields. */ - public StructureModifier getGamemodes() { + public StructureModifier getGameModes() { // Convert to and from the wrapper return structureModifier.withType( EnumWrappers.getGameModeClass(), EnumWrappers.getGameModeConverter()); diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/EnumWrappers.java b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/EnumWrappers.java index 54c178b4..cf6721a6 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/EnumWrappers.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/EnumWrappers.java @@ -66,9 +66,9 @@ public abstract class EnumWrappers { /** * Initialize the wrappers, if we haven't already. */ - private static boolean initialize() { - if (MinecraftReflection.isUsingNetty()) - return false; + private static void initialize() { + if (!MinecraftReflection.isUsingNetty()) + throw new IllegalArgumentException("Not supported on 1.6.4 and earlier."); PROTOCOL_CLASS = getEnum(PacketType.Handshake.Client.SET_PROTOCOL.getPacketClass(), 0); CLIENT_COMMAND_CLASS = getEnum(PacketType.Play.Client.CLIENT_COMMAND.getPacketClass(), 0); @@ -83,7 +83,6 @@ public abstract class EnumWrappers { associate(DIFFICULTY_CLASS, Difficulty.class, getDifficultyConverter()); associate(ENTITY_USE_ACTION_CLASS, EntityUseAction.class, getEntityUseActionConverter()); associate(GAMEMODE_CLASS, NativeGameMode.class, getGameModeConverter()); - return true; } private static void associate(Class nativeClass, Class wrapperClass, EquivalentConverter converter) {