From fd3fabba02ed2b1c7bf95bd26a718de15b10d61e Mon Sep 17 00:00:00 2001 From: GeorgH93 Date: Tue, 3 Oct 2017 20:10:28 +0200 Subject: [PATCH] Bugfix --- .../CauldronNBTItemStackSerializer.java | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/at/pcgamingfreaks/MinePacks/Database/CauldronNBTItemStackSerializer.java b/src/at/pcgamingfreaks/MinePacks/Database/CauldronNBTItemStackSerializer.java index 938d18e..a7530a2 100644 --- a/src/at/pcgamingfreaks/MinePacks/Database/CauldronNBTItemStackSerializer.java +++ b/src/at/pcgamingfreaks/MinePacks/Database/CauldronNBTItemStackSerializer.java @@ -35,17 +35,17 @@ public class CauldronNBTItemStackSerializer implements ItemStackSerializer private static final Class CLASS_NBT_TAG_COMPOUND = CauldronReflection.getNMSClass("NBTTagCompound"); private static final Class CLASS_NBT_COMPRESSED_STREAM_TOOLS = CauldronReflection.getNMSClass("NBTCompressedStreamTools"); private static final Class CLASS_NMS_ITEM_STACK = CauldronReflection.getNMSClass("ItemStack"); - private static final Method METHOD_NBT_TAG_C_SET_INT = CauldronReflection.getMethod(CLASS_NBT_TAG_COMPOUND, "setInt", String.class, int.class); - private static final Method METHOD_NBT_COMP_STEAM_A = CauldronReflection.getMethod(CLASS_NBT_COMPRESSED_STREAM_TOOLS, "a", CLASS_NBT_TAG_COMPOUND, OutputStream.class); - private static final Method METHOD_NBT_TAG_C_SET2 = CauldronReflection.getMethod(CLASS_NBT_TAG_COMPOUND, "set", String.class, CauldronReflection.getNMSClass("NBTBase")); - private static final Method METHOD_SAVE = CauldronReflection.getMethod(CLASS_NMS_ITEM_STACK, "save", CLASS_NBT_TAG_COMPOUND); - private static final Method METHOD_AS_NMS_COPY = CauldronReflection.getMethod(CLASS_CRAFT_ITEM_STACK, "asNMSCopy", ItemStack.class); - private static final Method METHOD_GET_INT = CauldronReflection.getMethod(CLASS_NBT_TAG_COMPOUND, "getInt", String.class); - private static final Method METHOD_HAS_KEY_OF_TYPE = CauldronReflection.getMethod(CLASS_NBT_TAG_COMPOUND, "hasKeyOfType", String.class, int.class); - private static final Method METHOD_GET_COMPOUND = CauldronReflection.getMethod(CLASS_NBT_TAG_COMPOUND, "getCompound", String.class); - private static final Method METHOD_CREATE_STACK = CauldronReflection.getMethod(CLASS_NMS_ITEM_STACK, "createStack", CLASS_NBT_TAG_COMPOUND); - private static final Method METHOD_AS_BUKKIT_COPY = CauldronReflection.getMethod(CLASS_CRAFT_ITEM_STACK, "asBukkitCopy", CLASS_NMS_ITEM_STACK); - private static final Method METHOD_NBT_COMP_STREAM_A2 = CauldronReflection.getMethod(CLASS_NBT_COMPRESSED_STREAM_TOOLS, "a", InputStream.class); + private static final Method METHOD_NBT_TAG_C_SET_INT = CauldronReflection.getNMSMethod(CLASS_NBT_TAG_COMPOUND, "setInt", String.class, int.class); + private static final Method METHOD_NBT_COMP_STEAM_A = CauldronReflection.getNMSMethod(CLASS_NBT_COMPRESSED_STREAM_TOOLS, "a", CLASS_NBT_TAG_COMPOUND, OutputStream.class); + private static final Method METHOD_NBT_TAG_C_SET2 = CauldronReflection.getNMSMethod(CLASS_NBT_TAG_COMPOUND, "set", String.class, CauldronReflection.getNMSClass("NBTBase")); + private static final Method METHOD_SAVE = CauldronReflection.getNMSMethod(CLASS_NMS_ITEM_STACK, "save", CLASS_NBT_TAG_COMPOUND); + private static final Method METHOD_AS_NMS_COPY = CauldronReflection.getNMSMethod(CLASS_CRAFT_ITEM_STACK, "asNMSCopy", ItemStack.class); + private static final Method METHOD_GET_INT = CauldronReflection.getNMSMethod(CLASS_NBT_TAG_COMPOUND, "getInt", String.class); + private static final Method METHOD_HAS_KEY_OF_TYPE = CauldronReflection.getNMSMethod(CLASS_NBT_TAG_COMPOUND, "hasKeyOfType", String.class, int.class); + private static final Method METHOD_GET_COMPOUND = CauldronReflection.getNMSMethod(CLASS_NBT_TAG_COMPOUND, "getCompound", String.class); + private static final Method METHOD_CREATE_STACK = CauldronReflection.getNMSMethod(CLASS_NMS_ITEM_STACK, "createStack", CLASS_NBT_TAG_COMPOUND); + private static final Method METHOD_AS_BUKKIT_COPY = CauldronReflection.getNMSMethod(CLASS_CRAFT_ITEM_STACK, "asBukkitCopy", CLASS_NMS_ITEM_STACK); + private static final Method METHOD_NBT_COMP_STREAM_A2 = CauldronReflection.getNMSMethod(CLASS_NBT_COMPRESSED_STREAM_TOOLS, "a", InputStream.class); //endregion /** @@ -60,7 +60,7 @@ public ItemStack[] deserialize(byte[] data) if(METHOD_NBT_COMP_STREAM_A2 == null || METHOD_GET_INT == null || METHOD_HAS_KEY_OF_TYPE == null || METHOD_AS_BUKKIT_COPY == null || METHOD_GET_COMPOUND == null || METHOD_CREATE_STACK == null) { System.out.println("It seems like the system wasn't able to find the some of the Bukkit/Minecraft classes and functions.\n" + - "Is the plugin up-to-date and compatible with the used server version?\nBukkit Version: " + Bukkit.getVersion()); + "Is the plugin up-to-date and compatible with the used server version?\nBukkit Version: " + Bukkit.getVersion() + " (" + Bukkit.getServer().getName() + ")"); } else if(data != null) { @@ -101,7 +101,7 @@ public byte[] serialize(ItemStack[] itemStacks) if(CLASS_NBT_TAG_COMPOUND == null || METHOD_NBT_TAG_C_SET2 == null || METHOD_NBT_TAG_C_SET_INT == null || METHOD_SAVE == null || METHOD_AS_NMS_COPY == null || METHOD_NBT_COMP_STEAM_A == null) { System.out.println("It seems like the system wasn't able to find the some of the Bukkit/Minecraft classes and functions.\n" + - "Is the plugin up-to-date and compatible with the used server version?\nBukkit Version: " + Bukkit.getVersion()); + "Is the plugin up-to-date and compatible with the used server version?\nBukkit Version: " + Bukkit.getVersion() + " (" + Bukkit.getServer().getName() + ")"); } else if(itemStacks != null) {