Skip to content

Instantly share code, notes, and snippets.

@MostAwesomeDude
Created December 2, 2010 22:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MostAwesomeDude/726223 to your computer and use it in GitHub Desktop.
Save MostAwesomeDude/726223 to your computer and use it in GitHub Desktop.
diff --git a/beta/plugins/generators.py b/beta/plugins/generators.py
index 2412c8e..b0fd832 100644
--- a/beta/plugins/generators.py
+++ b/beta/plugins/generators.py
@@ -22,8 +22,10 @@ class BoringGenerator(object):
Fill the bottom half of the chunk with stone.
"""
+ stone = blocks["stone"].slot
+
for x, y, z in product(xrange(16), xrange(64), xrange(16)):
- chunk.set_block((x, y, z), blocks["stone"].slot)
+ chunk.set_block((x, y, z), stone)
name = "boring"
@@ -44,6 +46,8 @@ class SimplexGenerator(object):
reseed(seed)
+ stone = blocks["stone"].slot
+
# And into one end he plugged the whole of reality as extrapolated
# from a piece of fairy cake, and into the other end he plugged his
# wife: so that when he turned it on she saw in one instant the whole
@@ -61,7 +65,7 @@ class SimplexGenerator(object):
height *= scale * 30
height += 70
for y in xrange(int(height)):
- chunk.set_block((x, y, z), blocks["stone"].slot)
+ chunk.set_block((x, y, z), stone)
name = "simplex"
@@ -77,9 +81,12 @@ class WaterTableGenerator(object):
Generate a flat water table halfway up the map.
"""
+ air = blocks["air"].slot
+ spring = blocks["spring"].slot
+
for x, y, z in product(xrange(16), xrange(64), xrange(16)):
- if chunk.get_block((x, y, z)) == blocks["air"].slot:
- chunk.set_block((x, y, z), blocks["spring"].slot)
+ if chunk.get_block((x, y, z)) == air:
+ chunk.set_block((x, y, z), spring)
name = "watertable"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment