Package vazkii.botania.common.helper
Class ItemNBTHelper
java.lang.Object
vazkii.botania.common.helper.ItemNBTHelper
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic net.minecraft.world.item.ItemStackduplicateAndClearMana(net.minecraft.world.item.ItemStack stack) static @Nullable net.minecraft.nbt.TagDeprecated, for removal: This API element is subject to removal in a future version.static booleangetBoolean(net.minecraft.world.item.ItemStack stack, String tag, boolean defaultExpected) Deprecated, for removal: This API element is subject to removal in a future version.static byteDeprecated, for removal: This API element is subject to removal in a future version.static @Nullable net.minecraft.nbt.CompoundTaggetCompound(net.minecraft.world.item.ItemStack stack, String tag, boolean nullifyOnFail) Deprecated, for removal: This API element is subject to removal in a future version.static doubleDeprecated, for removal: This API element is subject to removal in a future version.static floatDeprecated, for removal: This API element is subject to removal in a future version.static intgetFullness(ManaItem item) Returns the fullness of the mana item: 0 if empty, 1 if partially full, 2 if full.static intDeprecated, for removal: This API element is subject to removal in a future version.static int[]getIntArray(net.minecraft.world.item.ItemStack stack, String tag) Deprecated, for removal: This API element is subject to removal in a future version.static @Nullable net.minecraft.nbt.ListTagDeprecated, for removal: This API element is subject to removal in a future version.static longDeprecated, for removal: This API element is subject to removal in a future version.static long[]getLongArray(net.minecraft.world.item.ItemStack stack, String tag) Deprecated, for removal: This API element is subject to removal in a future version.static shortDeprecated, for removal: This API element is subject to removal in a future version.static @Nullable StringDeprecated, for removal: This API element is subject to removal in a future version.static booleanmatchTagAndManaFullness(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2) Checks if two items are the same and have the same NBT.static voidremoveEntry(net.minecraft.world.item.ItemStack stack, String tag) Deprecated, for removal: This API element is subject to removal in a future version.static voidDeprecated, for removal: This API element is subject to removal in a future version.static com.google.gson.JsonObjectserializeStack(net.minecraft.world.item.ItemStack stack) Deprecated, for removal: This API element is subject to removal in a future version.static voidDeprecated, for removal: This API element is subject to removal in a future version.static voidsetBoolean(net.minecraft.world.item.ItemStack stack, String tag, boolean b) Deprecated, for removal: This API element is subject to removal in a future version.static voidDeprecated, for removal: This API element is subject to removal in a future version.static voidsetCompound(net.minecraft.world.item.ItemStack stack, String tag, net.minecraft.nbt.CompoundTag cmp) Deprecated, for removal: This API element is subject to removal in a future version.static voidDeprecated, for removal: This API element is subject to removal in a future version.static voidDeprecated, for removal: This API element is subject to removal in a future version.static voidDeprecated, for removal: This API element is subject to removal in a future version.static voidsetIntArray(net.minecraft.world.item.ItemStack stack, String tag, int[] val) Deprecated, for removal: This API element is subject to removal in a future version.static voidDeprecated, for removal: This API element is subject to removal in a future version.static voidDeprecated, for removal: This API element is subject to removal in a future version.static voidsetLongArray(net.minecraft.world.item.ItemStack stack, String tag, long[] val) Deprecated, for removal: This API element is subject to removal in a future version.static voidDeprecated, for removal: This API element is subject to removal in a future version.static voidDeprecated, for removal: This API element is subject to removal in a future version.static booleanverifyExistance(net.minecraft.world.item.ItemStack stack, String tag) Deprecated, for removal: This API element is subject to removal in a future version.static booleanverifyType(net.minecraft.world.item.ItemStack stack, String tag, Class<? extends net.minecraft.nbt.Tag> tagClass) Deprecated, for removal: This API element is subject to removal in a future version.
-
Constructor Details
-
ItemNBTHelper
public ItemNBTHelper()
-
-
Method Details
-
set
@Deprecated(forRemoval=true) public static void set(net.minecraft.world.item.ItemStack stack, String tag, net.minecraft.nbt.Tag nbt) Deprecated, for removal: This API element is subject to removal in a future version. -
setBoolean
@Deprecated(forRemoval=true) public static void setBoolean(net.minecraft.world.item.ItemStack stack, String tag, boolean b) Deprecated, for removal: This API element is subject to removal in a future version. -
setByte
@Deprecated(forRemoval=true) public static void setByte(net.minecraft.world.item.ItemStack stack, String tag, byte b) Deprecated, for removal: This API element is subject to removal in a future version. -
setShort
@Deprecated(forRemoval=true) public static void setShort(net.minecraft.world.item.ItemStack stack, String tag, short s) Deprecated, for removal: This API element is subject to removal in a future version. -
setInt
@Deprecated(forRemoval=true) public static void setInt(net.minecraft.world.item.ItemStack stack, String tag, int i) Deprecated, for removal: This API element is subject to removal in a future version. -
setIntArray
@Deprecated(forRemoval=true) public static void setIntArray(net.minecraft.world.item.ItemStack stack, String tag, int[] val) Deprecated, for removal: This API element is subject to removal in a future version. -
setLong
@Deprecated(forRemoval=true) public static void setLong(net.minecraft.world.item.ItemStack stack, String tag, long l) Deprecated, for removal: This API element is subject to removal in a future version. -
setLongArray
@Deprecated(forRemoval=true) public static void setLongArray(net.minecraft.world.item.ItemStack stack, String tag, long[] val) Deprecated, for removal: This API element is subject to removal in a future version. -
setFloat
@Deprecated(forRemoval=true) public static void setFloat(net.minecraft.world.item.ItemStack stack, String tag, float f) Deprecated, for removal: This API element is subject to removal in a future version. -
setDouble
@Deprecated(forRemoval=true) public static void setDouble(net.minecraft.world.item.ItemStack stack, String tag, double d) Deprecated, for removal: This API element is subject to removal in a future version. -
setCompound
@Deprecated(forRemoval=true) public static void setCompound(net.minecraft.world.item.ItemStack stack, String tag, net.minecraft.nbt.CompoundTag cmp) Deprecated, for removal: This API element is subject to removal in a future version. -
setString
@Deprecated(forRemoval=true) public static void setString(net.minecraft.world.item.ItemStack stack, String tag, String s) Deprecated, for removal: This API element is subject to removal in a future version. -
setList
@Deprecated(forRemoval=true) public static void setList(net.minecraft.world.item.ItemStack stack, String tag, net.minecraft.nbt.ListTag list) Deprecated, for removal: This API element is subject to removal in a future version. -
removeEntry
@Deprecated(forRemoval=true) public static void removeEntry(net.minecraft.world.item.ItemStack stack, String tag) Deprecated, for removal: This API element is subject to removal in a future version. -
verifyExistance
@Deprecated(forRemoval=true) public static boolean verifyExistance(net.minecraft.world.item.ItemStack stack, String tag) Deprecated, for removal: This API element is subject to removal in a future version. -
verifyType
@Deprecated(forRemoval=true) public static boolean verifyType(net.minecraft.world.item.ItemStack stack, String tag, Class<? extends net.minecraft.nbt.Tag> tagClass) Deprecated, for removal: This API element is subject to removal in a future version. -
get
@Deprecated(forRemoval=true) @Nullable public static @Nullable net.minecraft.nbt.Tag get(net.minecraft.world.item.ItemStack stack, String tag) Deprecated, for removal: This API element is subject to removal in a future version. -
getBoolean
@Deprecated(forRemoval=true) public static boolean getBoolean(net.minecraft.world.item.ItemStack stack, String tag, boolean defaultExpected) Deprecated, for removal: This API element is subject to removal in a future version. -
getByte
@Deprecated(forRemoval=true) public static byte getByte(net.minecraft.world.item.ItemStack stack, String tag, byte defaultExpected) Deprecated, for removal: This API element is subject to removal in a future version. -
getShort
@Deprecated(forRemoval=true) public static short getShort(net.minecraft.world.item.ItemStack stack, String tag, short defaultExpected) Deprecated, for removal: This API element is subject to removal in a future version. -
getInt
@Deprecated(forRemoval=true) public static int getInt(net.minecraft.world.item.ItemStack stack, String tag, int defaultExpected) Deprecated, for removal: This API element is subject to removal in a future version. -
getIntArray
@Deprecated(forRemoval=true) public static int[] getIntArray(net.minecraft.world.item.ItemStack stack, String tag) Deprecated, for removal: This API element is subject to removal in a future version. -
getLong
@Deprecated(forRemoval=true) public static long getLong(net.minecraft.world.item.ItemStack stack, String tag, long defaultExpected) Deprecated, for removal: This API element is subject to removal in a future version. -
getLongArray
@Deprecated(forRemoval=true) public static long[] getLongArray(net.minecraft.world.item.ItemStack stack, String tag) Deprecated, for removal: This API element is subject to removal in a future version. -
getFloat
@Deprecated(forRemoval=true) public static float getFloat(net.minecraft.world.item.ItemStack stack, String tag, float defaultExpected) Deprecated, for removal: This API element is subject to removal in a future version. -
getDouble
@Deprecated(forRemoval=true) public static double getDouble(net.minecraft.world.item.ItemStack stack, String tag, double defaultExpected) Deprecated, for removal: This API element is subject to removal in a future version. -
getCompound
@Deprecated(forRemoval=true) @Nullable @Contract("_, _, false -> !null") public static @Nullable net.minecraft.nbt.CompoundTag getCompound(net.minecraft.world.item.ItemStack stack, String tag, boolean nullifyOnFail) Deprecated, for removal: This API element is subject to removal in a future version.If nullifyOnFail is true it'll return null if it doesn't find any compounds, otherwise it'll return a new one. -
getString
@Deprecated(forRemoval=true) @Nullable @Contract("_, _, !null -> !null") public static @Nullable String getString(net.minecraft.world.item.ItemStack stack, String tag, String defaultExpected) Deprecated, for removal: This API element is subject to removal in a future version. -
getList
@Deprecated(forRemoval=true) @Nullable @Contract("_, _, _, false -> !null") public static @Nullable net.minecraft.nbt.ListTag getList(net.minecraft.world.item.ItemStack stack, String tag, int objtype, boolean nullifyOnFail) Deprecated, for removal: This API element is subject to removal in a future version. -
getFullness
Returns the fullness of the mana item: 0 if empty, 1 if partially full, 2 if full. -
duplicateAndClearMana
public static net.minecraft.world.item.ItemStack duplicateAndClearMana(net.minecraft.world.item.ItemStack stack) -
matchTagAndManaFullness
public static boolean matchTagAndManaFullness(net.minecraft.world.item.ItemStack stack1, net.minecraft.world.item.ItemStack stack2) Checks if two items are the same and have the same NBT. If they are `IManaItems`, their mana property is matched on whether they are empty, partially full, or full. -
serializeStack
@Deprecated(forRemoval=true) public static com.google.gson.JsonObject serializeStack(net.minecraft.world.item.ItemStack stack) Deprecated, for removal: This API element is subject to removal in a future version.Serializes the given stack such thatRecipe.CODECwould be able to read the result back TODO: probably not required anymore -
renameTag
@Deprecated(forRemoval=true) public static void renameTag(net.minecraft.nbt.CompoundTag nbt, String oldName, String newName) Deprecated, for removal: This API element is subject to removal in a future version.
-