public final class NBTUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static java.util.Comparator<net.minecraft.nbt.NBTTagCompound> |
NBT_COMPARATOR
A Comparator used to compare NBTTagCompound.
|
| Modifier and Type | Method and Description |
|---|---|
static net.minecraft.nbt.NBTTagCompound |
getDeepTagCompound(net.minecraft.nbt.NBTTagCompound tag,
java.lang.String[] tags)
Provides a way to access an NBTTagCompound that is very deep within another
NBTTagCompound.
|
static net.minecraft.item.ItemStack[] |
getStoredItems(net.minecraft.nbt.NBTTagCompound tag,
int invSize)
Retrieves an array of ItemStack from an NBTTagCompound.
|
static net.minecraft.inventory.InventoryBasic |
readInventoryFromNBT(net.minecraft.nbt.NBTTagCompound tag,
net.minecraft.inventory.InventoryBasic inventory)
Reads an inventory from an NBTTagCompound.
|
static void |
setGenericNBTValue(net.minecraft.nbt.NBTTagCompound dataTag,
java.lang.String tagName,
java.lang.Object value)
Sets an unknown data type to an NBTTagCompound.
|
static net.minecraft.nbt.NBTTagCompound |
writeInventoryToNBT(net.minecraft.nbt.NBTTagCompound tag,
net.minecraft.inventory.InventoryBasic inventory)
Writes an inventory to an NBTTagCompound.
|
public static final java.util.Comparator<net.minecraft.nbt.NBTTagCompound> NBT_COMPARATOR
public static void setGenericNBTValue(net.minecraft.nbt.NBTTagCompound dataTag,
java.lang.String tagName,
java.lang.Object value)
dataTag: - An NBTTagCompound to write this unknown data to.tagName: - The name to save this unknown data under.value: - The unknown data you wish to write to the dataTag.public static net.minecraft.nbt.NBTTagCompound writeInventoryToNBT(net.minecraft.nbt.NBTTagCompound tag,
net.minecraft.inventory.InventoryBasic inventory)
tag: - The NBTTagCompound to write the inventory to.inventory: - The inventory to write to the NBTTagCompound.public static net.minecraft.inventory.InventoryBasic readInventoryFromNBT(net.minecraft.nbt.NBTTagCompound tag,
net.minecraft.inventory.InventoryBasic inventory)
tag: - The NBTTagCompound to read the inventory data from.inventory: - The inventory to set all of the inventory data to.public static net.minecraft.item.ItemStack[] getStoredItems(net.minecraft.nbt.NBTTagCompound tag,
int invSize)
tag: - The tag to retrieve all of the item data from.invSize: - The projected size of the inventory stored to the tag. It is critical
that this never be smaller then the actual amount.public static net.minecraft.nbt.NBTTagCompound getDeepTagCompound(net.minecraft.nbt.NBTTagCompound tag,
java.lang.String[] tags)
tag: - An NBTTagCompound to search through.tags: - An array containing the various steps to get to the desired deep
NBTTagCompound.