Class SerializedItemStackPlainNBT

java.lang.Object
sawfowl.localeapi.api.serializetools.itemstack.SerializedItemStackPlainNBT
All Implemented Interfaces:
CompoundTag

@ConfigSerializable public class SerializedItemStackPlainNBT extends Object implements CompoundTag
The class is intended for working with item data when it is necessary to access it before registering item data in the registry.
  • Constructor Details

    • SerializedItemStackPlainNBT

      public SerializedItemStackPlainNBT(ItemStack itemStack)
    • SerializedItemStackPlainNBT

      public SerializedItemStackPlainNBT(BlockState block)
    • SerializedItemStackPlainNBT

      public SerializedItemStackPlainNBT(BlockSnapshot block)
    • SerializedItemStackPlainNBT

      public SerializedItemStackPlainNBT(String type, int quantity, String nbt)
  • Method Details

    • getItemTypeAsString

      public String getItemTypeAsString()
    • getQuantity

      public Integer getQuantity()
      Getting ItemStack volume.
    • getNBT

      public String getNBT()
      Get all tags as a string.
    • getItemStack

      public ItemStack getItemStack()
      Getting ItemStack
    • getItemType

      public Optional<ItemType> getItemType()
      Getting ItemType
    • getItemKey

      public net.kyori.adventure.key.Key getItemKey()
      The resulting value can be used to display the item in chat.
    • getOrCreateTag

      public TagUtil.Advanced getOrCreateTag()
      Gaining access to the NBT tags of an item.
    • setQuantity

      public void setQuantity(int quantity)
      Changing ItemStack volume.
    • toSerializedItemStackJsonNbt

      public SerializedItemStackJsonNbt toSerializedItemStackJsonNbt()
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • equalsWhithoutQuantity

      public boolean equalsWhithoutQuantity(SerializedItemStackPlainNBT itemStack)
    • equalsWhithoutNBT

      public boolean equalsWhithoutNBT(SerializedItemStackPlainNBT itemStack)
    • equalsToItemStack

      public boolean equalsToItemStack(ItemStack itemStack)
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • toJsonObject

      public com.google.gson.JsonObject toJsonObject()
      Description copied from interface: CompoundTag
      Convert class objects to json data array.
      It is recommended not to do `return null`.
      Specified by:
      toJsonObject in interface CompoundTag