diff --git a/README.md b/README.md index f48e8a8..95ff744 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ This project also includes code from [adventure](https://github.com/KyoriPowered com.viaversion nbt - 3.0.0 + 3.1.0 ``` diff --git a/pom.xml b/pom.xml index 7cbe020..5fe8ea9 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.viaversion nbt - 3.0.0 + 3.1.0 jar ViaNBT diff --git a/src/main/java/com/github/steveice10/opennbt/tag/builtin/ListTag.java b/src/main/java/com/github/steveice10/opennbt/tag/builtin/ListTag.java index c701523..04f213a 100644 --- a/src/main/java/com/github/steveice10/opennbt/tag/builtin/ListTag.java +++ b/src/main/java/com/github/steveice10/opennbt/tag/builtin/ListTag.java @@ -77,7 +77,7 @@ public class ListTag extends Tag implements Iterable { * * @return The ListTag's element type, or null if the list does not yet have a defined type. */ - public Class getElementType() { + public @Nullable Class getElementType() { return this.type; } diff --git a/src/main/java/com/github/steveice10/opennbt/tag/builtin/NumberTag.java b/src/main/java/com/github/steveice10/opennbt/tag/builtin/NumberTag.java index 13942f5..bccccd7 100644 --- a/src/main/java/com/github/steveice10/opennbt/tag/builtin/NumberTag.java +++ b/src/main/java/com/github/steveice10/opennbt/tag/builtin/NumberTag.java @@ -46,4 +46,16 @@ public abstract class NumberTag extends Tag { * @return Double value of this tag. */ public abstract double asDouble(); + + /** + * Gets the boolean value of this tag. + *

+ * Booleans do not have a direct nbt representation in NBT per se, + * but check whether a number value is different to 0. + * + * @return Boolean value of this tag. + */ + public boolean asBoolean() { + return this.asByte() != 0; + } }