Package net.minecraft.nbt
Class NbtOps
java.lang.Object
net.minecraft.nbt.NbtOps
- All Implemented Interfaces:
com.mojang.serialization.DynamicOps<Tag>
public class NbtOps extends Object implements com.mojang.serialization.DynamicOps<Tag>
Used to handle Minecraft NBTs within
dynamics
for DataFixerUpper, allowing generalized serialization logic
shared across different type of data structures. Use INSTANCE
for the ops singleton.
For instance, dimension data may be stored as JSON in data packs, but they will be transported in packets as NBT. DataFixerUpper allows generalizing the dimension serialization logic to prevent duplicate code, where the NBT ops allow the DataFixerUpper dimension serialization logic to interact with Minecraft NBTs.
- See Also:
INSTANCE
- Mappings:
Namespace Name official nb
intermediary net/minecraft/class_2509
named net/minecraft/nbt/NbtOps
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) class
NbtOps.MapBuilder
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description protected
NbtOps()
-
Method Summary
Modifier and Type Method Description <U> U
convertTo(com.mojang.serialization.DynamicOps<U> dynamicOps, Tag tag)
Tag
createBoolean(boolean bool)
Tag
createByte(byte byte2)
Tag
createByteList(ByteBuffer byteBuffer)
Tag
createDouble(double double2)
Tag
createFloat(float float2)
Tag
createInt(int int2)
Tag
createIntList(IntStream intStream)
Tag
createList(Stream<Tag> stream)
Tag
createLong(long long2)
Tag
createLongList(LongStream longStream)
Tag
createMap(Stream<com.mojang.datafixers.util.Pair<Tag,Tag>> stream)
Tag
createNumeric(Number number)
Tag
createShort(short short2)
Tag
createString(String string)
Tag
empty()
com.mojang.serialization.DataResult<ByteBuffer>
getByteBuffer(Tag tag)
com.mojang.serialization.DataResult<IntStream>
getIntStream(Tag tag)
com.mojang.serialization.DataResult<Consumer<Consumer<Tag>>>
getList(Tag tag)
com.mojang.serialization.DataResult<LongStream>
getLongStream(Tag tag)
com.mojang.serialization.DataResult<com.mojang.serialization.MapLike<Tag>>
getMap(Tag tag)
com.mojang.serialization.DataResult<Consumer<BiConsumer<Tag,Tag>>>
getMapEntries(Tag tag)
com.mojang.serialization.DataResult<Stream<com.mojang.datafixers.util.Pair<Tag,Tag>>>
getMapValues(Tag tag)
com.mojang.serialization.DataResult<Number>
getNumberValue(Tag tag)
com.mojang.serialization.DataResult<Stream<Tag>>
getStream(Tag tag)
com.mojang.serialization.DataResult<String>
getStringValue(Tag tag)
com.mojang.serialization.RecordBuilder<Tag>
mapBuilder()
com.mojang.serialization.DataResult<Tag>
mergeToList(Tag tag, List<Tag> list)
com.mojang.serialization.DataResult<Tag>
mergeToList(Tag tag, Tag tag2)
com.mojang.serialization.DataResult<Tag>
mergeToMap(Tag tag, com.mojang.serialization.MapLike<Tag> mapLike)
com.mojang.serialization.DataResult<Tag>
mergeToMap(Tag tag, Tag tag2, Tag tag3)
private static AbstractListTag<?>
method_29144(byte byte2, byte byte3)
private static boolean
method_29145(byte byte2, byte byte3, byte byte4)
private static <T extends Tag>
voidmethod_29150(AbstractListTag<T> abstractListTag, Tag tag, List<Tag> list)
private static <T extends Tag>
voidmethod_29151(AbstractListTag<T> abstractListTag, Tag tag, Tag tag2)
Tag
remove(Tag tag, String string)
String
toString()
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.mojang.serialization.DynamicOps
compressMaps, convertList, convertMap, createMap, emptyList, emptyMap, get, getBooleanValue, getGeneric, getNumberValue, listBuilder, mergeToMap, mergeToPrimitive, set, update, updateGeneric, withDecoder, withEncoder, withParser
-
Field Details
-
INSTANCE
An singleton of the NBT dynamic ops.This ops does not compress maps (replace field name to value pairs with an ordered list of values in serialization). In fact, since Minecraft NBT lists can only contain elements of the same type, this op cannot compress maps.
- Mappings:
Namespace Name Mixin selector official a
Lnb;a:Lnb;
intermediary field_11560
Lnet/minecraft/class_2509;field_11560:Lnet/minecraft/class_2509;
named INSTANCE
Lnet/minecraft/nbt/NbtOps;INSTANCE:Lnet/minecraft/nbt/NbtOps;
-
-
Constructor Details
-
NbtOps
protected NbtOps()
-
-
Method Details
-
empty
- Specified by:
empty
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a()Lni;
intermediary method_10668
Lnet/minecraft/class_2509;method_10668()Lnet/minecraft/class_2520;
named empty
Lnet/minecraft/nbt/NbtOps;empty()Lnet/minecraft/nbt/Tag;
-
convertTo
- Specified by:
convertTo
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Lcom/mojang/serialization/DynamicOps;Lni;)Ljava/lang/Object;
intermediary method_29146
Lnet/minecraft/class_2509;method_29146(Lcom/mojang/serialization/DynamicOps;Lnet/minecraft/class_2520;)Ljava/lang/Object;
named convertTo
Lnet/minecraft/nbt/NbtOps;convertTo(Lcom/mojang/serialization/DynamicOps;Lnet/minecraft/nbt/Tag;)Ljava/lang/Object;
-
getNumberValue
- Specified by:
getNumberValue
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Lni;)Lcom/mojang/serialization/DataResult;
intermediary method_10645
Lnet/minecraft/class_2509;method_10645(Lnet/minecraft/class_2520;)Lcom/mojang/serialization/DataResult;
named getNumberValue
Lnet/minecraft/nbt/NbtOps;getNumberValue(Lnet/minecraft/nbt/Tag;)Lcom/mojang/serialization/DataResult;
-
createNumeric
- Specified by:
createNumeric
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Ljava/lang/Number;)Lni;
intermediary method_10660
Lnet/minecraft/class_2509;method_10660(Ljava/lang/Number;)Lnet/minecraft/class_2520;
named createNumeric
Lnet/minecraft/nbt/NbtOps;createNumeric(Ljava/lang/Number;)Lnet/minecraft/nbt/Tag;
-
createByte
- Specified by:
createByte
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(B)Lni;
intermediary method_10640
Lnet/minecraft/class_2509;method_10640(B)Lnet/minecraft/class_2520;
named createByte
Lnet/minecraft/nbt/NbtOps;createByte(B)Lnet/minecraft/nbt/Tag;
-
createShort
- Specified by:
createShort
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(S)Lni;
intermediary method_10635
Lnet/minecraft/class_2509;method_10635(S)Lnet/minecraft/class_2520;
named createShort
Lnet/minecraft/nbt/NbtOps;createShort(S)Lnet/minecraft/nbt/Tag;
-
createInt
- Specified by:
createInt
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(I)Lni;
intermediary method_10661
Lnet/minecraft/class_2509;method_10661(I)Lnet/minecraft/class_2520;
named createInt
Lnet/minecraft/nbt/NbtOps;createInt(I)Lnet/minecraft/nbt/Tag;
-
createLong
- Specified by:
createLong
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(J)Lni;
intermediary method_10654
Lnet/minecraft/class_2509;method_10654(J)Lnet/minecraft/class_2520;
named createLong
Lnet/minecraft/nbt/NbtOps;createLong(J)Lnet/minecraft/nbt/Tag;
-
createFloat
- Specified by:
createFloat
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(F)Lni;
intermediary method_10662
Lnet/minecraft/class_2509;method_10662(F)Lnet/minecraft/class_2520;
named createFloat
Lnet/minecraft/nbt/NbtOps;createFloat(F)Lnet/minecraft/nbt/Tag;
-
createDouble
- Specified by:
createDouble
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(D)Lni;
intermediary method_10652
Lnet/minecraft/class_2509;method_10652(D)Lnet/minecraft/class_2520;
named createDouble
Lnet/minecraft/nbt/NbtOps;createDouble(D)Lnet/minecraft/nbt/Tag;
-
createBoolean
- Specified by:
createBoolean
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Z)Lni;
intermediary method_23253
Lnet/minecraft/class_2509;method_23253(Z)Lnet/minecraft/class_2520;
named createBoolean
Lnet/minecraft/nbt/NbtOps;createBoolean(Z)Lnet/minecraft/nbt/Tag;
-
getStringValue
- Specified by:
getStringValue
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official b
Lnb;b(Lni;)Lcom/mojang/serialization/DataResult;
intermediary method_10656
Lnet/minecraft/class_2509;method_10656(Lnet/minecraft/class_2520;)Lcom/mojang/serialization/DataResult;
named getStringValue
Lnet/minecraft/nbt/NbtOps;getStringValue(Lnet/minecraft/nbt/Tag;)Lcom/mojang/serialization/DataResult;
-
createString
- Specified by:
createString
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Ljava/lang/String;)Lni;
intermediary method_10639
Lnet/minecraft/class_2509;method_10639(Ljava/lang/String;)Lnet/minecraft/class_2520;
named createString
Lnet/minecraft/nbt/NbtOps;createString(Ljava/lang/String;)Lnet/minecraft/nbt/Tag;
-
method_29144
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(BB)Lmp;
intermediary method_29144
Lnet/minecraft/class_2509;method_29144(BB)Lnet/minecraft/class_2483;
named method_29144
Lnet/minecraft/nbt/NbtOps;method_29144(BB)Lnet/minecraft/nbt/AbstractListTag;
-
method_29145
private static boolean method_29145(byte byte2, byte byte3, byte byte4)- Mappings:
Namespace Name Mixin selector official a
Lnb;a(BBB)Z
intermediary method_29145
Lnet/minecraft/class_2509;method_29145(BBB)Z
named method_29145
Lnet/minecraft/nbt/NbtOps;method_29145(BBB)Z
-
method_29151
private static <T extends Tag> void method_29151(AbstractListTag<T> abstractListTag, Tag tag, Tag tag2)- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Lmp;Lni;Lni;)V
intermediary method_29151
Lnet/minecraft/class_2509;method_29151(Lnet/minecraft/class_2483;Lnet/minecraft/class_2520;Lnet/minecraft/class_2520;)V
named method_29151
Lnet/minecraft/nbt/NbtOps;method_29151(Lnet/minecraft/nbt/AbstractListTag;Lnet/minecraft/nbt/Tag;Lnet/minecraft/nbt/Tag;)V
-
method_29150
private static <T extends Tag> void method_29150(AbstractListTag<T> abstractListTag, Tag tag, List<Tag> list)- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Lmp;Lni;Ljava/util/List;)V
intermediary method_29150
Lnet/minecraft/class_2509;method_29150(Lnet/minecraft/class_2483;Lnet/minecraft/class_2520;Ljava/util/List;)V
named method_29150
Lnet/minecraft/nbt/NbtOps;method_29150(Lnet/minecraft/nbt/AbstractListTag;Lnet/minecraft/nbt/Tag;Ljava/util/List;)V
-
mergeToList
- Specified by:
mergeToList
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Lni;Lni;)Lcom/mojang/serialization/DataResult;
intermediary method_29156
Lnet/minecraft/class_2509;method_29156(Lnet/minecraft/class_2520;Lnet/minecraft/class_2520;)Lcom/mojang/serialization/DataResult;
named mergeToList
Lnet/minecraft/nbt/NbtOps;mergeToList(Lnet/minecraft/nbt/Tag;Lnet/minecraft/nbt/Tag;)Lcom/mojang/serialization/DataResult;
-
mergeToList
- Specified by:
mergeToList
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Lni;Ljava/util/List;)Lcom/mojang/serialization/DataResult;
intermediary method_29155
Lnet/minecraft/class_2509;method_29155(Lnet/minecraft/class_2520;Ljava/util/List;)Lcom/mojang/serialization/DataResult;
named mergeToList
Lnet/minecraft/nbt/NbtOps;mergeToList(Lnet/minecraft/nbt/Tag;Ljava/util/List;)Lcom/mojang/serialization/DataResult;
-
mergeToMap
- Specified by:
mergeToMap
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Lni;Lni;Lni;)Lcom/mojang/serialization/DataResult;
intermediary method_29157
Lnet/minecraft/class_2509;method_29157(Lnet/minecraft/class_2520;Lnet/minecraft/class_2520;Lnet/minecraft/class_2520;)Lcom/mojang/serialization/DataResult;
named mergeToMap
Lnet/minecraft/nbt/NbtOps;mergeToMap(Lnet/minecraft/nbt/Tag;Lnet/minecraft/nbt/Tag;Lnet/minecraft/nbt/Tag;)Lcom/mojang/serialization/DataResult;
-
mergeToMap
public com.mojang.serialization.DataResult<Tag> mergeToMap(Tag tag, com.mojang.serialization.MapLike<Tag> mapLike)- Specified by:
mergeToMap
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Lni;Lcom/mojang/serialization/MapLike;)Lcom/mojang/serialization/DataResult;
intermediary method_29154
Lnet/minecraft/class_2509;method_29154(Lnet/minecraft/class_2520;Lcom/mojang/serialization/MapLike;)Lcom/mojang/serialization/DataResult;
named mergeToMap
Lnet/minecraft/nbt/NbtOps;mergeToMap(Lnet/minecraft/nbt/Tag;Lcom/mojang/serialization/MapLike;)Lcom/mojang/serialization/DataResult;
-
getMapValues
public com.mojang.serialization.DataResult<Stream<com.mojang.datafixers.util.Pair<Tag,Tag>>> getMapValues(Tag tag)- Specified by:
getMapValues
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official c
Lnb;c(Lni;)Lcom/mojang/serialization/DataResult;
intermediary method_10669
Lnet/minecraft/class_2509;method_10669(Lnet/minecraft/class_2520;)Lcom/mojang/serialization/DataResult;
named getMapValues
Lnet/minecraft/nbt/NbtOps;getMapValues(Lnet/minecraft/nbt/Tag;)Lcom/mojang/serialization/DataResult;
-
getMapEntries
- Specified by:
getMapEntries
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official d
Lnb;d(Lni;)Lcom/mojang/serialization/DataResult;
intermediary method_29162
Lnet/minecraft/class_2509;method_29162(Lnet/minecraft/class_2520;)Lcom/mojang/serialization/DataResult;
named getMapEntries
Lnet/minecraft/nbt/NbtOps;getMapEntries(Lnet/minecraft/nbt/Tag;)Lcom/mojang/serialization/DataResult;
-
getMap
- Specified by:
getMap
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official e
Lnb;e(Lni;)Lcom/mojang/serialization/DataResult;
intermediary method_29163
Lnet/minecraft/class_2509;method_29163(Lnet/minecraft/class_2520;)Lcom/mojang/serialization/DataResult;
named getMap
Lnet/minecraft/nbt/NbtOps;getMap(Lnet/minecraft/nbt/Tag;)Lcom/mojang/serialization/DataResult;
-
createMap
- Specified by:
createMap
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Ljava/util/stream/Stream;)Lni;
intermediary method_10655
Lnet/minecraft/class_2509;method_10655(Ljava/util/stream/Stream;)Lnet/minecraft/class_2520;
named createMap
Lnet/minecraft/nbt/NbtOps;createMap(Ljava/util/stream/Stream;)Lnet/minecraft/nbt/Tag;
-
getStream
- Specified by:
getStream
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official f
Lnb;f(Lni;)Lcom/mojang/serialization/DataResult;
intermediary method_10664
Lnet/minecraft/class_2509;method_10664(Lnet/minecraft/class_2520;)Lcom/mojang/serialization/DataResult;
named getStream
Lnet/minecraft/nbt/NbtOps;getStream(Lnet/minecraft/nbt/Tag;)Lcom/mojang/serialization/DataResult;
-
getList
- Specified by:
getList
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official g
Lnb;g(Lni;)Lcom/mojang/serialization/DataResult;
intermediary method_29164
Lnet/minecraft/class_2509;method_29164(Lnet/minecraft/class_2520;)Lcom/mojang/serialization/DataResult;
named getList
Lnet/minecraft/nbt/NbtOps;getList(Lnet/minecraft/nbt/Tag;)Lcom/mojang/serialization/DataResult;
-
getByteBuffer
- Specified by:
getByteBuffer
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official h
Lnb;h(Lni;)Lcom/mojang/serialization/DataResult;
intermediary method_10646
Lnet/minecraft/class_2509;method_10646(Lnet/minecraft/class_2520;)Lcom/mojang/serialization/DataResult;
named getByteBuffer
Lnet/minecraft/nbt/NbtOps;getByteBuffer(Lnet/minecraft/nbt/Tag;)Lcom/mojang/serialization/DataResult;
-
createByteList
- Specified by:
createByteList
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Ljava/nio/ByteBuffer;)Lni;
intermediary method_10657
Lnet/minecraft/class_2509;method_10657(Ljava/nio/ByteBuffer;)Lnet/minecraft/class_2520;
named createByteList
Lnet/minecraft/nbt/NbtOps;createByteList(Ljava/nio/ByteBuffer;)Lnet/minecraft/nbt/Tag;
-
getIntStream
- Specified by:
getIntStream
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official i
Lnb;i(Lni;)Lcom/mojang/serialization/DataResult;
intermediary method_10651
Lnet/minecraft/class_2509;method_10651(Lnet/minecraft/class_2520;)Lcom/mojang/serialization/DataResult;
named getIntStream
Lnet/minecraft/nbt/NbtOps;getIntStream(Lnet/minecraft/nbt/Tag;)Lcom/mojang/serialization/DataResult;
-
createIntList
- Specified by:
createIntList
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Ljava/util/stream/IntStream;)Lni;
intermediary method_10663
Lnet/minecraft/class_2509;method_10663(Ljava/util/stream/IntStream;)Lnet/minecraft/class_2520;
named createIntList
Lnet/minecraft/nbt/NbtOps;createIntList(Ljava/util/stream/IntStream;)Lnet/minecraft/nbt/Tag;
-
getLongStream
- Specified by:
getLongStream
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official j
Lnb;j(Lni;)Lcom/mojang/serialization/DataResult;
intermediary method_10637
Lnet/minecraft/class_2509;method_10637(Lnet/minecraft/class_2520;)Lcom/mojang/serialization/DataResult;
named getLongStream
Lnet/minecraft/nbt/NbtOps;getLongStream(Lnet/minecraft/nbt/Tag;)Lcom/mojang/serialization/DataResult;
-
createLongList
- Specified by:
createLongList
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Ljava/util/stream/LongStream;)Lni;
intermediary method_10643
Lnet/minecraft/class_2509;method_10643(Ljava/util/stream/LongStream;)Lnet/minecraft/class_2520;
named createLongList
Lnet/minecraft/nbt/NbtOps;createLongList(Ljava/util/stream/LongStream;)Lnet/minecraft/nbt/Tag;
-
createList
- Specified by:
createList
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official b
Lnb;b(Ljava/util/stream/Stream;)Lni;
intermediary method_10665
Lnet/minecraft/class_2509;method_10665(Ljava/util/stream/Stream;)Lnet/minecraft/class_2520;
named createList
Lnet/minecraft/nbt/NbtOps;createList(Ljava/util/stream/Stream;)Lnet/minecraft/nbt/Tag;
-
remove
- Specified by:
remove
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official a
Lnb;a(Lni;Ljava/lang/String;)Lni;
intermediary method_10648
Lnet/minecraft/class_2509;method_10648(Lnet/minecraft/class_2520;Ljava/lang/String;)Lnet/minecraft/class_2520;
named remove
Lnet/minecraft/nbt/NbtOps;remove(Lnet/minecraft/nbt/Tag;Ljava/lang/String;)Lnet/minecraft/nbt/Tag;
-
toString
-
mapBuilder
- Specified by:
mapBuilder
in interfacecom.mojang.serialization.DynamicOps<Tag>
- Mappings:
Namespace Name Mixin selector official mapBuilder
Lnb;mapBuilder()Lcom/mojang/serialization/RecordBuilder;
intermediary mapBuilder
Lnet/minecraft/class_2509;mapBuilder()Lcom/mojang/serialization/RecordBuilder;
named mapBuilder
Lnet/minecraft/nbt/NbtOps;mapBuilder()Lcom/mojang/serialization/RecordBuilder;
-