mirror of
https://github.com/ViaVersion/ViaNBT.git
synced 2024-11-22 11:35:16 +01:00
3.1.0 Release
Add NumberTag#asBoolean
This commit is contained in:
parent
63c109efde
commit
f243f76d6f
@ -32,7 +32,7 @@ This project also includes code from [adventure](https://github.com/KyoriPowered
|
||||
<dependency>
|
||||
<groupId>com.viaversion</groupId>
|
||||
<artifactId>nbt</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.1.0</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
|
2
pom.xml
2
pom.xml
@ -5,7 +5,7 @@
|
||||
|
||||
<groupId>com.viaversion</groupId>
|
||||
<artifactId>nbt</artifactId>
|
||||
<version>3.0.0</version>
|
||||
<version>3.1.0</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>ViaNBT</name>
|
||||
|
@ -77,7 +77,7 @@ public class ListTag extends Tag implements Iterable<Tag> {
|
||||
*
|
||||
* @return The ListTag's element type, or null if the list does not yet have a defined type.
|
||||
*/
|
||||
public Class<? extends Tag> getElementType() {
|
||||
public @Nullable Class<? extends Tag> getElementType() {
|
||||
return this.type;
|
||||
}
|
||||
|
||||
|
@ -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.
|
||||
* <p>
|
||||
* 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;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user