Class DepotMountedStorage
java.lang.Object
com.simibubi.create.api.contraption.storage.item.MountedItemStorage
com.simibubi.create.api.contraption.storage.item.WrapperMountedItemStorage<DepotMountedStorage.Handler>
com.simibubi.create.content.logistics.depot.storage.DepotMountedStorage
- All Implemented Interfaces:
SyncedMountedStorage,net.neoforged.neoforge.items.IItemHandler,net.neoforged.neoforge.items.IItemHandlerModifiable
public class DepotMountedStorage
extends WrapperMountedItemStorage<DepotMountedStorage.Handler>
implements SyncedMountedStorage
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.MapCodec<DepotMountedStorage> Fields inherited from class com.simibubi.create.api.contraption.storage.item.WrapperMountedItemStorage
wrappedFields inherited from class com.simibubi.create.api.contraption.storage.item.MountedItemStorage
STREAM_CODEC, type -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedDepotMountedStorage(MountedItemStorageType<?> type, net.minecraft.world.item.ItemStack stack) protectedDepotMountedStorage(net.minecraft.world.item.ItemStack stack) -
Method Summary
Modifier and TypeMethodDescriptionvoidafterSync(Contraption contraption, net.minecraft.core.BlockPos localPos) Called on the client side after this storage has been synced from the server.static DepotMountedStoragefromDepot(DepotBlockEntity depot) static DepotMountedStoragefromLegacy(net.minecraft.core.HolderLookup.Provider registries, net.minecraft.nbt.CompoundTag nbt) net.minecraft.world.item.ItemStackgetItem()booleanhandleInteraction(net.minecraft.server.level.ServerPlayer player, Contraption contraption, net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo info) Handle a player clicking on this mounted storage.booleanisDirty()voidCalled after this storage has been synced.voidsetItem(net.minecraft.world.item.ItemStack stack) voidunmount(net.minecraft.world.level.Level level, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, @Nullable net.minecraft.world.level.block.entity.BlockEntity be) Un-mount this storage back into the world.Methods inherited from class com.simibubi.create.api.contraption.storage.item.WrapperMountedItemStorage
copyToItemStackHandler, extractItem, getSlotLimit, getSlots, getStackInSlot, insertItem, isItemValid, setStackInSlotMethods inherited from class com.simibubi.create.api.contraption.storage.item.MountedItemStorage
createMenuProvider, getHandlerForMenu, getMenuName, isMenuValid, playClosingSound, playOpeningSound
-
Field Details
-
CODEC
-
-
Constructor Details
-
DepotMountedStorage
protected DepotMountedStorage(net.minecraft.world.item.ItemStack stack) -
DepotMountedStorage
protected DepotMountedStorage(MountedItemStorageType<?> type, net.minecraft.world.item.ItemStack stack)
-
-
Method Details
-
unmount
public void unmount(net.minecraft.world.level.Level level, net.minecraft.world.level.block.state.BlockState state, net.minecraft.core.BlockPos pos, @Nullable @Nullable net.minecraft.world.level.block.entity.BlockEntity be) Description copied from class:MountedItemStorageUn-mount this storage back into the world. The expected storage type of the target block has already been checked to make sure it matches this storage's type.- Specified by:
unmountin classMountedItemStorage
-
handleInteraction
public boolean handleInteraction(net.minecraft.server.level.ServerPlayer player, Contraption contraption, net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo info) Description copied from class:MountedItemStorageHandle a player clicking on this mounted storage. This is always called on the server. The default implementation will try to open a generic GUI for standard inventories. For this to work, this storage must have 1-6 complete rows of 9 slots.- Overrides:
handleInteractionin classMountedItemStorage- Returns:
- true if the interaction was successful
-
isDirty
public boolean isDirty()- Specified by:
isDirtyin interfaceSyncedMountedStorage- Returns:
- true if this storage needs to be synced.
-
markClean
public void markClean()Description copied from interface:SyncedMountedStorageCalled after this storage has been synced.- Specified by:
markCleanin interfaceSyncedMountedStorage
-
afterSync
Description copied from interface:SyncedMountedStorageCalled on the client side after this storage has been synced from the server.- Specified by:
afterSyncin interfaceSyncedMountedStorage
-
setItem
public void setItem(net.minecraft.world.item.ItemStack stack) -
getItem
public net.minecraft.world.item.ItemStack getItem() -
fromDepot
-
fromLegacy
public static DepotMountedStorage fromLegacy(net.minecraft.core.HolderLookup.Provider registries, net.minecraft.nbt.CompoundTag nbt)
-