Class ChestMountedStorage

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

public class ChestMountedStorage extends SimpleMountedStorage
Mounted storage that handles opening a combined GUI for double chests.
  • Field Details

  • Constructor Details

    • ChestMountedStorage

      protected ChestMountedStorage(MountedItemStorageType<?> type, net.neoforged.neoforge.items.IItemHandler handler)
    • ChestMountedStorage

      public ChestMountedStorage(net.neoforged.neoforge.items.IItemHandler handler)
  • 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.
      Overrides:
      unmount in class SimpleMountedStorage
    • getHandlerForMenu

      protected net.neoforged.neoforge.items.IItemHandlerModifiable getHandlerForMenu(net.minecraft.world.level.levelgen.structure.templatesystem.StructureTemplate.StructureBlockInfo info, Contraption contraption)
      Description copied from class: MountedItemStorage
      Get the item handler that will be used by this storage's menu. This is useful for handling multi-blocks, such as double chests.
      Overrides:
      getHandlerForMenu in class MountedItemStorage
    • getOtherHalf

      @Nullable protected @Nullable MountedItemStorage getOtherHalf(Contraption contraption, net.minecraft.core.BlockPos localPos, net.minecraft.world.level.block.Block block, net.minecraft.core.Direction thisFacing, net.minecraft.world.level.block.state.properties.ChestType thisType)
    • playOpeningSound

      protected void playOpeningSound(net.minecraft.server.level.ServerLevel level, net.minecraft.world.phys.Vec3 pos)
      Description copied from class: MountedItemStorage
      Play the sound made by opening this storage's GUI.
      Overrides:
      playOpeningSound in class MountedItemStorage
    • playClosingSound

      protected void playClosingSound(net.minecraft.server.level.ServerLevel level, net.minecraft.world.phys.Vec3 pos)
      Description copied from class: MountedItemStorage
      Play the sound made by closing this storage's GUI.
      Overrides:
      playClosingSound in class MountedItemStorage