Class AbstractItemBasedAttribute

java.lang.Object
alexiil.mc.lib.attributes.misc.AbstractItemBasedAttribute
Direct Known Subclasses:
FixedInvEmiItemInv, ItemBasedSingleFluidInv

public abstract class AbstractItemBasedAttribute
extends java.lang.Object
Skeleton class for use when exposing an attribute (like a fluid inventory) from an item that is contained in a reference.
  • Field Summary

    Fields 
    Modifier and Type Field Description
    protected LimitedConsumer<net.minecraft.item.ItemStack> excessStacks  
    protected Reference<net.minecraft.item.ItemStack> stackRef  
  • Constructor Summary

    Constructors 
    Modifier Constructor Description
    protected AbstractItemBasedAttribute​(Reference<net.minecraft.item.ItemStack> stackRef, LimitedConsumer<net.minecraft.item.ItemStack> excessStacks)  
  • Method Summary

    Modifier and Type Method Description
    boolean setStacks​(Simulation simulation, net.minecraft.item.ItemStack oldStack, net.minecraft.item.ItemStack newStack)
    Attempts to place the stacks in the reference and excess.
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

  • Method Details

    • setStacks

      public boolean setStacks​(Simulation simulation, net.minecraft.item.ItemStack oldStack, net.minecraft.item.ItemStack newStack)
      Attempts to place the stacks in the reference and excess.
      Parameters:
      oldStack - A copied stack from stackRef, but decreased by 1.
      newStack - The modified stack that was split off from stackRef.
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object