Skip to content

Commit

Permalink
And update locations using 128 as well.
Browse files Browse the repository at this point in the history
  • Loading branch information
MostAwesomeDude committed May 16, 2013
1 parent 60b0b9a commit cca2977
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
4 changes: 2 additions & 2 deletions bravo/plugins/generators.py
Expand Up @@ -338,7 +338,7 @@ def populate(self, chunk, seed):
current_height > 63 and height > 63):
for y in range(height - 3):
chunk.set_block((x, y, z), blocks["stone"].slot)
for y in range(y, 128):
for y in range(y, CHUNK_HEIGHT // 2):
chunk.set_block((x, y, z), blocks["air"].slot)

name = "cliffs"
Expand Down Expand Up @@ -406,7 +406,7 @@ def populate(self, chunk, seed):
magx = (chunk.x * 16 + x) * xzfactor
magz = (chunk.z * 16 + z) * xzfactor

for y in range(128):
for y in range(CHUNK_HEIGHT):
if not chunk.get_block((x, y, z)):
continue

Expand Down
4 changes: 3 additions & 1 deletion bravo/terrain/trees.py
Expand Up @@ -7,6 +7,8 @@
from zope.interface import Interface, implements

from bravo.blocks import blocks
from bravo.chunk import CHUNK_HEIGHT


PHI = (sqrt(5) - 1) * 0.5
IPHI = (sqrt(5) + 1) * 0.5
Expand Down Expand Up @@ -37,7 +39,7 @@ def dist_to_mat(cord, vec, matidxlist, world, invert=False, limit=None):
x = int(curcord[0])
y = int(curcord[1])
z = int(curcord[2])
if not 0 <= y < 128:
if not 0 <= y < CHUNK_HEIGHT:
break
block = world.sync_get_block((x, y, z))

Expand Down
2 changes: 1 addition & 1 deletion bravo/tests/plugins/test_generators.py
Expand Up @@ -25,7 +25,7 @@ def test_boring(self):

plugin.populate(self.chunk, 0)
for x, y, z in product(xrange(16), xrange(CHUNK_HEIGHT), xrange(16)):
if y < 128:
if y < CHUNK_HEIGHT // 2:
self.assertEqual(self.chunk.get_block((x, y, z)),
bravo.blocks.blocks["stone"].slot)
else:
Expand Down
3 changes: 2 additions & 1 deletion tools/simplexbench.py
Expand Up @@ -4,11 +4,12 @@
from time import time

from bravo.simplex import set_seed, simplex2, simplex3, octaves2, octaves3
from bravo.chunk import CHUNK_HEIGHT

print "Be patient; this benchmark takes a minute or so to run each test."

chunk2d = 16 * 16
chunk3d = chunk2d * 128
chunk3d = chunk2d * CHUNK_HEIGHT

set_seed(time())

Expand Down

0 comments on commit cca2977

Please sign in to comment.