diff --git a/pom.xml b/pom.xml index f52fb51..a5c83bf 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.viaversion nbt - 4.1.0 + 4.2.0 jar ViaNBT diff --git a/src/main/java/com/github/steveice10/opennbt/tag/builtin/ByteTag.java b/src/main/java/com/github/steveice10/opennbt/tag/builtin/ByteTag.java index 306e75b..024acca 100644 --- a/src/main/java/com/github/steveice10/opennbt/tag/builtin/ByteTag.java +++ b/src/main/java/com/github/steveice10/opennbt/tag/builtin/ByteTag.java @@ -51,7 +51,9 @@ public class ByteTag extends NumberTag { * Sets the value of this tag. * * @param value New value of this tag. + * @deprecated number tags will be immutable in the future */ + @Deprecated public void setValue(byte value) { this.value = value; } diff --git a/src/main/java/com/github/steveice10/opennbt/tag/builtin/CompoundTag.java b/src/main/java/com/github/steveice10/opennbt/tag/builtin/CompoundTag.java index d4ac747..dcc4db0 100644 --- a/src/main/java/com/github/steveice10/opennbt/tag/builtin/CompoundTag.java +++ b/src/main/java/com/github/steveice10/opennbt/tag/builtin/CompoundTag.java @@ -130,6 +130,8 @@ public class CompoundTag extends Tag implements Iterable> { /** * Gets the tag. + *

+ * This will have its generic removed and instead return a raw tag in the future. * * @param Type of tag to get. * @param tagName Name of the tag. @@ -160,8 +162,25 @@ public class CompoundTag extends Tag implements Iterable> { return tag instanceof NumberTag ? (NumberTag) tag : null; } + public @Nullable ByteArrayTag getByteArrayTag(String tagName) { + final Tag tag = this.value.get(tagName); + return tag instanceof ByteArrayTag ? (ByteArrayTag) tag : null; + } + + public @Nullable IntArrayTag getIntArrayTag(String tagName) { + final Tag tag = this.value.get(tagName); + return tag instanceof IntArrayTag ? (IntArrayTag) tag : null; + } + + public @Nullable LongArrayTag getLongArrayTag(String tagName) { + final Tag tag = this.value.get(tagName); + return tag instanceof LongArrayTag ? (LongArrayTag) tag : null; + } + /** * Puts the tag into this compound tag. + *

+ * This will have its generic removed and instead return a raw tag in the future. * * @param Type of tag to put. * @param tagName Name of the tag. @@ -211,6 +230,8 @@ public class CompoundTag extends Tag implements Iterable> { /** * Removes a tag from this compound tag. + *

+ * This will have its generic removed and instead return a raw tag in the future. * * @param Type of tag to remove. * @param tagName Name of the tag to remove. diff --git a/src/main/java/com/github/steveice10/opennbt/tag/builtin/DoubleTag.java b/src/main/java/com/github/steveice10/opennbt/tag/builtin/DoubleTag.java index 5bc3b9e..17ab142 100644 --- a/src/main/java/com/github/steveice10/opennbt/tag/builtin/DoubleTag.java +++ b/src/main/java/com/github/steveice10/opennbt/tag/builtin/DoubleTag.java @@ -51,7 +51,9 @@ public class DoubleTag extends NumberTag { * Sets the value of this tag. * * @param value New value of this tag. + * @deprecated number tags will be immutable in the future */ + @Deprecated public void setValue(double value) { this.value = value; } diff --git a/src/main/java/com/github/steveice10/opennbt/tag/builtin/FloatTag.java b/src/main/java/com/github/steveice10/opennbt/tag/builtin/FloatTag.java index 09443f8..41afba4 100644 --- a/src/main/java/com/github/steveice10/opennbt/tag/builtin/FloatTag.java +++ b/src/main/java/com/github/steveice10/opennbt/tag/builtin/FloatTag.java @@ -51,7 +51,9 @@ public class FloatTag extends NumberTag { * Sets the value of this tag. * * @param value New value of this tag. + * @deprecated number tags will be immutable in the future */ + @Deprecated public void setValue(float value) { this.value = value; } diff --git a/src/main/java/com/github/steveice10/opennbt/tag/builtin/IntTag.java b/src/main/java/com/github/steveice10/opennbt/tag/builtin/IntTag.java index 6aa884c..ba1c1fa 100644 --- a/src/main/java/com/github/steveice10/opennbt/tag/builtin/IntTag.java +++ b/src/main/java/com/github/steveice10/opennbt/tag/builtin/IntTag.java @@ -51,7 +51,9 @@ public class IntTag extends NumberTag { * Sets the value of this tag. * * @param value New value of this tag. + * @deprecated number tags will be immutable in the future */ + @Deprecated public void setValue(int value) { this.value = value; } diff --git a/src/main/java/com/github/steveice10/opennbt/tag/builtin/LongTag.java b/src/main/java/com/github/steveice10/opennbt/tag/builtin/LongTag.java index a51d9d5..bd5ee72 100644 --- a/src/main/java/com/github/steveice10/opennbt/tag/builtin/LongTag.java +++ b/src/main/java/com/github/steveice10/opennbt/tag/builtin/LongTag.java @@ -51,7 +51,9 @@ public class LongTag extends NumberTag { * Sets the value of this tag. * * @param value New value of this tag. + * @deprecated number tags will be immutable in the future */ + @Deprecated public void setValue(long value) { this.value = value; } diff --git a/src/main/java/com/github/steveice10/opennbt/tag/builtin/ShortTag.java b/src/main/java/com/github/steveice10/opennbt/tag/builtin/ShortTag.java index e1234ef..09d4e14 100644 --- a/src/main/java/com/github/steveice10/opennbt/tag/builtin/ShortTag.java +++ b/src/main/java/com/github/steveice10/opennbt/tag/builtin/ShortTag.java @@ -51,7 +51,9 @@ public class ShortTag extends NumberTag { * Sets the value of this tag. * * @param value New value of this tag. + * @deprecated number tags will be immutable in the future */ + @Deprecated public void setValue(short value) { this.value = value; } diff --git a/src/main/java/com/github/steveice10/opennbt/tag/builtin/Tag.java b/src/main/java/com/github/steveice10/opennbt/tag/builtin/Tag.java index 1d5ae4d..80c9ecb 100644 --- a/src/main/java/com/github/steveice10/opennbt/tag/builtin/Tag.java +++ b/src/main/java/com/github/steveice10/opennbt/tag/builtin/Tag.java @@ -28,6 +28,8 @@ public abstract class Tag { /** * Returns the unchecked value of this tag. + *

+ * The generic of this method might be removed in a later version * * @param expected type * @return unchecked value of this tag