Interface LootrCompat
- All Known Implementing Classes:
LootrNullImpl
public interface LootrCompat
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> -
Method Summary
Modifier and TypeMethodDescriptiondefault boolean@Nullable net.minecraft.world.ContainergetContainer(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.booleanisLootrContainer(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) booleanisOpen(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player) voidmarkOpener(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.booleanopenLootrBarrel(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean nowOpen) Open/close Lootr barrel if it is one.booleanopenLootrShulkerBox(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean nowOpen) Open/close Lootr Shulker Box if it is one.
-
Field Details
-
BLOCK_TAG
static final net.minecraft.tags.TagKey<net.minecraft.world.level.block.Block> BLOCK_TAG
-
-
Method Details
-
getContainer
@Nullable @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.- 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
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.- Parameters:
player- Player to markpos- Position of chest
-
isLootrContainer
boolean isLootrContainer(net.minecraft.core.BlockPos pos, net.minecraft.world.level.Level level) - Parameters:
pos- Position to checklevel- Level to check in- Returns:
- Whether the block at the given position is a Lootr container.
-
openLootrBarrel
boolean openLootrBarrel(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player, boolean nowOpen) Open/close Lootr barrel if it is one.- 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
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.- 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
boolean isOpen(net.minecraft.core.BlockPos pos, net.minecraft.world.entity.player.Player player) - Parameters:
pos- Position to check.player- Player to check for.- Returns:
- Whether the supplied Lootr block is open.
-
disableLootrContainerCompat
default boolean disableLootrContainerCompat()- Returns:
- Whether Lootr compat should be fully disabled.
-