Skip to content

Instantly share code, notes, and snippets.

@bvierra
Created January 19, 2020 07:49
Show Gist options
  • Save bvierra/ad86c2d1bc63c48cd18c9c1ca8971bac to your computer and use it in GitHub Desktop.
Save bvierra/ad86c2d1bc63c48cd18c9c1ca8971bac to your computer and use it in GitHub Desktop.
bleh
int WATER_CHECK_SIZE = 25;
int edgeSize = (int) Math.sqrt(WATER_CHECK_SIZE);
for (int x = 0; x < edgeSize; x++){
for (int z = 0; z < edgeSize; z++){
BlockPos waterCheckPos = getPos().down().add(x - edgeSize / 2, 0, z - edgeSize / 2);
if (world.getBlockState(waterCheckPos).getBlock() instanceof BlockLiquid &&
world.getBlockState(waterCheckPos).getMaterial() == Material.WATER) {
waterCount++;
}
}
}
if (waterCount == WATER_CHECK_SIZE) {
// RUN HERE
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment