Class ItemCapabilities

java.lang.Object
org.moddingx.libx.capability.ItemCapabilities

public class ItemCapabilities extends Object
  • Constructor Details

    • ItemCapabilities

      public ItemCapabilities()
  • Method Details

    • create

      public static net.minecraftforge.common.util.LazyOptional<IAdvancedItemHandlerModifiable> create(net.minecraftforge.items.IItemHandlerModifiable handler)
      Creates a new LazyOptional for an IItemHandlerModifiable.
    • create

      public static net.minecraftforge.common.util.LazyOptional<IAdvancedItemHandlerModifiable> create(net.minecraftforge.items.IItemHandlerModifiable handler, @Nullable Predicate<Integer> extract, @Nullable BiPredicate<Integer,net.minecraft.world.item.ItemStack> insert)
      Creates a new LazyOptional for an IItemHandlerModifiable.
      Parameters:
      extract - A predicate on whether an item can be extracted through this LazyOptional. This gets passed the slot to extract from.
      insert - A predicate on whether an item can be inserted through this LazyOptional. This gets passed the slot to insert to and the stack that should be inserted..
    • create

      public static net.minecraftforge.common.util.LazyOptional<IAdvancedItemHandlerModifiable> create(Supplier<net.minecraftforge.items.IItemHandlerModifiable> handler)
      Creates a new LazyOptional for an IItemHandlerModifiable.
    • create

      public static net.minecraftforge.common.util.LazyOptional<IAdvancedItemHandlerModifiable> create(Supplier<net.minecraftforge.items.IItemHandlerModifiable> handler, @Nullable Predicate<Integer> extract, @Nullable BiPredicate<Integer,net.minecraft.world.item.ItemStack> insert)
      Creates a new LazyOptional for an IItemHandlerModifiable.
      Parameters:
      extract - A predicate on whether an item can be extracted through this LazyOptional. This gets passed the slot to extract from.
      insert - A predicate on whether an item can be inserted through this LazyOptional. This gets passed the slot to insert to and the stack that should be inserted..