All Implemented Interfaces:
ImmersiveHandler<ListOfItemsStorage>

public class BarrelHandler extends ChestLikeHandler
  • Constructor Details

    • BarrelHandler

      public BarrelHandler()
  • Method Details

    • isValidBlock

      public boolean isValidBlock(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level)
      Specified by:
      isValidBlock in interface ImmersiveHandler<ListOfItemsStorage>
      Overrides:
      isValidBlock in class ChestLikeHandler
      Parameters:
      pos - Position to check.
      level - The level being checked in.
      Returns:
      Whether the supplied block matches what this handler handles.
    • enabledInConfig

      public boolean enabledInConfig(net.minecraft.world.entity.player.Player player)
      Parameters:
      player - The player we're checking the config of.
      Returns:
      Whether the immersive this handler handles is enabled. If you do not have a configuration system, this should always return true.
    • onStopTracking

      public void onStopTracking(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos)
      Description copied from interface: ImmersiveHandler
      Function called whenever this immersive is no longer being tracked. Only ever called server-side.
      Specified by:
      onStopTracking in interface ImmersiveHandler<ListOfItemsStorage>
      Overrides:
      onStopTracking in class ChestLikeHandler
      Parameters:
      player - Player who is no longer tracking this immersive.
      pos - Position of the block no longer being tracked.
    • getID

      public net.minecraft.resources.ResourceLocation getID()
      Returns:
      A unique ID to identify this handler. The same value should always be returned by this method.