Class VanillaInventoryCodeHooks

java.lang.Object
net.neoforged.neoforge.items.VanillaInventoryCodeHooks

public class VanillaInventoryCodeHooks extends Object
  • Constructor Details

    • VanillaInventoryCodeHooks

      public VanillaInventoryCodeHooks()
  • Method Details

    • extractHook

      @Nullable public static @Nullable Boolean extractHook(Level level, Hopper dest)
      Copied from TileEntityHopper#captureDroppedItems and added capability support
      Returns:
      Null if we did nothing {no IItemHandler}, True if we moved an item, False if we moved no items
    • dropperInsertHook

      public static boolean dropperInsertHook(Level level, BlockPos pos, DispenserBlockEntity dropper, int slot, ItemStack stack)
      Copied from BlockDropper#dispense and added capability support
    • insertHook

      public static boolean insertHook(HopperBlockEntity hopper)
      Copied from TileEntityHopper#transferItemsOut and added capability support
    • putStackInInventoryAllSlots

      private static ItemStack putStackInInventoryAllSlots(BlockEntity source, Object destination, IItemHandler destInventory, ItemStack stack)
    • insertStack

      private static ItemStack insertStack(BlockEntity source, Object destination, IItemHandler destInventory, ItemStack stack, int slot)
      Copied from TileEntityHopper#insertStack and added capability support
    • isFull

      private static boolean isFull(IItemHandler itemHandler)
    • isEmpty

      private static boolean isEmpty(IItemHandler itemHandler)
    • getAttachedItemHandler

      private static Optional<org.apache.commons.lang3.tuple.Pair<IItemHandler,Object>> getAttachedItemHandler(Level level, BlockPos pos, Direction direction)
    • getSourceItemHandler

      private static Optional<org.apache.commons.lang3.tuple.Pair<IItemHandler,Object>> getSourceItemHandler(Level level, Hopper hopper)
    • getItemHandlerAt

      private static Optional<org.apache.commons.lang3.tuple.Pair<IItemHandler,Object>> getItemHandlerAt(Level worldIn, double x, double y, double z, Direction side)