From 9f71f9b9786a506c59caffc5331bf14164ee8bfe Mon Sep 17 00:00:00 2001 From: Nassim Jahnke Date: Thu, 29 Feb 2024 13:45:43 +0100 Subject: [PATCH] Add ByteTag boolean constructor --- pom.xml | 2 +- .../github/steveice10/opennbt/tag/builtin/ByteTag.java | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index a5c83bf..221f5c1 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.viaversion nbt - 4.2.0 + 4.3.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 024acca..bfbf69b 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 @@ -28,6 +28,15 @@ public class ByteTag extends NumberTag { this.value = value; } + /** + * Creates a tag. + * + * @param value The value of the tag. + */ + public ByteTag(boolean value) { + this.value = (byte) (value ? 1 : 0); + } + public static ByteTag read(DataInput in, TagLimiter tagLimiter) throws IOException { tagLimiter.countByte(); return new ByteTag(in.readByte());