Class LootrNullImpl
java.lang.Object
com.hammy275.immersivemc.common.compat.lootr.LootrNullImpl
- All Implemented Interfaces:
LootrCompat
-
Field Summary
Fields inherited from interface com.hammy275.immersivemc.common.compat.lootr.LootrCompat
BLOCK_TAG
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionboolean
@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.
-
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 interfaceLootrCompat
- 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 interfaceLootrCompat
- Parameters:
player
- Player to markpos
- Position of chest
-
isLootrContainer
public boolean isLootrContainer(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) - Specified by:
isLootrContainer
in interfaceLootrCompat
- Parameters:
pos
- Position to checklevel
- 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 interfaceLootrCompat
- 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 interfaceLootrCompat
- 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 interfaceLootrCompat
- 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 interfaceLootrCompat
- Returns:
- Whether Lootr compat should be fully disabled.
-