Class ItemDriveWrapperStorageDisk

java.lang.Object
com.refinedmods.refinedstorage.apiimpl.network.node.diskdrive.ItemDriveWrapperStorageDisk
All Implemented Interfaces:
IStorageDisk<net.minecraft.world.item.ItemStack>, IStorage<net.minecraft.world.item.ItemStack>

public class ItemDriveWrapperStorageDisk extends Object implements IStorageDisk<net.minecraft.world.item.ItemStack>
  • Constructor Details

  • Method Details

    • getPriority

      public int getPriority()
      Specified by:
      getPriority in interface IStorage<net.minecraft.world.item.ItemStack>
      Returns:
      the priority of this storage
    • getAccessType

      public AccessType getAccessType()
      Specified by:
      getAccessType in interface IStorage<net.minecraft.world.item.ItemStack>
      Returns:
      the access type of this storage
    • getStacks

      public Collection<net.minecraft.world.item.ItemStack> getStacks()
      Description copied from interface: IStorage
      Returns the stacks of the storage. Empty stacks are allowed. Please do not copy the stacks for performance reasons. For the caller: modifying stacks is not allowed!
      Specified by:
      getStacks in interface IStorage<net.minecraft.world.item.ItemStack>
      Returns:
      stacks stored in this storage, empty stacks are allowed
    • insert

      @Nonnull public net.minecraft.world.item.ItemStack insert(@Nonnull net.minecraft.world.item.ItemStack stack, int size, Action action)
      Description copied from interface: IStorage
      Inserts a stack to this storage.
      Specified by:
      insert in interface IStorage<net.minecraft.world.item.ItemStack>
      Parameters:
      stack - the stack prototype to insert, can be empty, do NOT modify
      size - the amount of that prototype that has to be inserted
      action - the action
      Returns:
      an empty stack if the insert was successful, or a stack with the remainder
    • extract

      @Nonnull public net.minecraft.world.item.ItemStack extract(@Nonnull net.minecraft.world.item.ItemStack stack, int size, int flags, Action action)
      Description copied from interface: IStorage
      Extracts a stack from this storage.

      If the stack we found in the system is smaller than the requested size, return that stack anyway.

      Specified by:
      extract in interface IStorage<net.minecraft.world.item.ItemStack>
      Parameters:
      stack - a prototype of the stack to extract, can be empty, do NOT modify
      size - the amount of that prototype that has to be extracted
      flags - the flags to compare on, see IComparer
      action - the action
      Returns:
      an empty stack if nothing was extracted, or an extracted stack
    • getStored

      public int getStored()
      Specified by:
      getStored in interface IStorage<net.minecraft.world.item.ItemStack>
      Returns:
      the amount stored in this storage
    • getCacheDelta

      public int getCacheDelta(int storedPreInsertion, int size, @Nullable net.minecraft.world.item.ItemStack remainder)
      Description copied from interface: IStorage
      Returns the delta that needs to be added to the item or fluid storage cache AFTER insertion of the stack.
      Specified by:
      getCacheDelta in interface IStorage<net.minecraft.world.item.ItemStack>
      Parameters:
      storedPreInsertion - the amount stored pre insertion
      size - the size of the stack being inserted
      remainder - the remainder that we got back, or null if no remainder was there
      Returns:
      the amount to increase the cache with
    • getCapacity

      public int getCapacity()
      Specified by:
      getCapacity in interface IStorageDisk<net.minecraft.world.item.ItemStack>
      Returns:
      the capacity of this storage disk
    • getOwner

      @Nullable public UUID getOwner()
      Specified by:
      getOwner in interface IStorageDisk<net.minecraft.world.item.ItemStack>
      Returns:
      the id of the owner, or null if not present
    • setSettings

      public void setSettings(@Nullable IStorageDiskListener listener, IStorageDiskContainerContext context)
      Description copied from interface: IStorageDisk
      When this storage disk is inserted into a storage disk container, it has to adjust to the container's settings and use the following parameters instead.
      Specified by:
      setSettings in interface IStorageDisk<net.minecraft.world.item.ItemStack>
      Parameters:
      listener - the listener to be called when the storage changes, or null for no listener
      context - the container context, containing some settings
    • writeToNbt

      public net.minecraft.nbt.CompoundTag writeToNbt()
      Description copied from interface: IStorageDisk
      Writes the storage to NBT.
      Specified by:
      writeToNbt in interface IStorageDisk<net.minecraft.world.item.ItemStack>
    • getFactoryId

      public net.minecraft.resources.ResourceLocation getFactoryId()
      Specified by:
      getFactoryId in interface IStorageDisk<net.minecraft.world.item.ItemStack>
      Returns:
      the factory id as registered in IStorageDiskRegistry