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 TypeMethodDescriptiondefault @Nullable Storage<FluidVariant>
getFluidStorage
(Direction side) Return a fluid storage if available on the queried side, or null otherwise.default @Nullable Storage<ItemVariant>
getItemStorage
(Direction side) Return an item storage if available on the queried side, or null otherwise.
-
Method Details
-
getFluidStorage
Return a fluid storage if available on the queried side, or null otherwise. -
getItemStorage
Return an item storage if available on the queried side, or null otherwise.
-