Class MountedItemStorageWrapper

java.lang.Object
net.neoforged.neoforge.items.wrapper.CombinedInvWrapper
com.simibubi.create.api.contraption.storage.item.MountedItemStorageWrapper
All Implemented Interfaces:
net.neoforged.neoforge.items.IItemHandler, net.neoforged.neoforge.items.IItemHandlerModifiable

public class MountedItemStorageWrapper extends net.neoforged.neoforge.items.wrapper.CombinedInvWrapper
Wrapper around many MountedItemStorages, providing access to all of them as one storage. They can still be accessed individually through the map. Uses O(1) lookup arrays instead of O(n) linear scan.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final com.google.common.collect.ImmutableMap<net.minecraft.core.BlockPos,MountedItemStorage>
     

    Fields inherited from class net.neoforged.neoforge.items.wrapper.CombinedInvWrapper

    baseIndex, itemHandler, slotCount
  • Constructor Summary

    Constructors
    Constructor
    Description
    MountedItemStorageWrapper(com.google.common.collect.ImmutableMap<net.minecraft.core.BlockPos,MountedItemStorage> storages)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected int
    getIndexForSlot(int slot)
     
    protected int
    getSlotFromIndex(int slot, int index)
     

    Methods inherited from class net.neoforged.neoforge.items.wrapper.CombinedInvWrapper

    extractItem, getHandlerFromIndex, getSlotLimit, getSlots, getStackInSlot, insertItem, isItemValid, setStackInSlot

    Methods inherited from class java.lang.Object

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

    • storages

      public final com.google.common.collect.ImmutableMap<net.minecraft.core.BlockPos,MountedItemStorage> storages
  • Constructor Details

    • MountedItemStorageWrapper

      public MountedItemStorageWrapper(com.google.common.collect.ImmutableMap<net.minecraft.core.BlockPos,MountedItemStorage> storages)
  • Method Details

    • getIndexForSlot

      protected int getIndexForSlot(int slot)
      Overrides:
      getIndexForSlot in class net.neoforged.neoforge.items.wrapper.CombinedInvWrapper
    • getSlotFromIndex

      protected int getSlotFromIndex(int slot, int index)
      Overrides:
      getSlotFromIndex in class net.neoforged.neoforge.items.wrapper.CombinedInvWrapper