From 4756de8066f0a489f87984bd1753a058424964e8 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Tue, 8 Jan 2013 03:16:21 +0100 Subject: [PATCH] Factory methods should return NBTWrapper. --- .../protocol/wrappers/nbt/NbtElement.java | 2 +- .../protocol/wrappers/nbt/NbtFactory.java | 22 +++++++++---------- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtElement.java b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtElement.java index 0756ab35..488e681a 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtElement.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtElement.java @@ -41,7 +41,7 @@ public class NbtElement implements NbtWrapper { // For retrieving the current type ID private static volatile Method methodGetTypeID; - // For cloning handles + // For handling cloning private static volatile Method methodClone; // Structure modifiers for the different NBT elements diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtFactory.java b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtFactory.java index d1654d29..0a512869 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtFactory.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtFactory.java @@ -172,7 +172,7 @@ public class NbtFactory { * @param value - the NBT tag to write. * @param destination - the destination stream. */ - public static void toStream(NbtBase value, DataOutput destination) { + public static void toStream(NbtWrapper value, DataOutput destination) { if (methodWrite == null) { Class base = MinecraftReflection.getNBTBaseClass(); @@ -193,7 +193,7 @@ public class NbtFactory { * @param source - the input stream. * @return An NBT tag. */ - public static NbtBase fromStream(DataInput source) { + public static NbtWrapper fromStream(DataInput source) { if (methodLoad == null) { Class base = MinecraftReflection.getNBTBaseClass(); @@ -215,7 +215,7 @@ public class NbtFactory { * @param value - value of the tag. * @return The constructed NBT tag. */ - public static NbtBase of(String name, String value) { + public static NbtWrapper of(String name, String value) { return ofType(NbtType.TAG_STRING, name, value); } @@ -225,7 +225,7 @@ public class NbtFactory { * @param value - value of the tag. * @return The constructed NBT tag. */ - public static NbtBase of(String name, byte value) { + public static NbtWrapper of(String name, byte value) { return ofType(NbtType.TAG_BYTE, name, value); } @@ -235,7 +235,7 @@ public class NbtFactory { * @param value - value of the tag. * @return The constructed NBT tag. */ - public static NbtBase of(String name, short value) { + public static NbtWrapper of(String name, short value) { return ofType(NbtType.TAG_SHORT, name, value); } @@ -245,7 +245,7 @@ public class NbtFactory { * @param value - value of the tag. * @return The constructed NBT tag. */ - public static NbtBase of(String name, int value) { + public static NbtWrapper of(String name, int value) { return ofType(NbtType.TAG_INT, name, value); } @@ -255,7 +255,7 @@ public class NbtFactory { * @param value - value of the tag. * @return The constructed NBT tag. */ - public static NbtBase of(String name, long value) { + public static NbtWrapper of(String name, long value) { return ofType(NbtType.TAG_LONG, name, value); } @@ -265,7 +265,7 @@ public class NbtFactory { * @param value - value of the tag. * @return The constructed NBT tag. */ - public static NbtBase of(String name, float value) { + public static NbtWrapper of(String name, float value) { return ofType(NbtType.TAG_FLOAT, name, value); } @@ -275,7 +275,7 @@ public class NbtFactory { * @param value - value of the tag. * @return The constructed NBT tag. */ - public static NbtBase of(String name, double value) { + public static NbtWrapper of(String name, double value) { return ofType(NbtType.TAG_DOUBlE, name, value); } @@ -285,7 +285,7 @@ public class NbtFactory { * @param value - value of the tag. * @return The constructed NBT tag. */ - public static NbtBase of(String name, byte[] value) { + public static NbtWrapper of(String name, byte[] value) { return ofType(NbtType.TAG_BYTE_ARRAY, name, value); } @@ -295,7 +295,7 @@ public class NbtFactory { * @param value - value of the tag. * @return The constructed NBT tag. */ - public static NbtBase of(String name, int[] value) { + public static NbtWrapper of(String name, int[] value) { return ofType(NbtType.TAG_INT_ARRAY, name, value); }