CLASS net/minecraft/class_2512 net/minecraft/nbt/NbtHelper COMMENT Helper methods for handling NBT. FIELD field_11582 LOGGER Lorg/slf4j/Logger; FIELD field_27816 BLOCK_POS_COMPARATOR Ljava/util/Comparator; FIELD field_27817 ENTITY_POS_COMPARATOR Ljava/util/Comparator; FIELD field_27818 COMMA_SPLITTER Lcom/google/common/base/Splitter; FIELD field_27819 COLON_SPLITTER Lcom/google/common/base/Splitter; FIELD field_33224 DATA_KEY Ljava/lang/String; FIELD field_33225 LEFT_CURLY_BRACKET C FIELD field_33226 RIGHT_CURLY_BRACKET C FIELD field_33227 COMMA Ljava/lang/String; FIELD field_33228 COLON C METHOD method_10681 toBlockState (Lnet/minecraft/class_2487;)Lnet/minecraft/class_2680; COMMENT {@return the block state from the {@code nbt}} COMMENT COMMENT

This returns the default state for {@link net.minecraft.block.Blocks#AIR} COMMENT if the block name is not present. COMMENT COMMENT @see #fromBlockState(BlockState) ARG 0 nbt METHOD method_10682 withProperty (Lnet/minecraft/class_2688;Lnet/minecraft/class_2769;Ljava/lang/String;Lnet/minecraft/class_2487;Lnet/minecraft/class_2487;)Lnet/minecraft/class_2688; ARG 0 state ARG 1 property ARG 2 key ARG 3 properties ARG 4 root METHOD method_10683 toGameProfile (Lnet/minecraft/class_2487;)Lcom/mojang/authlib/GameProfile; COMMENT {@return the game profile converted from {@code nbt}} COMMENT COMMENT @see #writeGameProfile(NbtCompound, GameProfile) ARG 0 nbt METHOD method_10684 writeGameProfile (Lnet/minecraft/class_2487;Lcom/mojang/authlib/GameProfile;)Lnet/minecraft/class_2487; COMMENT Writes the game profile to {@code nbt}. This modifies the passed compound. COMMENT COMMENT @return the compound with the serialized game profile COMMENT @see #toGameProfile(NbtCompound) ARG 0 nbt ARG 1 profile METHOD method_10685 nameValue (Lnet/minecraft/class_2769;Ljava/lang/Comparable;)Ljava/lang/String; ARG 0 property ARG 1 value METHOD method_10686 fromBlockState (Lnet/minecraft/class_2680;)Lnet/minecraft/class_2487; COMMENT {@return the serialized block state} COMMENT COMMENT @see #toBlockState(NbtCompound) ARG 0 state METHOD method_10687 matches (Lnet/minecraft/class_2520;Lnet/minecraft/class_2520;Z)Z COMMENT {@return whether {@code standard} is a subset of {@code subject}} COMMENT COMMENT

Elements are matched based on the following order: COMMENT

    COMMENT
  1. Passing the same reference to both parameters will return {@code true}.
  2. COMMENT
  3. If {@code standard} is {@code null}, return {@code true}.
  4. COMMENT
  5. If {@code subject} is {@code null}, return {@code false}.
  6. COMMENT
  7. If the types of {@code standard} and {@code subject} are different, COMMENT return {@code false}.
  8. COMMENT
  9. If {@code standard} is {@link NbtCompound}, return {@code true} if all keys COMMENT in the {@code standard} exist in {@code subject} and the values match (comparing COMMENT recursively.)
  10. COMMENT
  11. If {@code standard} is {@link NbtList} and {@code ignoreListOrder} is {@code true}, COMMENT return {@code true} if both lists are empty, or if there exists a "matching" value COMMENT in {@code subject} for all values of {@code standard} (that is, if {@code standard} COMMENT is a subset of {@code subject}, ignoring duplicates.), otherwise {@code false}. COMMENT This means that the comparison ignores the ordering of the lists.
  12. COMMENT
  13. Otherwise, return {@code standard.equals(subject)}.
  14. COMMENT
ARG 0 standard COMMENT the standard (also called as "template" or "schema") element ARG 1 subject COMMENT the element to test ARG 2 ignoreListOrder COMMENT whether to ignore ordering for {@link NbtList} METHOD method_10688 update (Lcom/mojang/datafixers/DataFixer;Lnet/minecraft/class_4284;Lnet/minecraft/class_2487;I)Lnet/minecraft/class_2487; COMMENT Uses the data fixer to update an NBT compound object to the latest data version. ARG 0 fixer COMMENT the data fixer ARG 1 fixTypes COMMENT the fix types ARG 2 compound COMMENT the NBT compound object to fix ARG 3 oldVersion COMMENT the data version of the NBT compound object METHOD method_10691 toBlockPos (Lnet/minecraft/class_2487;)Lnet/minecraft/class_2338; COMMENT {@return the block position from the {@code nbt}} COMMENT COMMENT @see #fromBlockPos(BlockPos) ARG 0 nbt METHOD method_10692 fromBlockPos (Lnet/minecraft/class_2338;)Lnet/minecraft/class_2487; COMMENT {@return the serialized block position} COMMENT COMMENT @see #toBlockPos(NbtCompound) ARG 0 pos METHOD method_10693 update (Lcom/mojang/datafixers/DataFixer;Lnet/minecraft/class_4284;Lnet/minecraft/class_2487;II)Lnet/minecraft/class_2487; COMMENT Uses the data fixer to update an NBT compound object. ARG 0 fixer COMMENT the data fixer ARG 1 fixTypes COMMENT the fix types ARG 2 compound COMMENT the NBT compound object to fix ARG 3 oldVersion COMMENT the data version of the NBT compound object ARG 4 targetVersion COMMENT the data version to update the NBT compound object to METHOD method_25929 fromUuid (Ljava/util/UUID;)Lnet/minecraft/class_2495; COMMENT Serializes a {@link UUID} into its equivalent NBT representation. COMMENT COMMENT @since 20w10a COMMENT @see #toUuid(NbtElement) ARG 0 uuid METHOD method_25930 toUuid (Lnet/minecraft/class_2520;)Ljava/util/UUID; COMMENT Deserializes an NBT element into a {@link UUID}. COMMENT The NBT element's data must have the same structure as the output of {@link #fromUuid}. COMMENT COMMENT @throws IllegalArgumentException if {@code element} is not a valid representation of a UUID COMMENT @since 20w10a COMMENT @see #fromUuid(UUID) ARG 0 element METHOD method_32260 fromNbtProviderString (Ljava/lang/String;)Lnet/minecraft/class_2487; COMMENT {@return the {@code string} parsed as an NBT provider-formatted COMMENT NBT compound} COMMENT COMMENT

This method first parses the string as an NBT, then performs COMMENT several conversions from human-readable {@link NbtCompound} items COMMENT to the actual values used in-game. COMMENT COMMENT @see net.minecraft.data.SnbtProvider COMMENT @see #toNbtProviderString ARG 0 string METHOD method_32261 (Ljava/util/Map;Lnet/minecraft/class_2487;)Lnet/minecraft/class_2499; ARG 1 nbt METHOD method_32262 (Lnet/minecraft/class_2487;Ljava/lang/String;)Ljava/lang/String; ARG 1 key METHOD method_32263 (Lnet/minecraft/class_2487;Ljava/lang/String;Ljava/lang/String;)V ARG 2 property METHOD method_32264 (Lnet/minecraft/class_2499;)D ARG 0 nbt METHOD method_32265 (Lnet/minecraft/class_2499;Lnet/minecraft/class_2487;)V ARG 1 nbt METHOD method_32266 (Lnet/minecraft/class_2499;Lnet/minecraft/class_2499;Lnet/minecraft/class_2499;)V ARG 2 nbt METHOD method_32267 fromNbtProviderFormattedPalette (Ljava/lang/String;)Lnet/minecraft/class_2487; ARG 0 string METHOD method_32268 (Lnet/minecraft/class_2499;)D ARG 0 nbt METHOD method_32269 (Lnet/minecraft/class_2499;)D ARG 0 nbt METHOD method_32270 toPrettyPrintedText (Lnet/minecraft/class_2520;)Lnet/minecraft/class_2561; COMMENT {@return the pretty-printed text representation of {@code element}} COMMENT COMMENT @see net.minecraft.nbt.visitor.NbtTextFormatter ARG 0 element METHOD method_32271 toNbtProviderString (Lnet/minecraft/class_2487;)Ljava/lang/String; COMMENT {@return the string representation of {@code compound} as used COMMENT by the NBT provider in the data generator} COMMENT COMMENT

The passed {@code compound} will be sorted and modified in-place COMMENT to make it more human-readable e.g. by converting {@link NbtCompound} COMMENT in the {@code palettes} {@code NbtList} to its short string COMMENT representation. Therefore the returned value is not an accurate COMMENT representation of the original NBT. COMMENT COMMENT @see net.minecraft.data.dev.NbtProvider COMMENT @see #fromNbtProviderString(String) ARG 0 compound METHOD method_32272 (Lnet/minecraft/class_2499;)I ARG 0 nbt METHOD method_32273 toNbtProviderFormat (Lnet/minecraft/class_2487;)Lnet/minecraft/class_2487; ARG 0 compound METHOD method_32274 (Lnet/minecraft/class_2499;)I ARG 0 nbt METHOD method_32275 fromNbtProviderFormat (Lnet/minecraft/class_2487;)Lnet/minecraft/class_2487; ARG 0 compound METHOD method_32276 (Lnet/minecraft/class_2499;)I ARG 0 nbt METHOD method_32277 toNbtProviderFormattedPalette (Lnet/minecraft/class_2487;)Ljava/lang/String; ARG 0 compound METHOD method_32278 (Lnet/minecraft/class_2487;)Lnet/minecraft/class_2499; ARG 0 nbt METHOD method_32279 (Lnet/minecraft/class_2487;)Lnet/minecraft/class_2499; ARG 0 nbt METHOD method_36114 appendIndent (ILjava/lang/StringBuilder;)Ljava/lang/StringBuilder; ARG 0 depth ARG 1 stringBuilder METHOD method_36115 fromFluidState (Lnet/minecraft/class_3610;)Lnet/minecraft/class_2487; COMMENT {@return the serialized fluid state} ARG 0 state METHOD method_36116 appendFormattedString (Ljava/lang/StringBuilder;Lnet/minecraft/class_2520;IZ)Ljava/lang/StringBuilder; ARG 0 stringBuilder ARG 1 nbt ARG 2 depth ARG 3 withArrayContents METHOD method_36117 toFormattedString (Lnet/minecraft/class_2520;Z)Ljava/lang/String; COMMENT {@return the human-readable, non-deserializable representation of {@code nbt}} ARG 0 nbt ARG 1 withArrayContents COMMENT whether to include contents of {@link NbtByteArray}, {@link NbtIntArray}, COMMENT and {@link NbtLongArray} METHOD method_36118 toFormattedString (Lnet/minecraft/class_2520;)Ljava/lang/String; COMMENT {@return the human-readable, non-deserializable representation of {@code nbt}} COMMENT COMMENT

This does not include contents of {@link NbtByteArray}, {@link NbtIntArray}, COMMENT and {@link NbtLongArray}. To include them, call COMMENT {@link #toFormattedString(NbtElement, boolean)} with {@code withArrayContents} COMMENT parameter set to true. COMMENT COMMENT @see #toFormattedString(NbtElement, boolean) ARG 0 nbt