Interface SidedStorageBlockEntity


public interface SidedStorageBlockEntity
Optional helper class that can be implemented on block entities that wish to provide a sided fluid storage and/or a sided item storage without having to register a provider for each block entity type.

How it works is that fabric registers fallback providers for instances of this interface. This can be used for convenient Storage registration, but please always use the SIDED lookups for queries:


 Storage<FluidStorage> maybeFluidStorage = FluidStorage.SIDED.find(world, pos, direction);
 if (maybeFluidStorage != null) {
     // use it
 }
 Storage<ItemStorage> maybeItemStorage = ItemStorage.SIDED.find(world, pos, direction);
 if (maybeItemStorage != null) {
     // use it
 }
 
  • Method Summary

    Modifier and Type
    Method
    Description
    default @Nullable Storage<FluidVariant>
    getFluidStorage(net.minecraft.util.math.Direction side)
    Return a fluid storage if available on the queried side, or null otherwise.
    default @Nullable Storage<ItemVariant>
    getItemStorage(net.minecraft.util.math.Direction side)
    Return an item storage if available on the queried side, or null otherwise.
  • Method Details

    • getFluidStorage

      @OverrideOnly @Nullable default @Nullable Storage<FluidVariant> getFluidStorage(net.minecraft.util.math.Direction side)
      Return a fluid storage if available on the queried side, or null otherwise.
    • getItemStorage

      @OverrideOnly @Nullable default @Nullable Storage<ItemVariant> getItemStorage(net.minecraft.util.math.Direction side)
      Return an item storage if available on the queried side, or null otherwise.