Class MountedStorageManager
java.lang.Object
com.simibubi.create.content.contraptions.MountedStorageManager
- Direct Known Subclasses:
TrainCargoManager
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected MountedFluidStorageWrapperprotected @Nullable MountedItemStorageWrapperprotected MountedItemStorageWrapper -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddBlock(net.minecraft.world.level.Level level, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos globalPos, net.minecraft.core.BlockPos localPos, @Nullable net.minecraft.world.level.block.entity.BlockEntity be) voidattachExternal(net.neoforged.neoforge.items.IItemHandlerModifiable externalStorage) net.neoforged.neoforge.items.wrapper.CombinedInvWrapperThe primary way to access a contraption's inventory.com.google.common.collect.ImmutableMap<net.minecraft.core.BlockPos, MountedItemStorage> Gets a map of all MountedItemStorages in the contraption, irrelevant of them being internal or providing fuel.Gets a fluid handler wrapping all mounted fluid storages.@Nullable MountedItemStorageWrapperGets an item handler wrapping all non-internal mounted storages that provide fuel.Gets an item handler wrapping all non-internal mounted storages.booleanhandlePlayerStorageInteraction(Contraption contraption, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos localPos) voidhandleSync(MountedStorageSyncPacket packet, AbstractContraptionEntity entity) voidvoidread(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket, @Nullable Contraption contraption) protected voidreset()voidtick(AbstractContraptionEntity entity) voidunmount(net.minecraft.world.level.Level level, net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo info, net.minecraft.core.BlockPos globalPos, @Nullable net.minecraft.world.level.block.entity.BlockEntity be) voidwrite(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket)
-
Field Details
-
items
-
fuelItems
-
fluids
-
-
Constructor Details
-
MountedStorageManager
public MountedStorageManager()
-
-
Method Details
-
initialize
public void initialize() -
reset
protected void reset() -
addBlock
public void addBlock(net.minecraft.world.level.Level level, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos globalPos, net.minecraft.core.BlockPos localPos, @Nullable @Nullable net.minecraft.world.level.block.entity.BlockEntity be) -
unmount
public void unmount(net.minecraft.world.level.Level level, net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo info, net.minecraft.core.BlockPos globalPos, @Nullable @Nullable net.minecraft.world.level.block.entity.BlockEntity be) -
tick
-
handleSync
-
read
public void read(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket, @Nullable @Nullable Contraption contraption) -
write
public void write(net.minecraft.nbt.CompoundTag nbt, net.minecraft.core.HolderLookup.Provider registries, boolean clientPacket) -
attachExternal
public void attachExternal(net.neoforged.neoforge.items.IItemHandlerModifiable externalStorage) -
getAllItems
public net.neoforged.neoforge.items.wrapper.CombinedInvWrapper getAllItems()The primary way to access a contraption's inventory. Includes all non-internal mounted storages as well as all external storage. -
getAllItemStorages
public com.google.common.collect.ImmutableMap<net.minecraft.core.BlockPos,MountedItemStorage> getAllItemStorages()Gets a map of all MountedItemStorages in the contraption, irrelevant of them being internal or providing fuel. -
getMountedItems
Gets an item handler wrapping all non-internal mounted storages. This is not the whole contraption inventory as it does not include external storages. Most often, you wantgetAllItems(), which does. -
getFuelItems
Gets an item handler wrapping all non-internal mounted storages that provide fuel. May be null if none are present. -
getFluids
Gets a fluid handler wrapping all mounted fluid storages. -
handlePlayerStorageInteraction
public boolean handlePlayerStorageInteraction(Contraption contraption, net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos localPos)
-