From 6b3d85af624fbfbebc185aed77c7b21157ca4bd9 Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Mon, 7 Jan 2013 20:24:15 +0100 Subject: [PATCH] Change "clone" to "deepClone", in line with PacketContainer. --- .../java/com/comphenix/protocol/wrappers/nbt/NbtBase.java | 2 +- .../com/comphenix/protocol/wrappers/nbt/NbtCompound.java | 4 ++-- .../com/comphenix/protocol/wrappers/nbt/NbtElement.java | 8 ++++---- .../java/com/comphenix/protocol/wrappers/nbt/NbtList.java | 4 ++-- 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtBase.java b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtBase.java index c6925309..1b9e521e 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtBase.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtBase.java @@ -48,5 +48,5 @@ public interface NbtBase { * Clone the current NBT tag. * @return The cloned tag. */ - public abstract NbtBase clone(); + public abstract NbtBase deepClone(); } \ No newline at end of file diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtCompound.java b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtCompound.java index 06e49e36..3481cee8 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtCompound.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtCompound.java @@ -141,8 +141,8 @@ public class NbtCompound implements NbtWrapper>>, Iterabl } @SuppressWarnings({"unchecked", "rawtypes"}) - public NbtBase>> clone() { - return (NbtBase) container.clone(); + public NbtBase>> deepClone() { + return (NbtBase) container.deepClone(); } /** 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 5ba7c16a..9a1d4314 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 @@ -19,13 +19,13 @@ import com.google.common.base.Objects; */ public class NbtElement implements NbtWrapper { // Structure modifier for the base class - private static StructureModifier baseModifier; + private static volatile StructureModifier baseModifier; // For retrieving the current type ID - private static Method methodGetTypeID; + private static volatile Method methodGetTypeID; // For cloning handles - private static Method methodClone; + private static volatile Method methodClone; // Structure modifiers for the different NBT elements private static StructureModifier[] modifiers = new StructureModifier[NbtType.values().length]; @@ -154,7 +154,7 @@ public class NbtElement implements NbtWrapper { } @Override - public NbtBase clone() { + public NbtBase deepClone() { if (methodClone == null) { Class base = MinecraftReflection.getNBTBaseClass(); diff --git a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtList.java b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtList.java index c3bd131d..c33380a1 100644 --- a/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtList.java +++ b/ProtocolLib/src/main/java/com/comphenix/protocol/wrappers/nbt/NbtList.java @@ -176,8 +176,8 @@ public class NbtList implements NbtWrapper>>, Iterabl } @SuppressWarnings({"unchecked", "rawtypes"}) - public NbtBase>> clone() { - return (NbtBase) container.clone(); + public NbtBase>> deepClone() { + return (NbtBase) container.deepClone(); } public void add(NbtBase element) {