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>
-
Field Summary
Fields inherited from interface com.refinedmods.refinedstorage.api.storage.IStorage
COMPARATOR -
Constructor Summary
ConstructorsConstructorDescriptionItemDriveWrapperStorageDisk(DiskDriveNetworkNode diskDrive, IStorageDisk<net.minecraft.world.item.ItemStack> parent) -
Method Summary
Modifier and TypeMethodDescriptionnet.minecraft.world.item.ItemStackExtracts a stack from this storage.intgetCacheDelta(int storedPreInsertion, int size, net.minecraft.world.item.ItemStack remainder) Returns the delta that needs to be added to the item or fluid storage cache AFTER insertion of the stack.intnet.minecraft.resources.ResourceLocationgetOwner()intCollection<net.minecraft.world.item.ItemStack>Returns the stacks of the storage.intnet.minecraft.world.item.ItemStackInserts a stack to this storage.voidsetSettings(IStorageDiskListener listener, IStorageDiskContainerContext context) 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.net.minecraft.nbt.CompoundTagWrites the storage to NBT.
-
Constructor Details
-
ItemDriveWrapperStorageDisk
public ItemDriveWrapperStorageDisk(DiskDriveNetworkNode diskDrive, IStorageDisk<net.minecraft.world.item.ItemStack> parent)
-
-
Method Details
-
getPriority
public int getPriority()- Specified by:
getPriorityin interfaceIStorage<net.minecraft.world.item.ItemStack>- Returns:
- the priority of this storage
-
getAccessType
- Specified by:
getAccessTypein interfaceIStorage<net.minecraft.world.item.ItemStack>- Returns:
- the access type of this storage
-
getStacks
Description copied from interface:IStorageReturns 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! -
insert
@Nonnull public net.minecraft.world.item.ItemStack insert(@Nonnull net.minecraft.world.item.ItemStack stack, int size, Action action) Description copied from interface:IStorageInserts a stack to this storage.- Specified by:
insertin interfaceIStorage<net.minecraft.world.item.ItemStack>- Parameters:
stack- the stack prototype to insert, can be empty, do NOT modifysize- the amount of that prototype that has to be insertedaction- 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:IStorageExtracts 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:
extractin interfaceIStorage<net.minecraft.world.item.ItemStack>- Parameters:
stack- a prototype of the stack to extract, can be empty, do NOT modifysize- the amount of that prototype that has to be extractedflags- the flags to compare on, seeICompareraction- the action- Returns:
- an empty stack if nothing was extracted, or an extracted stack
-
getStored
public int getStored() -
getCacheDelta
public int getCacheDelta(int storedPreInsertion, int size, @Nullable net.minecraft.world.item.ItemStack remainder) Description copied from interface:IStorageReturns the delta that needs to be added to the item or fluid storage cache AFTER insertion of the stack.- Specified by:
getCacheDeltain interfaceIStorage<net.minecraft.world.item.ItemStack>- Parameters:
storedPreInsertion- the amount stored pre insertionsize- the size of the stack being insertedremainder- 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:
getCapacityin interfaceIStorageDisk<net.minecraft.world.item.ItemStack>- Returns:
- the capacity of this storage disk
-
getOwner
- Specified by:
getOwnerin interfaceIStorageDisk<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:IStorageDiskWhen 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:
setSettingsin interfaceIStorageDisk<net.minecraft.world.item.ItemStack>- Parameters:
listener- the listener to be called when the storage changes, or null for no listenercontext- the container context, containing some settings
-
writeToNbt
public net.minecraft.nbt.CompoundTag writeToNbt()Description copied from interface:IStorageDiskWrites the storage to NBT.- Specified by:
writeToNbtin interfaceIStorageDisk<net.minecraft.world.item.ItemStack>
-
getFactoryId
public net.minecraft.resources.ResourceLocation getFactoryId()- Specified by:
getFactoryIdin interfaceIStorageDisk<net.minecraft.world.item.ItemStack>- Returns:
- the factory id as registered in
IStorageDiskRegistry
-