Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package com.genuineminecraft.ores.generator;
- import net.minecraft.init.Blocks;
- import net.minecraft.world.chunk.Chunk;
- public class Utility {
- public static int findHighestBlock(Chunk chunk) {
- int yMax = chunk.getTopFilledSegment() + 15;
- for (int y = yMax; y > 0; y--) {
- for (int x = 0; x < 16; x++) {
- for (int z = 0; z < 16; z++) {
- if (chunk.getBlock(x, y, z).equals(Blocks.air))
- yMax = y;
- else
- return yMax;
- }
- }
- }
- return yMax;
- }
- }
Advertisement