Created
February 16, 2012 01:04
-
-
Save agrif/1840477 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import redstone as rs | |
import sys | |
try: | |
biome = int(sys.argv[1]) | |
files = sys.argv[2:] | |
except: | |
print "usage: {0} <biome> <region.mca ...>".format(sys.argv[0]) | |
sys.exit(1) | |
for fname in files: | |
print "setting biome in", fname | |
r = rs.Region.open(fname, True) | |
for x in xrange(32): | |
for z in xrange(32): | |
if not r.contains_chunk(x, z): | |
continue | |
d = rs.NBT.parse_from_region(r, x, z) | |
biomes = d.find("Biomes") | |
biomes.value = chr(biome) * (16 * 16) | |
d.write_to_region(r, x, z) | |
r.flush() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment