diff --git a/src/main/java/net/earthcomputer/clientcommands/command/FindItemCommand.java b/src/main/java/net/earthcomputer/clientcommands/command/FindItemCommand.java index fbee0b03c..e2b69519d 100644 --- a/src/main/java/net/earthcomputer/clientcommands/command/FindItemCommand.java +++ b/src/main/java/net/earthcomputer/clientcommands/command/FindItemCommand.java @@ -40,7 +40,9 @@ import net.minecraft.world.level.Level; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.ChestBlock; +import net.minecraft.world.level.block.ShulkerBoxBlock; import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.ShulkerBoxBlockEntity; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.properties.ChestType; import net.minecraft.world.level.chunk.LevelChunk; @@ -242,8 +244,7 @@ private boolean canSearch(Level level, BlockPos pos) { BlockEntity blockEntity = level.getBlockEntity(pos); if (!(blockEntity instanceof Container) && state.getBlock() != Blocks.ENDER_CHEST) { return false; - } - if (state.getBlock() instanceof ChestBlock || state.getBlock() == Blocks.ENDER_CHEST) { + } else if (state.getBlock() instanceof ChestBlock || state.getBlock() == Blocks.ENDER_CHEST) { if (ChestBlock.isChestBlockedAt(level, pos)) { return false; } @@ -251,6 +252,8 @@ private boolean canSearch(Level level, BlockPos pos) { BlockPos offsetPos = pos.relative(ChestBlock.getConnectedDirection(state)); return level.getBlockState(offsetPos).getBlock() != state.getBlock() || !ChestBlock.isChestBlockedAt(level, offsetPos); } + } else if (state.getBlock() instanceof ShulkerBoxBlock && blockEntity instanceof ShulkerBoxBlockEntity shulkerBox) { + return ShulkerBoxBlock.canOpen(state, level, pos, shulkerBox); } return true; } diff --git a/src/main/resources/clientcommands.aw b/src/main/resources/clientcommands.aw index 30c48a8df..c34f3685b 100644 --- a/src/main/resources/clientcommands.aw +++ b/src/main/resources/clientcommands.aw @@ -16,6 +16,7 @@ accessible field net/minecraft/client/DebugQueryHandler transactionId I # cfinditem accessible field net/minecraft/world/inventory/AbstractContainerMenu menuType Lnet/minecraft/world/inventory/MenuType; +accessible method net/minecraft/world/level/block/ShulkerBoxBlock canOpen (Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/entity/ShulkerBoxBlockEntity;)Z # cfish accessible method net/minecraft/world/entity/projectile/FishingHook canHitEntity (Lnet/minecraft/world/entity/Entity;)Z