Class DepotMountedStorage

All Implemented Interfaces:
SyncedMountedStorage, net.neoforged.neoforge.items.IItemHandler, net.neoforged.neoforge.items.IItemHandlerModifiable

public class DepotMountedStorage extends WrapperMountedItemStorage<DepotMountedStorage.Handler> implements SyncedMountedStorage
  • Field Details

  • 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: MountedItemStorage
      Un-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:
      unmount in class MountedItemStorage
    • 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: MountedItemStorage
      Handle 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:
      handleInteraction in class MountedItemStorage
      Returns:
      true if the interaction was successful
    • isDirty

      public boolean isDirty()
      Specified by:
      isDirty in interface SyncedMountedStorage
      Returns:
      true if this storage needs to be synced.
    • markClean

      public void markClean()
      Description copied from interface: SyncedMountedStorage
      Called after this storage has been synced.
      Specified by:
      markClean in interface SyncedMountedStorage
    • afterSync

      public void afterSync(Contraption contraption, net.minecraft.core.BlockPos localPos)
      Description copied from interface: SyncedMountedStorage
      Called on the client side after this storage has been synced from the server.
      Specified by:
      afterSync in interface SyncedMountedStorage
    • setItem

      public void setItem(net.minecraft.world.item.ItemStack stack)
    • getItem

      public net.minecraft.world.item.ItemStack getItem()
    • fromDepot

      public static DepotMountedStorage fromDepot(DepotBlockEntity depot)
    • fromLegacy

      public static DepotMountedStorage fromLegacy(net.minecraft.core.HolderLookup.Provider registries, net.minecraft.nbt.CompoundTag nbt)