Class BundleContents

java.lang.Object
net.minecraft.world.item.component.BundleContents
All Implemented Interfaces:
TooltipComponent

public final class BundleContents extends Object implements TooltipComponent
  • Field Details

    • EMPTY

      public static final BundleContents EMPTY
    • CODEC

      public static final com.mojang.serialization.Codec<BundleContents> CODEC
    • STREAM_CODEC

      public static final StreamCodec<RegistryFriendlyByteBuf,BundleContents> STREAM_CODEC
    • BUNDLE_IN_BUNDLE_WEIGHT

      private static final org.apache.commons.lang3.math.Fraction BUNDLE_IN_BUNDLE_WEIGHT
    • NO_STACK_INDEX

      private static final int NO_STACK_INDEX
      See Also:
    • NO_SELECTED_ITEM_INDEX

      public static final int NO_SELECTED_ITEM_INDEX
      See Also:
    • items

      final List<ItemStack> items
    • weight

      final org.apache.commons.lang3.math.Fraction weight
    • selectedItem

      final int selectedItem
  • Constructor Details

    • BundleContents

      BundleContents(List<ItemStack> p_331277_, org.apache.commons.lang3.math.Fraction p_339622_, int p_361490_)
    • BundleContents

      public BundleContents(List<ItemStack> p_331417_)
  • Method Details

    • checkAndCreate

      private static com.mojang.serialization.DataResult<BundleContents> checkAndCreate(List<ItemStack> p_381706_)
    • computeContentWeight

      private static org.apache.commons.lang3.math.Fraction computeContentWeight(List<ItemStack> p_331148_)
    • getWeight

      static org.apache.commons.lang3.math.Fraction getWeight(ItemStack p_332084_)
    • canItemBeInBundle

      public static boolean canItemBeInBundle(ItemStack p_362945_)
    • getNumberOfItemsToShow

      public int getNumberOfItemsToShow()
    • getItemUnsafe

      public ItemStack getItemUnsafe(int p_330802_)
    • itemCopyStream

      public Stream<ItemStack> itemCopyStream()
    • items

      public Iterable<ItemStack> items()
    • itemsCopy

      public Iterable<ItemStack> itemsCopy()
    • size

      public int size()
    • weight

      public org.apache.commons.lang3.math.Fraction weight()
    • isEmpty

      public boolean isEmpty()
    • getSelectedItem

      public int getSelectedItem()
    • hasSelectedItem

      public boolean hasSelectedItem()
    • equals

      public boolean equals(Object p_331898_)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object