mirror of
https://github.com/PixelGuys/Cubyz.git
synced 2025-08-03 19:28:49 -04:00
fixed some bug
This commit is contained in:
parent
951cba6ce6
commit
4a79ea0b5a
@ -154,7 +154,6 @@ public class Chunk {
|
||||
for (int py = 0; py < 16; py++) {
|
||||
float value = map[px][py];
|
||||
int y = (int) (value * World.WORLD_HEIGHT);
|
||||
y &= 255; // somehow it can go below it :/
|
||||
for (int j = y > SEA_LEVEL ? y : SEA_LEVEL; j >= 0; j--) {
|
||||
BlockInstance bi = null;
|
||||
if(j > y) {
|
||||
|
@ -21,7 +21,9 @@ public class Structures {
|
||||
//Position of the first block of wood
|
||||
int height = 7 + random.nextInt(5);
|
||||
for (int i = 0; i < height; i++) {
|
||||
ch.addBlock(wood, x, y + i, z);
|
||||
if (y + i < World.WORLD_HEIGHT) {
|
||||
ch.addBlock(wood, x, y + i, z);
|
||||
}
|
||||
}
|
||||
|
||||
//Position of the first block of leaves
|
||||
@ -30,7 +32,9 @@ public class Structures {
|
||||
int j = (height - i) >> 1;
|
||||
for (int k = 1 - j; k < j; k++) {
|
||||
for (int l = 1 - j; l < j; l++) {
|
||||
ch.addBlock(leaves, x + k, y + i, z + l);
|
||||
if (y + i < World.WORLD_HEIGHT) {
|
||||
ch.addBlock(leaves, x + k, y + i, z + l);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user