Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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
Expand Down
Loading