java.lang.Object
com.refinedmods.refinedstorage.apiimpl.API
All Implemented Interfaces:
IRSAPI

public class API extends Object implements IRSAPI
  • Constructor Details

    • API

      public API()
  • Method Details

    • instance

      public static IRSAPI instance()
    • deliver

      public static void deliver()
    • getComparer

      @Nonnull public IComparer getComparer()
      Specified by:
      getComparer in interface IRSAPI
      Returns:
      the comparer
    • getQuantityFormatter

      @Nonnull public IQuantityFormatter getQuantityFormatter()
      Specified by:
      getQuantityFormatter in interface IRSAPI
      Returns:
      the quantity formatter
    • getNetworkNodeRegistry

      @Nonnull public INetworkNodeRegistry getNetworkNodeRegistry()
      Specified by:
      getNetworkNodeRegistry in interface IRSAPI
      Returns:
      the network node factory
    • getNetworkNodeManager

      public INetworkNodeManager getNetworkNodeManager(net.minecraft.server.level.ServerLevel level)
      Description copied from interface: IRSAPI
      Gets a network node manager for a given level.
      Specified by:
      getNetworkNodeManager in interface IRSAPI
      Parameters:
      level - level
      Returns:
      the network node manager for a given level
    • getNetworkManager

      public INetworkManager getNetworkManager(net.minecraft.server.level.ServerLevel level)
      Description copied from interface: IRSAPI
      Gets a network manager for a given level.
      Specified by:
      getNetworkManager in interface IRSAPI
      Parameters:
      level - level
      Returns:
      the network manager for a given level
    • getCraftingTaskRegistry

      @Nonnull public ICraftingTaskRegistry getCraftingTaskRegistry()
      Specified by:
      getCraftingTaskRegistry in interface IRSAPI
      Returns:
      the crafting task registry
    • getCraftingMonitorElementRegistry

      @Nonnull public ICraftingMonitorElementRegistry getCraftingMonitorElementRegistry()
      Specified by:
      getCraftingMonitorElementRegistry in interface IRSAPI
      Returns:
      the crafting monitor element registry
    • getCraftingPreviewElementRegistry

      @Nonnull public ICraftingPreviewElementRegistry getCraftingPreviewElementRegistry()
      Specified by:
      getCraftingPreviewElementRegistry in interface IRSAPI
      Returns:
      the crafting preview element registry
    • createItemStackList

      @Nonnull public IStackList<net.minecraft.world.item.ItemStack> createItemStackList()
      Specified by:
      createItemStackList in interface IRSAPI
      Returns:
      an empty item stack list
    • createFluidStackList

      @Nonnull public IStackList<net.neoforged.neoforge.fluids.FluidStack> createFluidStackList()
      Specified by:
      createFluidStackList in interface IRSAPI
      Returns:
      an empty fluid stack list
    • createCraftingMonitorElementList

      @Nonnull public ICraftingMonitorElementList createCraftingMonitorElementList()
      Specified by:
      createCraftingMonitorElementList in interface IRSAPI
      Returns:
      an empty crafting monitor element list
    • getGridManager

      @Nonnull public IGridManager getGridManager()
      Specified by:
      getGridManager in interface IRSAPI
      Returns:
      the grid manager
    • getCraftingGridBehavior

      @Nonnull public ICraftingGridBehavior getCraftingGridBehavior()
      Specified by:
      getCraftingGridBehavior in interface IRSAPI
      Returns:
      the default crafting grid behavior
    • getStorageDiskRegistry

      @Nonnull public IStorageDiskRegistry getStorageDiskRegistry()
      Specified by:
      getStorageDiskRegistry in interface IRSAPI
      Returns:
      the storage disk registry
    • getStorageDiskManager

      @Nonnull public IStorageDiskManager getStorageDiskManager(net.minecraft.server.level.ServerLevel level)
      Specified by:
      getStorageDiskManager in interface IRSAPI
      Parameters:
      level - any level associated with the server
      Returns:
      the storage disk manager
    • getStorageDiskSync

      @Nonnull public IStorageDiskSync getStorageDiskSync()
      Specified by:
      getStorageDiskSync in interface IRSAPI
      Returns:
      the storage disk sync manager
    • getStorageTrackerManager

      @Nonnull public IStorageTrackerManager getStorageTrackerManager(net.minecraft.server.level.ServerLevel level)
      Specified by:
      getStorageTrackerManager in interface IRSAPI
      Returns:
      the storage tracker manager
    • addExternalStorageProvider

      public void addExternalStorageProvider(StorageType type, IExternalStorageProvider<?> provider)
      Description copied from interface: IRSAPI
      Adds an external storage provider for the given storage type.
      Specified by:
      addExternalStorageProvider in interface IRSAPI
      Parameters:
      type - the storage type
      provider - the external storage provider
    • getExternalStorageProviders

      public Set<IExternalStorageProvider<?>> getExternalStorageProviders(StorageType type)
      Specified by:
      getExternalStorageProviders in interface IRSAPI
      Parameters:
      type - the type
      Returns:
      a set of external storage providers
    • createDefaultItemDisk

      @Nonnull public IStorageDisk<net.minecraft.world.item.ItemStack> createDefaultItemDisk(net.minecraft.server.level.ServerLevel level, int capacity, @Nullable net.minecraft.world.entity.player.Player owner)
      Specified by:
      createDefaultItemDisk in interface IRSAPI
      Parameters:
      level - the level
      capacity - the capacity
      owner - the owner or null if no owner
      Returns:
      a storage disk
    • createDefaultFluidDisk

      @Nonnull public IStorageDisk<net.neoforged.neoforge.fluids.FluidStack> createDefaultFluidDisk(net.minecraft.server.level.ServerLevel level, int capacity, @Nullable net.minecraft.world.entity.player.Player owner)
      Specified by:
      createDefaultFluidDisk in interface IRSAPI
      Parameters:
      level - the level
      capacity - the capacity in mB
      owner - the owner or null if no owner
      Returns:
      a fluid storage disk
    • createCraftingRequestInfo

      public ICraftingRequestInfo createCraftingRequestInfo(net.minecraft.world.item.ItemStack stack, int count)
      Description copied from interface: IRSAPI
      Creates crafting request info for an item.
      Specified by:
      createCraftingRequestInfo in interface IRSAPI
      Parameters:
      stack - the stack
      count - the count
      Returns:
      the request info
    • createCraftingRequestInfo

      public ICraftingRequestInfo createCraftingRequestInfo(net.neoforged.neoforge.fluids.FluidStack stack, int count)
      Description copied from interface: IRSAPI
      Creates crafting request info for a fluid.
      Specified by:
      createCraftingRequestInfo in interface IRSAPI
      Parameters:
      stack - the stack
      count - the count
      Returns:
      the request info
    • createCraftingRequestInfo

      public ICraftingRequestInfo createCraftingRequestInfo(net.minecraft.nbt.CompoundTag tag) throws CraftingTaskReadException
      Description copied from interface: IRSAPI
      Creates crafting request info from NBT.
      Specified by:
      createCraftingRequestInfo in interface IRSAPI
      Parameters:
      tag - the nbt tag
      Returns:
      the request info
      Throws:
      CraftingTaskReadException
    • addPatternRenderHandler

      public void addPatternRenderHandler(ICraftingPatternRenderHandler renderHandler)
      Specified by:
      addPatternRenderHandler in interface IRSAPI
      Parameters:
      renderHandler - the render handler to add
    • getPatternRenderHandlers

      public List<ICraftingPatternRenderHandler> getPatternRenderHandlers()
      Specified by:
      getPatternRenderHandlers in interface IRSAPI
      Returns:
      a list of pattern render handlers
    • getItemStackHashCode

      public int getItemStackHashCode(net.minecraft.world.item.ItemStack stack)
      Specified by:
      getItemStackHashCode in interface IRSAPI
      Parameters:
      stack - the stack
      Returns:
      a hashcode for the given stack
    • getFluidStackHashCode

      public int getFluidStackHashCode(net.neoforged.neoforge.fluids.FluidStack stack)
      Specified by:
      getFluidStackHashCode in interface IRSAPI
      Parameters:
      stack - the stack
      Returns:
      a hashcode for the given stack