Class HolderBuilder<T extends StackHolder<T>>

java.lang.Object
net.ntrdeal.realapi.item.stack_holder.HolderBuilder<T>
All Implemented Interfaces:
net.minecraft.world.inventory.tooltip.TooltipComponent, DataKeyMap, StackHolder<T>

public class HolderBuilder<T extends StackHolder<T>> extends Object implements StackHolder<T>, DataKeyMap
  • Field Details

    • holder

      public final T extends StackHolder<T> holder
    • stacks

      public final List<net.minecraft.world.item.ItemStack> stacks
    • weight

      public org.apache.commons.lang3.math.Fraction weight
  • Constructor Details

    • HolderBuilder

      public HolderBuilder(T holder)
  • Method Details

    • stacks

      public List<net.minecraft.world.item.ItemStackTemplate> stacks()
      Specified by:
      stacks in interface StackHolder<T extends StackHolder<T>>
    • weightSupplier

      public Supplier<com.mojang.serialization.DataResult<org.apache.commons.lang3.math.Fraction>> weightSupplier()
      Specified by:
      weightSupplier in interface StackHolder<T extends StackHolder<T>>
    • scale

      public org.apache.commons.lang3.math.Fraction scale()
      Specified by:
      scale in interface StackHolder<T extends StackHolder<T>>
    • maxStackSize

      public int maxStackSize(net.minecraft.world.item.ItemInstance instance)
      Specified by:
      maxStackSize in interface StackHolder<T extends StackHolder<T>>
    • canInsert

      public boolean canInsert(net.minecraft.world.item.ItemStack stack)
      Specified by:
      canInsert in interface StackHolder<T extends StackHolder<T>>
    • stackStream

      public Stream<net.minecraft.world.item.ItemStack> stackStream()
      Specified by:
      stackStream in interface StackHolder<T extends StackHolder<T>>
    • size

      public int size()
      Specified by:
      size in interface StackHolder<T extends StackHolder<T>>
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface StackHolder<T extends StackHolder<T>>
    • index

      public int index()
      Specified by:
      index in interface StackHolder<T extends StackHolder<T>>
    • getSelectedItem

      public @Nullable net.minecraft.world.item.ItemStackTemplate getSelectedItem()
      Specified by:
      getSelectedItem in interface StackHolder<T extends StackHolder<T>>
    • getNumberOfItemsToShow

      public int getNumberOfItemsToShow()
      Specified by:
      getNumberOfItemsToShow in interface StackHolder<T extends StackHolder<T>>
    • weight

      public com.mojang.serialization.DataResult<org.apache.commons.lang3.math.Fraction> weight()
      Specified by:
      weight in interface StackHolder<T extends StackHolder<T>>
    • builder

      public HolderBuilder<T> builder()
      Specified by:
      builder in interface StackHolder<T extends StackHolder<T>>
    • overrideWeight

      public @Nullable com.mojang.serialization.DataResult<org.apache.commons.lang3.math.Fraction> overrideWeight(net.minecraft.world.item.ItemInstance instance)
      Specified by:
      overrideWeight in interface StackHolder<T extends StackHolder<T>>
    • getPerWeight

      public com.mojang.serialization.DataResult<org.apache.commons.lang3.math.Fraction> getPerWeight(net.minecraft.world.item.ItemInstance instance)
      Specified by:
      getPerWeight in interface StackHolder<T extends StackHolder<T>>
    • getWeight

      public com.mojang.serialization.DataResult<org.apache.commons.lang3.math.Fraction> getWeight(net.minecraft.world.item.ItemInstance instance)
      Specified by:
      getWeight in interface StackHolder<T extends StackHolder<T>>
    • dataMap

      public Map<DataKey<?>, Object> dataMap()
      Specified by:
      dataMap in interface DataKeyMap
    • getMaxAmount

      public int getMaxAmount(org.apache.commons.lang3.math.Fraction weight)
    • addWeight

      public void addWeight(org.apache.commons.lang3.math.Fraction weight, int count)
    • subtractWeight

      public void subtractWeight(org.apache.commons.lang3.math.Fraction weight, int count)
    • tryAdd

      public net.minecraft.world.item.ItemStack tryAdd(net.minecraft.world.item.ItemStack addingStack)
    • add

      public net.minecraft.world.item.ItemStack add(net.minecraft.world.item.ItemStack addingStack, boolean bypassChecks, boolean topDown, boolean addFirst)
    • trySlotAdd

      public net.minecraft.world.item.ItemStack trySlotAdd(net.minecraft.world.entity.player.Player player, net.minecraft.world.inventory.Slot slot)
    • removeStack

      public net.minecraft.world.item.ItemStack removeStack(int index, int count)
    • insertStack

      public int insertStack(net.minecraft.world.item.ItemStack stack, int index, int count)
    • removeStack

      public net.minecraft.world.item.ItemStack removeStack(int index)
    • removeSelectedStack

      public net.minecraft.world.item.ItemStack removeSelectedStack(int count)
    • removeSelectedStack

      public net.minecraft.world.item.ItemStack removeSelectedStack()
    • addAll

      public List<net.minecraft.world.item.ItemStack> addAll(List<net.minecraft.world.item.ItemStack> stacks, Consumer<net.minecraft.world.item.ItemStack> consumer)
    • isIndexAllowed

      public boolean isIndexAllowed(int index)
    • setIndex

      public void setIndex(int index)
    • templates

      public List<net.minecraft.world.item.ItemStackTemplate> templates()
    • build

      public T build()
    • build

      public T build(HolderBuilder<T> builder)
      Specified by:
      build in interface StackHolder<T extends StackHolder<T>>