Add Boolean tag

Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
TheMode 2022-04-10 15:38:13 +02:00
parent 97abccce0c
commit 1cdc0aeddb
2 changed files with 5 additions and 0 deletions

View File

@ -12,6 +12,7 @@ final class Serializers {
static final Entry<TagHandlerImpl, NBTCompound> PATH = new Entry<>(TagHandlerImpl::fromCompound, TagHandlerImpl::asCompound);
static final Entry<Byte, NBTByte> BYTE = new Entry<>(NBTByte::getValue, NBT::Byte);
static final Entry<Boolean, NBTByte> BOOLEAN = new Entry<>(NBTByte::asBoolean, NBT::Boolean);
static final Entry<Short, NBTShort> SHORT = new Entry<>(NBTShort::getValue, NBT::Short);
static final Entry<Integer, NBTInt> INT = new Entry<>(NBTInt::getValue, NBT::Int);
static final Entry<Long, NBTLong> LONG = new Entry<>(NBTLong::getValue, NBT::Long);

View File

@ -245,6 +245,10 @@ public class Tag<T> {
return tag(key, Serializers.BYTE);
}
public static @NotNull Tag<Boolean> Boolean(@NotNull String key) {
return tag(key, Serializers.BOOLEAN);
}
public static @NotNull Tag<Short> Short(@NotNull String key) {
return tag(key, Serializers.SHORT);
}