From fe3a69bd3d3de19aed15775a339f0ce5cdb9f0e8 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Fri, 12 Oct 2012 00:49:47 +0200 Subject: [PATCH] Switching from UTF-8 to cp1252. --- ItemDisguise/pom.xml | 4 ++++ .../com/comphenix/itemdisguise/HideEnchantmentsListener.java | 3 +++ .../main/java/com/comphenix/itemdisguise/ItemDisguiseMod.java | 2 +- ProtocolLib/pom.xml | 2 +- .../java/com/comphenix/protocol/events/PacketContainer.java | 2 +- .../com/comphenix/protocol/reflect/EquivalentConverter.java | 1 + Readme.md | 2 +- 7 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ItemDisguise/pom.xml b/ItemDisguise/pom.xml index 623aa497..9492958c 100644 --- a/ItemDisguise/pom.xml +++ b/ItemDisguise/pom.xml @@ -6,6 +6,10 @@ Item Disguise Change the appearance of inventory items. + + cp1252 + + bukkit-rep diff --git a/ItemDisguise/src/main/java/com/comphenix/itemdisguise/HideEnchantmentsListener.java b/ItemDisguise/src/main/java/com/comphenix/itemdisguise/HideEnchantmentsListener.java index a85c0779..e9ea5c79 100644 --- a/ItemDisguise/src/main/java/com/comphenix/itemdisguise/HideEnchantmentsListener.java +++ b/ItemDisguise/src/main/java/com/comphenix/itemdisguise/HideEnchantmentsListener.java @@ -110,6 +110,9 @@ public class HideEnchantmentsListener { } private void removeEnchantments(ItemStack stack) { + if (stack == null) + return; + Object[] copy = stack.getEnchantments().keySet().toArray(); for (Object enchantment : copy) { diff --git a/ItemDisguise/src/main/java/com/comphenix/itemdisguise/ItemDisguiseMod.java b/ItemDisguise/src/main/java/com/comphenix/itemdisguise/ItemDisguiseMod.java index 29bf32e6..a6d83b20 100644 --- a/ItemDisguise/src/main/java/com/comphenix/itemdisguise/ItemDisguiseMod.java +++ b/ItemDisguise/src/main/java/com/comphenix/itemdisguise/ItemDisguiseMod.java @@ -67,7 +67,7 @@ public class ItemDisguiseMod extends JavaPlugin { write(2, player.getLocation().getZ()); fakeExplosion.getSpecificModifier(float.class). write(0, 3.0F); - + protocolManager.sendServerPacket(player, fakeExplosion); } catch (Exception e) { diff --git a/ProtocolLib/pom.xml b/ProtocolLib/pom.xml index 980dbc2e..31991fa7 100644 --- a/ProtocolLib/pom.xml +++ b/ProtocolLib/pom.xml @@ -7,7 +7,7 @@ Provides read/write access to the Minecraft protocol. - UTF-8 + cp1252 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 17d93745..e1cf9b94 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/events/PacketContainer.java @@ -142,7 +142,7 @@ public class PacketContainer implements Serializable { * @return A modifier for ItemStack fields. */ public StructureModifier getItemModifier() { - // Convert from and to the Bukkit wrapper + // Convert to and from the Bukkit wrapper return structureModifier.withType(net.minecraft.server.ItemStack.class, getIgnoreNull(new EquivalentConverter() { public Object getGeneric(ItemStack specific) { diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/reflect/EquivalentConverter.java b/ProtocolLib/src/main/java/com/comphenix/protocol/reflect/EquivalentConverter.java index 4637cd2d..a03b5508 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/reflect/EquivalentConverter.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/reflect/EquivalentConverter.java @@ -28,3 +28,4 @@ public interface EquivalentConverter { public Object getGeneric(TType specific); public Class getSpecificType(); } + diff --git a/Readme.md b/Readme.md index 93ce2baf..70f15727 100644 --- a/Readme.md +++ b/Readme.md @@ -19,7 +19,7 @@ lead to more subtle bugs. Building -------- -You can compile this project yourself by using the latest version of Maven. +You can compile this project yourself by using the latest version of Maven. A new API