Class MaterialQuantity

java.lang.Object
com.hypixel.hytale.server.core.inventory.MaterialQuantity
All Implemented Interfaces:
NetworkSerializable<MaterialQuantity>

public class MaterialQuantity extends Object implements NetworkSerializable<MaterialQuantity>
  • Field Details

  • Constructor Details

    • MaterialQuantity

      public MaterialQuantity(@Nullable String itemId, @Nullable String resourceTypeId, @Nullable String tag, int quantity, org.bson.BsonDocument metadata)
  • Method Details

    • getItemId

      @Nullable public String getItemId()
    • getResourceTypeId

      @Nullable public String getResourceTypeId()
    • getTagIndex

      public int getTagIndex()
    • getQuantity

      public int getQuantity()
    • getMetadata

      public org.bson.BsonDocument getMetadata()
    • clone

      @Nonnull public MaterialQuantity clone(int quantity)
    • withExcludedItemIds

      @Nonnull public MaterialQuantity withExcludedItemIds(@Nullable Set<String> excludedItemIds)
    • getExcludedItemIds

      @Nullable public Set<String> getExcludedItemIds()
    • isItemExcluded

      public boolean isItemExcluded(@Nullable String candidateItemId)
    • toItemStack

      @Nullable public ItemStack toItemStack()
    • toItemStacks

      @Nonnull public static List<ItemStack> toItemStacks(@Nonnull MaterialQuantity[] materials)
      Fetches the item stacks for the given materials, skipping any that reference no item.
      Parameters:
      materials - The materials to convert.
      Returns:
      the list of item stacks.
    • toResource

      @Nullable public ResourceQuantity toResource()
    • toPacket

      @Nonnull public MaterialQuantity toPacket()
      Specified by:
      toPacket in interface NetworkSerializable<MaterialQuantity>
    • equals

      public boolean equals(@Nullable Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      @Nonnull public String toString()
      Overrides:
      toString in class Object