diff --git a/src/main/java/net/earthcomputer/clientcommands/command/PredictBrushablesCommand.java b/src/main/java/net/earthcomputer/clientcommands/command/PredictBrushablesCommand.java index 21966c1d2..9c68bcb2c 100644 --- a/src/main/java/net/earthcomputer/clientcommands/command/PredictBrushablesCommand.java +++ b/src/main/java/net/earthcomputer/clientcommands/command/PredictBrushablesCommand.java @@ -35,6 +35,8 @@ import net.minecraft.world.level.biome.Biomes; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.BrushableBlock; +import net.minecraft.world.level.block.entity.BlockEntity; +import net.minecraft.world.level.block.entity.DecoratedPotBlockEntity; import net.minecraft.world.level.block.state.BlockState; import java.util.ArrayList; @@ -117,6 +119,13 @@ protected void scanBlock(Entity cameraEntity, BlockPos pos) { } else { return; } + } else if (blockState.is(Blocks.DECORATED_POT)) { + BlockEntity blockEntity = level.getBlockEntity(pos); + if (!(blockEntity instanceof DecoratedPotBlockEntity decoratedPotBlockEntity)) { + return; + } + lootSeed = decoratedPotBlockEntity.getLootTableSeed(); + lootTableSupplier = MCLootTables.TRIAL_CHAMBERS_CORRIDOR_POT; } else { return; } @@ -156,7 +165,11 @@ protected void onBlockStateUpdate(ClientLevel level, BlockPos pos, BlockState ol @Override protected boolean canScanChunkSection(Entity cameraEntity, SectionPos pos) { - return hasBlockState(pos, s -> s.getBlock() instanceof BrushableBlock) && super.canScanChunkSection(cameraEntity, pos); + if (!super.canScanChunkSection(cameraEntity, pos)) { + return false; + } + return hasBlockState(pos, s -> s.getBlock() instanceof BrushableBlock) + || hasBlockState(pos, s -> s.is(Blocks.DECORATED_POT)); } @Override