Code cleanup to simplify upstream merge
This commit is contained in:
40
README.rst
40
README.rst
@@ -22,38 +22,6 @@ https://github.com/brownan/Minecraft-Overviewer/wiki/Documentation
|
||||
To contact the developers and other users, go to the site at the top of this
|
||||
README, or go to #overviewer on irc.freenode.net.
|
||||
|
||||
Configurable North changes
|
||||
==========================
|
||||
|
||||
Additional Features
|
||||
-------------------
|
||||
|
||||
A configurable north direction! I'm not a big fan of north pointing to the
|
||||
bottom left corner of the screen, and I bet you aren't either. So here you go!
|
||||
Either use the commandline option --north-direction, or use the option
|
||||
north_direction in the settings file. Valid options are 'lower-left',
|
||||
'upper-left', 'upper-right', and 'lower-right'. I'm partial to 'upper-right',
|
||||
myself. Defaults to 'lower-left' to match official behavior.
|
||||
|
||||
Additional Bugs
|
||||
---------------
|
||||
|
||||
Sometimes the upper- and lower-right direction seems to exacerbate an
|
||||
existing bug that will not let you click on a sign in some cases. This is a
|
||||
bang-head-on-desk sort of thing, I should be able to find it but I just haven't
|
||||
yet. It does seem to work fine on my actual SMP map, for what that's worth.
|
||||
|
||||
So far only blocks where direction is important (minecart tracks, doors, signs,
|
||||
etc) rotate. Blocks like grass, stone, gravel, etc do not, however for the most
|
||||
part it isn't noticeable because they look very similar no matter which
|
||||
direction we are viewing them from.
|
||||
|
||||
Upstream
|
||||
--------
|
||||
|
||||
Once I've squashed the additional bugs and cleaned up the code a bit, I will
|
||||
see about getting this included in the official Minecraft Overviewer.
|
||||
|
||||
Features
|
||||
========
|
||||
|
||||
@@ -227,6 +195,10 @@ Options
|
||||
--list-rendermodes
|
||||
List the available render modes, and a short description of each.
|
||||
|
||||
--north-direction=NORTH_DIRECTION
|
||||
Specifies which corner of the screen north will point to.
|
||||
Valid options are: lower-left, upper-left, upper-right, lower-right.
|
||||
|
||||
--settings=PATH
|
||||
Use this option to load settings from a file. The format of this file is
|
||||
given below.
|
||||
@@ -296,6 +268,10 @@ textures_path
|
||||
source. Overviewer looks in here for terrain.png and other textures before
|
||||
it looks anywhere else.
|
||||
|
||||
north_direction
|
||||
Specifies which corner of the screen north will point to.
|
||||
Valid options are: lower-left, upper-left, upper-right, lower-right.
|
||||
|
||||
Viewing the Results
|
||||
-------------------
|
||||
Within the output directory you will find two things: an index.html file, and a
|
||||
|
||||
@@ -255,7 +255,7 @@ def main():
|
||||
# create the quadtrees
|
||||
# TODO chunklist
|
||||
q = []
|
||||
qtree_args = {'depth' : options.zoom, 'imgformat' : imgformat, 'imgquality' : options.imgquality, 'optimizeimg' : optimizeimg, 'bgcolor' : bgcolor, 'forcerender' : options.forcerender, 'north_direction' : north_direction}
|
||||
qtree_args = {'depth' : options.zoom, 'imgformat' : imgformat, 'imgquality' : options.imgquality, 'optimizeimg' : optimizeimg, 'bgcolor' : bgcolor, 'forcerender' : options.forcerender}
|
||||
for rendermode in options.rendermode:
|
||||
if rendermode == 'normal':
|
||||
qtree = quadtree.QuadtreeGen(w, destdir, rendermode=rendermode, tiledir='tiles', **qtree_args)
|
||||
|
||||
@@ -536,13 +536,13 @@ var overviewer = {
|
||||
var perPixel = 1.0 / (overviewerConfig.CONST.tileSize *
|
||||
Math.pow(2, overviewerConfig.map.zoomLevels));
|
||||
|
||||
if(overviewerConfig.map.north_direction == 'upper-right'){
|
||||
x = -x-1;
|
||||
y = -y-1;
|
||||
} else if(overviewerConfig.map.north_direction == 'upper-left'){
|
||||
if(overviewerConfig.map.north_direction == 'upper-left'){
|
||||
temp = x;
|
||||
x = -y-1;
|
||||
y = temp;
|
||||
} else if(overviewerConfig.map.north_direction == 'upper-right'){
|
||||
x = -x-1;
|
||||
y = -y-1;
|
||||
} else if(overviewerConfig.map.north_direction == 'lower-right'){
|
||||
temp = x;
|
||||
x = y;
|
||||
@@ -620,13 +620,13 @@ var overviewer = {
|
||||
point.x += 64;
|
||||
point.z -= 64;
|
||||
|
||||
if(overviewerConfig.map.north_direction == 'upper-right'){
|
||||
point.x = -point.x;
|
||||
point.z = -point.z;
|
||||
} else if(overviewerConfig.map.north_direction == 'upper-left'){
|
||||
if(overviewerConfig.map.north_direction == 'upper-left'){
|
||||
temp = point.z;
|
||||
point.z = -point.x;
|
||||
point.x = temp;
|
||||
} else if(overviewerConfig.map.north_direction == 'upper-right'){
|
||||
point.x = -point.x;
|
||||
point.z = -point.z;
|
||||
} else if(overviewerConfig.map.north_direction == 'lower-right'){
|
||||
temp = point.z;
|
||||
point.z = point.x;
|
||||
|
||||
@@ -210,13 +210,13 @@ class MCRFileReader(object):
|
||||
self._chunks = None
|
||||
|
||||
def get_north_rotations(self):
|
||||
if self.north_direction == "upper-left":
|
||||
if self.north_direction == 'upper-left':
|
||||
return 1
|
||||
elif self.north_direction == "upper-right":
|
||||
elif self.north_direction == 'upper-right':
|
||||
return 2
|
||||
elif self.north_direction == "lower-right":
|
||||
elif self.north_direction == 'lower-right':
|
||||
return 3
|
||||
elif self.north_direction == "lower-left":
|
||||
elif self.north_direction == 'lower-left':
|
||||
return 0
|
||||
|
||||
def _read_24bit_int(self):
|
||||
|
||||
@@ -49,7 +49,7 @@ def iterate_base4(d):
|
||||
return itertools.product(xrange(4), repeat=d)
|
||||
|
||||
class QuadtreeGen(object):
|
||||
def __init__(self, worldobj, destdir, bgcolor, depth=None, tiledir=None, forcerender=False, imgformat=None, imgquality=95, optimizeimg=None, rendermode="normal", north_direction='lower-left'):
|
||||
def __init__(self, worldobj, destdir, bgcolor, depth=None, tiledir=None, forcerender=False, imgformat=None, imgquality=95, optimizeimg=None, rendermode="normal"):
|
||||
"""Generates a quadtree from the world given into the
|
||||
given dest directory
|
||||
|
||||
@@ -66,7 +66,6 @@ class QuadtreeGen(object):
|
||||
self.optimizeimg = optimizeimg
|
||||
self.bgcolor = bgcolor
|
||||
self.rendermode = rendermode
|
||||
self.north_direction = north_direction
|
||||
|
||||
# force png renderformat if we're using an overlay mode
|
||||
if 'overlay' in get_render_mode_inheritance(rendermode):
|
||||
|
||||
@@ -65,8 +65,8 @@ def pool_initializer(rendernode):
|
||||
|
||||
# make sure textures are generated for this process
|
||||
# and initialize c_overviewer
|
||||
textures.generate(north_direction=rendernode.options.get('north_direction', None),
|
||||
path=rendernode.options.get('textures_path', None))
|
||||
textures.generate(path=rendernode.options.get('textures_path', None),
|
||||
north_direction=rendernode.options.get('north_direction', None))
|
||||
c_overviewer.init_chunk_render()
|
||||
|
||||
# load biome data in each process, if needed
|
||||
|
||||
@@ -511,10 +511,10 @@ def generate_texture_tuple(img, blockid):
|
||||
blockmap list and specialblockmap dictionary."""
|
||||
return (img.convert("RGB"), img.split()[3], generate_opaque_mask(img))
|
||||
|
||||
def generate_special_texture(blockID, data, north_direction):
|
||||
def generate_special_texture(blockID, data):
|
||||
"""Generates a special texture, such as a correctly facing minecraft track"""
|
||||
|
||||
data = convert_data(blockID, data, north_direction)
|
||||
data = convert_data(blockID, data)
|
||||
|
||||
# blocks need to be handled here (and in chunk.py)
|
||||
|
||||
@@ -1680,37 +1680,37 @@ def generate_special_texture(blockID, data, north_direction):
|
||||
|
||||
return None
|
||||
|
||||
def convert_data(blockID, data, north_direction):
|
||||
def convert_data(blockID, data):
|
||||
if blockID == 26: # bed
|
||||
#Masked to not clobber block head/foot info
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if (data & 0b0011) == 0: data = data & 0b1100 | 1
|
||||
elif (data & 0b0011) == 1: data = data & 0b1100 | 2
|
||||
elif (data & 0b0011) == 2: data = data & 0b1100 | 3
|
||||
elif (data & 0b0011) == 3: data = data & 0b1100 | 0
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if (data & 0b0011) == 0: data = data & 0b1100 | 2
|
||||
elif (data & 0b0011) == 1: data = data & 0b1100 | 3
|
||||
elif (data & 0b0011) == 2: data = data & 0b1100 | 0
|
||||
elif (data & 0b0011) == 3: data = data & 0b1100 | 1
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if (data & 0b0011) == 0: data = data & 0b1100 | 3
|
||||
elif (data & 0b0011) == 1: data = data & 0b1100 | 0
|
||||
elif (data & 0b0011) == 2: data = data & 0b1100 | 1
|
||||
elif (data & 0b0011) == 3: data = data & 0b1100 | 2
|
||||
if blockID in (29, 33, 34): # sticky piston, piston, piston extension
|
||||
#Masked to not clobber block head/foot info
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if (data & 0b0111) == 2: data = data & 0b1000 | 5
|
||||
elif (data & 0b0111) == 3: data = data & 0b1000 | 4
|
||||
elif (data & 0b0111) == 4: data = data & 0b1000 | 2
|
||||
elif (data & 0b0111) == 5: data = data & 0b1000 | 3
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if (data & 0b0111) == 2: data = data & 0b1000 | 3
|
||||
elif (data & 0b0111) == 3: data = data & 0b1000 | 2
|
||||
elif (data & 0b0111) == 4: data = data & 0b1000 | 5
|
||||
elif (data & 0b0111) == 5: data = data & 0b1000 | 4
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if (data & 0b0111) == 2: data = data & 0b1000 | 4
|
||||
elif (data & 0b0111) == 3: data = data & 0b1000 | 5
|
||||
elif (data & 0b0111) == 4: data = data & 0b1000 | 3
|
||||
@@ -1718,19 +1718,19 @@ def convert_data(blockID, data, north_direction):
|
||||
if blockID in (27, 28, 66): # minetrack:
|
||||
#Masked to not clobber powered rail on/off info
|
||||
#Ascending and flat straight
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if (data & 0b0111) == 0: data = data & 0b1000 | 1
|
||||
elif (data & 0b0111) == 1: data = data & 0b1000 | 0
|
||||
elif (data & 0b0111) == 2: data = data & 0b1000 | 5
|
||||
elif (data & 0b0111) == 3: data = data & 0b1000 | 4
|
||||
elif (data & 0b0111) == 4: data = data & 0b1000 | 2
|
||||
elif (data & 0b0111) == 5: data = data & 0b1000 | 3
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if (data & 0b0111) == 2: data = data & 0b1000 | 3
|
||||
elif (data & 0b0111) == 3: data = data & 0b1000 | 2
|
||||
elif (data & 0b0111) == 4: data = data & 0b1000 | 5
|
||||
elif (data & 0b0111) == 5: data = data & 0b1000 | 4
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if (data & 0b0111) == 0: data = data & 0b1000 | 1
|
||||
elif (data & 0b0111) == 1: data = data & 0b1000 | 0
|
||||
elif (data & 0b0111) == 2: data = data & 0b1000 | 4
|
||||
@@ -1739,171 +1739,171 @@ def convert_data(blockID, data, north_direction):
|
||||
elif (data & 0b0111) == 5: data = data & 0b1000 | 2
|
||||
if blockID == 66: # normal minetrack only
|
||||
#Corners
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if data == 6: data = 7
|
||||
elif data == 7: data = 8
|
||||
elif data == 8: data = 6
|
||||
elif data == 9: data = 9
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if data == 6: data = 8
|
||||
elif data == 7: data = 9
|
||||
elif data == 8: data = 6
|
||||
elif data == 9: data = 7
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if data == 6: data = 9
|
||||
elif data == 7: data = 6
|
||||
elif data == 8: data = 8
|
||||
elif data == 9: data = 7
|
||||
if blockID in (50, 75, 76): # torch, off/on redstone torch
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if data == 1: data = 3
|
||||
elif data == 2: data = 4
|
||||
elif data == 3: data = 2
|
||||
elif data == 4: data = 1
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if data == 1: data = 2
|
||||
elif data == 2: data = 1
|
||||
elif data == 3: data = 4
|
||||
elif data == 4: data = 3
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if data == 1: data = 4
|
||||
elif data == 2: data = 3
|
||||
elif data == 3: data = 1
|
||||
elif data == 4: data = 2
|
||||
if blockID in (53,67): # wooden and cobblestone stairs.
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if data == 0: data = 2
|
||||
elif data == 1: data = 3
|
||||
elif data == 2: data = 1
|
||||
elif data == 3: data = 0
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if data == 0: data = 1
|
||||
elif data == 1: data = 0
|
||||
elif data == 2: data = 3
|
||||
elif data == 3: data = 2
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if data == 0: data = 3
|
||||
elif data == 1: data = 2
|
||||
elif data == 2: data = 0
|
||||
elif data == 3: data = 1
|
||||
if blockID in (61, 62, 23): # furnace and burning furnace
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if data == 2: data = 5
|
||||
elif data == 3: data = 4
|
||||
elif data == 4: data = 2
|
||||
elif data == 5: data = 3
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if data == 2: data = 3
|
||||
elif data == 3: data = 2
|
||||
elif data == 4: data = 5
|
||||
elif data == 5: data = 4
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if data == 2: data = 4
|
||||
elif data == 3: data = 5
|
||||
elif data == 4: data = 3
|
||||
elif data == 5: data = 2
|
||||
if blockID == 63: # signposts
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
data = (data + 4) % 16
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
data = (data + 8) % 16
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
data = (data + 12) % 16
|
||||
if blockID in (64,71): # wooden/iron door
|
||||
#Masked to not clobber block top/bottom & swung info
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if (data & 0b0011) == 0: data = data & 0b1100 | 1
|
||||
elif (data & 0b0011) == 1: data = data & 0b1100 | 2
|
||||
elif (data & 0b0011) == 2: data = data & 0b1100 | 3
|
||||
elif (data & 0b0011) == 3: data = data & 0b1100 | 0
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if (data & 0b0011) == 0: data = data & 0b1100 | 2
|
||||
elif (data & 0b0011) == 1: data = data & 0b1100 | 3
|
||||
elif (data & 0b0011) == 2: data = data & 0b1100 | 0
|
||||
elif (data & 0b0011) == 3: data = data & 0b1100 | 1
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if (data & 0b0011) == 0: data = data & 0b1100 | 3
|
||||
elif (data & 0b0011) == 1: data = data & 0b1100 | 0
|
||||
elif (data & 0b0011) == 2: data = data & 0b1100 | 1
|
||||
elif (data & 0b0011) == 3: data = data & 0b1100 | 2
|
||||
if blockID == 65: # ladder
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if data == 2: data = 5
|
||||
elif data == 3: data = 4
|
||||
elif data == 4: data = 2
|
||||
elif data == 5: data = 3
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if data == 2: data = 3
|
||||
elif data == 3: data = 2
|
||||
elif data == 4: data = 5
|
||||
elif data == 5: data = 4
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if data == 2: data = 4
|
||||
elif data == 3: data = 5
|
||||
elif data == 4: data = 3
|
||||
elif data == 5: data = 2
|
||||
if blockID == 68: # wall sign
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if data == 2: data = 5
|
||||
elif data == 3: data = 4
|
||||
elif data == 4: data = 2
|
||||
elif data == 5: data = 3
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if data == 2: data = 3
|
||||
elif data == 3: data = 2
|
||||
elif data == 4: data = 5
|
||||
elif data == 5: data = 4
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if data == 2: data = 4
|
||||
elif data == 3: data = 5
|
||||
elif data == 4: data = 3
|
||||
elif data == 5: data = 2
|
||||
if blockID in (86,91): # pumpkins, jack-o-lantern
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if data == 0: data = 1
|
||||
elif data == 1: data = 2
|
||||
elif data == 2: data = 3
|
||||
elif data == 3: data = 0
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if data == 0: data = 2
|
||||
elif data == 1: data = 3
|
||||
elif data == 2: data = 0
|
||||
elif data == 3: data = 1
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if data == 0: data = 3
|
||||
elif data == 1: data = 0
|
||||
elif data == 2: data = 1
|
||||
elif data == 3: data = 2
|
||||
if blockID in (93, 94): # redstone repeaters, ON and OFF
|
||||
#Masked to not clobber delay info
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if (data & 0b0011) == 0: data = data & 0b1100 | 1
|
||||
elif (data & 0b0011) == 1: data = data & 0b1100 | 2
|
||||
elif (data & 0b0011) == 2: data = data & 0b1100 | 3
|
||||
elif (data & 0b0011) == 3: data = data & 0b1100 | 0
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if (data & 0b0011) == 0: data = data & 0b1100 | 2
|
||||
elif (data & 0b0011) == 1: data = data & 0b1100 | 3
|
||||
elif (data & 0b0011) == 2: data = data & 0b1100 | 0
|
||||
elif (data & 0b0011) == 3: data = data & 0b1100 | 1
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if (data & 0b0011) == 0: data = data & 0b1100 | 3
|
||||
elif (data & 0b0011) == 1: data = data & 0b1100 | 0
|
||||
elif (data & 0b0011) == 2: data = data & 0b1100 | 1
|
||||
elif (data & 0b0011) == 3: data = data & 0b1100 | 2
|
||||
if blockID == 96: # trapdoor
|
||||
#Masked to not clobber opened/closed info
|
||||
if north_direction == 'upper-left':
|
||||
if _north == 'upper-left':
|
||||
if (data & 0b0011) == 0: data = data & 0b1100 | 3
|
||||
elif (data & 0b0011) == 1: data = data & 0b1100 | 2
|
||||
elif (data & 0b0011) == 2: data = data & 0b1100 | 0
|
||||
elif (data & 0b0011) == 3: data = data & 0b1100 | 1
|
||||
elif north_direction == 'upper-right':
|
||||
elif _north == 'upper-right':
|
||||
if (data & 0b0011) == 0: data = data & 0b1100 | 1
|
||||
elif (data & 0b0011) == 1: data = data & 0b1100 | 0
|
||||
elif (data & 0b0011) == 2: data = data & 0b1100 | 3
|
||||
elif (data & 0b0011) == 3: data = data & 0b1100 | 2
|
||||
elif north_direction == 'lower-right':
|
||||
elif _north == 'lower-right':
|
||||
if (data & 0b0011) == 0: data = data & 0b1100 | 2
|
||||
elif (data & 0b0011) == 1: data = data & 0b1100 | 3
|
||||
elif (data & 0b0011) == 2: data = data & 0b1100 | 1
|
||||
@@ -1957,7 +1957,12 @@ def getBiomeData(worlddir, chunkX, chunkY):
|
||||
biomeX = chunkX // 32
|
||||
biomeY = chunkY // 32
|
||||
rots = 0
|
||||
if _north == 'upper-right':
|
||||
if _north == 'upper-left':
|
||||
temp = biomeX
|
||||
biomeX = biomeY
|
||||
biomeY = -temp-1
|
||||
rots = 3
|
||||
elif _north == 'upper-right':
|
||||
biomeX = -biomeX-1
|
||||
biomeY = -biomeY-1
|
||||
rots = 2
|
||||
@@ -1966,11 +1971,6 @@ def getBiomeData(worlddir, chunkX, chunkY):
|
||||
biomeX = -biomeY-1
|
||||
biomeY = temp
|
||||
rots = 1
|
||||
elif _north == 'upper-left':
|
||||
temp = biomeX
|
||||
biomeX = biomeY
|
||||
biomeY = -temp-1
|
||||
rots = 3
|
||||
|
||||
biomeFile = "b.%d.%d.biome" % (biomeX, biomeY)
|
||||
if biomeFile == currentBiomeFile:
|
||||
@@ -2103,7 +2103,7 @@ def generate(path=None,texture_size=24,bgc = (26,26,26,0),north_direction='lower
|
||||
specialblockmap = {}
|
||||
for blockID in special_blocks:
|
||||
for data in special_map[blockID]:
|
||||
specialblockmap[(blockID, data)] = generate_special_texture(blockID, data, north_direction)
|
||||
specialblockmap[(blockID, data)] = generate_special_texture(blockID, data)
|
||||
|
||||
if texture_size != 24:
|
||||
# rescale biome textures.
|
||||
|
||||
@@ -218,13 +218,13 @@ class World(object):
|
||||
disp_spawnX = spawnX = data['Data']['SpawnX']
|
||||
spawnY = data['Data']['SpawnY']
|
||||
disp_spawnZ = spawnZ = data['Data']['SpawnZ']
|
||||
if self.north_direction == 'upper-right':
|
||||
spawnX = -spawnX
|
||||
spawnZ = -spawnZ
|
||||
elif self.north_direction == 'upper-left':
|
||||
if self.north_direction == 'upper-left':
|
||||
temp = spawnX
|
||||
spawnX = -spawnZ
|
||||
spawnZ = temp
|
||||
elif self.north_direction == 'upper-right':
|
||||
spawnX = -spawnX
|
||||
spawnZ = -spawnZ
|
||||
elif self.north_direction == 'lower-right':
|
||||
temp = spawnX
|
||||
spawnX = spawnZ
|
||||
@@ -304,13 +304,13 @@ class World(object):
|
||||
self.findTrueSpawn()
|
||||
|
||||
def _get_north_rotations(self):
|
||||
if self.north_direction == "upper-left":
|
||||
if self.north_direction == 'upper-left':
|
||||
return 1
|
||||
elif self.north_direction == "upper-right":
|
||||
elif self.north_direction == 'upper-right':
|
||||
return 2
|
||||
elif self.north_direction == "lower-right":
|
||||
elif self.north_direction == 'lower-right':
|
||||
return 3
|
||||
elif self.north_direction == "lower-left":
|
||||
elif self.north_direction == 'lower-left':
|
||||
return 0
|
||||
|
||||
def _iterate_regionfiles(self,regionlist=None):
|
||||
@@ -331,13 +331,13 @@ class World(object):
|
||||
logging.debug("Using path %s from regionlist", f)
|
||||
x = int(p[1])
|
||||
y = int(p[2])
|
||||
if self.north_direction == 'upper-right':
|
||||
x = -x-1
|
||||
y = -y-1
|
||||
elif self.north_direction == 'upper-left':
|
||||
if self.north_direction == 'upper-left':
|
||||
temp = x
|
||||
x = -y-1
|
||||
y = temp
|
||||
elif self.north_direction == 'upper-right':
|
||||
x = -x-1
|
||||
y = -y-1
|
||||
elif self.north_direction == 'lower-right':
|
||||
temp = x
|
||||
x = y
|
||||
@@ -352,13 +352,13 @@ class World(object):
|
||||
p = f.split(".")
|
||||
x = int(p[1])
|
||||
y = int(p[2])
|
||||
if self.north_direction == 'upper-right':
|
||||
x = -x-1
|
||||
y = -y-1
|
||||
elif self.north_direction == 'upper-left':
|
||||
if self.north_direction == 'upper-left':
|
||||
temp = x
|
||||
x = -y-1
|
||||
y = temp
|
||||
elif self.north_direction == 'upper-right':
|
||||
x = -x-1
|
||||
y = -y-1
|
||||
elif self.north_direction == 'lower-right':
|
||||
temp = x
|
||||
x = y
|
||||
|
||||
Reference in New Issue
Block a user