Skip to content

Commit

Permalink
light and structure void block issue
Browse files Browse the repository at this point in the history
  • Loading branch information
SoLegendary committed Dec 4, 2024
1 parent bf4204c commit 3887716
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
import net.minecraft.world.item.Items;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.LeavesBlock;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.level.levelgen.Heightmap;
Expand Down Expand Up @@ -107,7 +108,10 @@ public static BlockPos getHighestNonAirBlock(Level level, BlockPos blockPos, boo
do {
bs = level.getBlockState(new BlockPos(blockPos.getX(), y, blockPos.getZ()));
y -= 1;
} while((bs.isAir() || (ignoreLeaves && bs.getMaterial() == Material.LEAVES)) && y > -63);
} while((bs.isAir() ||
bs.getBlock() == Blocks.LIGHT ||
bs.getBlock() == Blocks.STRUCTURE_VOID ||
(ignoreLeaves && bs.getMaterial() == Material.LEAVES)) && y > -63);
return new BlockPos(blockPos.getX(), y, blockPos.getZ());
}
public static BlockPos getHighestNonAirBlock(Level level, BlockPos blockPos) {
Expand Down

0 comments on commit 3887716

Please sign in to comment.