Class LootrNullImpl

java.lang.Object
com.hammy275.immersivemc.common.compat.lootr.LootrNullImpl
All Implemented Interfaces:
LootrCompat

public class LootrNullImpl extends Object implements LootrCompat
  • Field Summary

    Fields inherited from interface com.hammy275.immersivemc.common.compat.lootr.LootrCompat

    BLOCK_TAG
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    @Nullable net.minecraft.world.Container
    getContainer(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos)
    Gets the container Lootr-handled block, or returns null if the target isn't a Lootr-handled block.
    boolean
    isLootrContainer(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level)
     
    boolean
    isOpen(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
     
    void
    markOpener(net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos)
    Mark the specified player as having opened this Lootr-handled block, if this is a Lootr-handled block.
    boolean
    openLootrBarrel(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean nowOpen)
    Open/close Lootr barrel if it is one.
    boolean
    openLootrShulkerBox(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean nowOpen)
    Open/close Lootr Shulker Box if it is one.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LootrNullImpl

      public LootrNullImpl()
  • Method Details

    • getContainer

      @Nullable public @Nullable net.minecraft.world.Container getContainer(net.minecraft.server.level.ServerPlayer player, net.minecraft.core.BlockPos pos)
      Description copied from interface: LootrCompat
      Gets the container Lootr-handled block, or returns null if the target isn't a Lootr-handled block.
      Specified by:
      getContainer in interface LootrCompat
      Parameters:
      player - Player to get contents for.
      pos - Position of block.
      Returns:
      A list of items in the block, or null if there isn't one.
    • markOpener

      public void markOpener(net.minecraft.world.entity.player.Player player, net.minecraft.core.BlockPos pos)
      Description copied from interface: LootrCompat
      Mark the specified player as having opened this Lootr-handled block, if this is a Lootr-handled block.
      Specified by:
      markOpener in interface LootrCompat
      Parameters:
      player - Player to mark
      pos - Position of chest
    • isLootrContainer

      public boolean isLootrContainer(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level)
      Specified by:
      isLootrContainer in interface LootrCompat
      Parameters:
      pos - Position to check
      level - Level to check in
      Returns:
      Whether the block at the given position is a Lootr container.
    • openLootrBarrel

      public boolean openLootrBarrel(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean nowOpen)
      Description copied from interface: LootrCompat
      Open/close Lootr barrel if it is one.
      Specified by:
      openLootrBarrel in interface LootrCompat
      Parameters:
      pos - The position of the potential barrel.
      player - Player that is opening/closing the barrel.
      nowOpen - Whether the player is opening or closing the barrel.
      Returns:
      Whether the open/close succeeded. Fails when it isn't a Lootr barrel.
    • openLootrShulkerBox

      public boolean openLootrShulkerBox(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean nowOpen)
      Description copied from interface: LootrCompat
      Open/close Lootr Shulker Box if it is one.
      Specified by:
      openLootrShulkerBox in interface LootrCompat
      Parameters:
      pos - The position of the potential Shulker Box.
      player - Player that is opening/closing the Shulker Box.
      nowOpen - Whether the player is opening or closing the Shulker Box.
      Returns:
      Whether the open/close succeeded. Fails when it isn't a Lootr Shulker Box.
    • isOpen

      public boolean isOpen(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player)
      Specified by:
      isOpen in interface LootrCompat
      Parameters:
      pos - Position to check.
      player - Player to check for.
      Returns:
      Whether the supplied Lootr block is open.
    • disableLootrContainerCompat

      public boolean disableLootrContainerCompat()
      Specified by:
      disableLootrContainerCompat in interface LootrCompat
      Returns:
      Whether Lootr compat should be fully disabled.