From f8d43ca470f4bb82c4988d4e046eff26f2cf768f Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Sun, 16 Oct 2011 15:22:45 -0400 Subject: [PATCH 1/9] region file mtimes are no longer used, to fix a bug on windows --- overviewer_core/quadtree.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/overviewer_core/quadtree.py b/overviewer_core/quadtree.py index 36978f2..114fa8b 100644 --- a/overviewer_core/quadtree.py +++ b/overviewer_core/quadtree.py @@ -439,9 +439,12 @@ class QuadtreeGen(object): needs_rerender = True break - # check region file mtime first. - if regionMtime <= tile_mtime: - continue + # check region file mtime first. + # on windows (and possibly elsewhere) minecraft won't update + # the region file mtime until after shutdown. + # for servers this is unacceptable, so skip this check. + #if regionMtime <= tile_mtime: + # continue # checking chunk mtime if region.get_chunk_timestamp(chunkx, chunky) > tile_mtime: From aa7a837043f179a838f3d76422f47b7bb89fd305 Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Wed, 26 Oct 2011 15:14:48 -0400 Subject: [PATCH 2/9] fixed segfault involving redstone on the edge of the map (Issue #519) --- overviewer_core/src/iterate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overviewer_core/src/iterate.c b/overviewer_core/src/iterate.c index 74c7904..44f30f8 100644 --- a/overviewer_core/src/iterate.c +++ b/overviewer_core/src/iterate.c @@ -193,7 +193,7 @@ generate_pseudo_data(RenderState *state, unsigned char ancilData) { unsigned char above_level_data = 0, same_level_data = 0, below_level_data = 0, possibly_connected = 0, final_data = 0; /* check for air in z+1, no air = no connection with upper level */ - if ((z != 127) && (getArrayByte3D(state->left_blocks, x, y, z) == 0)) { + if ((z != 127) && (getArrayByte3D(state->blocks, x, y, z + 1) == 0)) { above_level_data = check_adjacent_blocks(state, x, y, z + 1, state->block); } /* else above_level_data = 0 */ From f07cf1e0d86cc1e4b4d4bff2700eb4c1ef4b8922 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Wed, 26 Oct 2011 21:19:53 -0400 Subject: [PATCH 3/9] imporoved doc page cross-referencing --- docs/building.rst | 14 +++++++++----- docs/index.rst | 8 +++++--- docs/installing.rst | 8 ++++---- 3 files changed, 18 insertions(+), 12 deletions(-) diff --git a/docs/building.rst b/docs/building.rst index 21f4371..f62cb8b 100644 --- a/docs/building.rst +++ b/docs/building.rst @@ -2,11 +2,15 @@ Building the Overviewer from Source =================================== -These instructions are for building the C extension for Overviewer. Also note -that pre-built Windows and Debian executables are available in the `Downloads -`_ section. These -kits already contain the compiled extension and require no further setup (so you -can skip to the :doc:`Running ` section of the docs). +These instructions are for building the C extension for Overviewer. Once you +have finished with these instructions, head to :doc:`running`. + +.. note:: + + Pre-built Windows and Debian executables are available on the + :doc:`installing` page. These kits already contain the compiled code and + require no further setup, so you can skip to the next section of the docs: + :doc:`running`. Get The Source ============== diff --git a/docs/index.rst b/docs/index.rst index 57b1663..c990364 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -54,8 +54,10 @@ Windows, Mac, and Linux as long as you have these software packages installed: * Either a Minecraft Client installed or a terrain.png for the textures. -There are additional requirements for compiling it. More details are available -in either the :doc:`Building ` or :doc:`Installing ` pages. +The first three are included in the Windows binary download. Also, there are +additional requirements for compiling it (like a compiler). More details are +available in either the :doc:`Building ` or :doc:`Installing +` pages. Getting Started =============== @@ -92,8 +94,8 @@ Documentation Contents .. toctree:: :maxdepth: 2 - building installing + building running options faq diff --git a/docs/installing.rst b/docs/installing.rst index a9b5b4b..aeb41cd 100644 --- a/docs/installing.rst +++ b/docs/installing.rst @@ -3,8 +3,9 @@ Installing ========== This page is for installing the pre-compiled binary versions of the Overviewer. -If you have built the Overviewer from source yourself, head back to -:doc:`Building `. +If you want to build the Overviewer from source yourself, head to :doc:`Building +`. If you have already built The Overviewer, proceed to +:doc:`running`. Windows @@ -18,8 +19,7 @@ right place! For 64 bit, you'll want these instead: `VC++ 2008 `_ and `VC++ 2010 `_ -3. That's it! Proceed with instructions on :doc:`Running ` the - Overviewer. +3. That's it! Proceed with instructions on :doc:`running`. Debian / Ubuntu =============== From a470ff50d6225d3343e3aac8f601848f669a5dde Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Wed, 26 Oct 2011 21:34:46 -0400 Subject: [PATCH 4/9] added question headers to faq site and added an faq on windows cmd --- docs/faq.rst | 61 +++++++++++++++++++++++++++++++++++++++------------- 1 file changed, 46 insertions(+), 15 deletions(-) diff --git a/docs/faq.rst b/docs/faq.rst index f9790a1..213d1d9 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -2,22 +2,53 @@ Frequently Asked Questions ========================== -**The full map doesn't display even when fully zoomed out!** - Are you using the :option:`-z` or :option:`--zoom <-z>` option on your commandline or - in settings.py? If so, try removing it, or increasing the value you set. - It's quite likely you don't need it at all. See the documentation for the - :option:`zoom <-z>` option. +.. contents:: + :local: -**You've added a few feature, but it's not showing up on my map!** - Some new features will only show up in newly-rendered areas. Use the - :option:`--forcerender` option to update the entire map. +General Questions +================= -**How do I use this on CentOS 5?** - CentOS 5 comes with Python 2.4, but the Overviewer needs 2.6 or higher. See - the special instructions at :ref:`centos` +The full map doesn't display even when fully zoomed out! +-------------------------------------------------------- -**The background color of the map is black, and I don't like it!** - You can change this by using the :option:`--bg-color` command line option, or - ``bg_color`` in settings.py. See the :doc:`options` page for more - details. +Are you using the :option:`-z` or :option:`--zoom <-z>` option on your +commandline or in settings.py? If so, try removing it, or increasing the value +you set. It's quite likely you don't need it at all. See the documentation for +the :option:`zoom <-z>` option. +You've added a few feature, but it's not showing up on my map! +-------------------------------------------------------------- + +Some new features will only show up in newly-rendered areas. Use the +:option:`--forcerender` option to update the entire map. + +How do I use this on CentOS 5? +------------------------------ + +CentOS 5 comes with Python 2.4, but the Overviewer needs 2.6 or higher. See the +special instructions at :ref:`centos` + +The background color of the map is black, and I don't like it! +-------------------------------------------------------------- + +You can change this by using the :option:`--bg-color` command line option, or +``bg_color`` in settings.py. See the :doc:`options` page for more details. + +I downloaded the Windows version but when I double-click it, the window closes real fast. +----------------------------------------------------------------------------------------- + +The Overviewer is a command line program and must be run from a command line. It +is necessary to become at least a little familiar with a command line to run The +Overviewer (if you have no interest in this, perhaps this isn't the mapping +program for you). + +Unfortunately, A full tutorial of the Windows command line is out of scope for this +documentation; consult the almighty Google for tutorials and information on +the Windows command line. (If you would like to contribute a short tutorial to +these docs, please do!) + +Batch files are another easy way to run the Overviewer without messing with +command lines, but information on how to do this has also not been written. + +On a related note, we also welcome contributions for a graphical interface for +the Overviewer. From b31160e3ade6277b77363cad28a2354200333337 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Wed, 26 Oct 2011 22:00:25 -0400 Subject: [PATCH 5/9] more minor clarifications --- docs/building.rst | 18 ++++++++++++++---- docs/index.rst | 15 ++++++++++----- 2 files changed, 24 insertions(+), 9 deletions(-) diff --git a/docs/building.rst b/docs/building.rst index f62cb8b..9dbfe27 100644 --- a/docs/building.rst +++ b/docs/building.rst @@ -14,13 +14,18 @@ have finished with these instructions, head to :doc:`running`. Get The Source ============== -First step: download the source! Either clone with Git or download the most recent snapshot -* URL to clone: ``git://github.com/overviewer/Minecraft-Overviewer.git`` +First step: download the platform-independent source! Either clone with Git +(recommended if you know Git) or download the most recent snapshot + +* Git URL to clone: ``git://github.com/overviewer/Minecraft-Overviewer.git`` * `Download most recent tar archive `_ * `Download most recent zip archive `_ +Once you have the source, see below for instructions on building for your +system. + Build Instructions For Various Operating Systems ================================================ @@ -161,5 +166,10 @@ regular user. Installing the Compiled Code ---------------------------- -You can run the ``overviewer.py`` script from the build directory just fine. If -you'd like to install, run ``python setup.py install`` + +You can run the ``overviewer.py`` script from the build directory just fine; +installation is unnecessary. If you'd like to install, run + +:: + + python setup.py install diff --git a/docs/index.rst b/docs/index.rst index c990364..b471a14 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -6,6 +6,10 @@ The Minecraft Overviewer ======================== +See also the `Github Homepage`_ + +.. _Github Homepage: https://github.com/overviewer/Minecraft-Overviewer + Introduction ============ The Minecraft Overviewer is a command-line tool for rendering high-resolution @@ -54,10 +58,9 @@ Windows, Mac, and Linux as long as you have these software packages installed: * Either a Minecraft Client installed or a terrain.png for the textures. -The first three are included in the Windows binary download. Also, there are -additional requirements for compiling it (like a compiler). More details are -available in either the :doc:`Building ` or :doc:`Installing -` pages. +The first three are included in the Windows download. Also, there are additional +requirements for compiling it (like a compiler). More details are available in +either the :doc:`Building ` or :doc:`Installing ` pages. Getting Started =============== @@ -73,7 +76,9 @@ packages and don't want to have to compile anything yourself**, head to the **If you would like to build the Overviewer from source yourself (it's not that bad)**, head to the :doc:`Building ` page. -.. _Github Homepage: https://github.com/overviewer/Minecraft-Overviewer +**For all other platforms** you will need to build it yourself. +:doc:`building`. + Help ==== From f5ae4b34511a26cc864259b5cc0adcb3b936b550 Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Wed, 26 Oct 2011 22:36:23 -0400 Subject: [PATCH 6/9] changed bare exceptions to except Exception --- overviewer.py | 2 +- overviewer_core/textures.py | 4 ++-- overviewer_core/util.py | 6 +++--- setup.py | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/overviewer.py b/overviewer.py index 3399424..9f58ed0 100755 --- a/overviewer.py +++ b/overviewer.py @@ -139,7 +139,7 @@ def main(): print "Git commit: %s" % overviewer_version.HASH print "built on %s" % overviewer_version.BUILD_DATE print "Build machine: %s %s" % (overviewer_version.BUILD_PLATFORM, overviewer_version.BUILD_OS) - except: + except Exception: print "version info not found" pass sys.exit(0) diff --git a/overviewer_core/textures.py b/overviewer_core/textures.py index 48a2f20..c7e58d8 100644 --- a/overviewer_core/textures.py +++ b/overviewer_core/textures.py @@ -2255,7 +2255,7 @@ def prepareBiomeData(worlddir): try: grasscolor = list(Image.open(os.path.join(biomeDir,"grasscolor.png")).getdata()) foliagecolor = list(Image.open(os.path.join(biomeDir,"foliagecolor.png")).getdata()) - except: + except Exception: # clear anything that managed to get set grasscolor = None foliagecolor = None @@ -2316,7 +2316,7 @@ def loadLightColor(): lightcolor_checked = True try: lightcolor = list(_load_image("light_normal.png").getdata()) - except: + except Exception: logging.warning("Light color image could not be found.") lightcolor = None return lightcolor diff --git a/overviewer_core/util.py b/overviewer_core/util.py index d6c8959..2e51a55 100644 --- a/overviewer_core/util.py +++ b/overviewer_core/util.py @@ -52,7 +52,7 @@ def findGitHash(): try: import overviewer_version return overviewer_version.HASH - except: + except Exception: return "unknown" def findGitVersion(): @@ -68,9 +68,9 @@ def findGitVersion(): # and 0.1.3 into 0.1.3 line = '-'.join(line.split('-', 2)[:2]) return line.strip() - except: + except Exception: try: import overviewer_version return overviewer_version.VERSION - except: + except Exception: return "unknown" diff --git a/setup.py b/setup.py index cd1b7d0..2cfe65a 100755 --- a/setup.py +++ b/setup.py @@ -142,7 +142,7 @@ except AttributeError: try: pil_include = os.environ['PIL_INCLUDE_DIR'].split(os.pathsep) -except: +except Exception: pil_include = [ os.path.join(get_python_inc(plat_specific=1), 'Imaging') ] if not os.path.exists(pil_include[0]): pil_include = [ ] @@ -221,7 +221,7 @@ def generate_version_py(): f = open("overviewer_core/overviewer_version.py", "w") f.write(outstr) f.close() - except: + except Exception: print "WARNING: failed to build overviewer_version file" class CustomSDist(sdist): From 4327eef475c58c1daf33d99bbc632ca0d38cbd36 Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Wed, 26 Oct 2011 22:34:34 -0400 Subject: [PATCH 7/9] Provide a useful message if overviewer is doubleclicked. Works for both py2exe .exes as well as double clicking the overviewer.py file --- overviewer.py | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/overviewer.py b/overviewer.py index 9f58ed0..6992fdc 100755 --- a/overviewer.py +++ b/overviewer.py @@ -15,7 +15,25 @@ # You should have received a copy of the GNU General Public License along # with the Overviewer. If not, see . +import platform import sys + +if platform.system() == 'Windows': + try: + import ctypes + GetConsoleProcessList = ctypes.windll.kernel32.GetConsoleProcessList + num = GetConsoleProcessList(ctypes.byref(ctypes.c_int(0)), ctypes.c_int(1)) + if (num == 1): + print "The Overviewer is a console program. Please open a Windows command prompt" + print "first and run Overviewer from there. Further documentation is available at" + print "http://docs.overviewer.org/\n" + print "Press [Enter] to close this window." + raw_input() + sys.exit(1) + + except Exception: + pass + if not (sys.version_info[0] == 2 and sys.version_info[1] >= 6): print "Sorry, the Overviewer requires at least Python 2.6 to run" if sys.version_info[0] >= 3: @@ -29,7 +47,6 @@ import subprocess import multiprocessing import time import logging -import platform from overviewer_core import util logging.basicConfig(level=logging.INFO,format="%(asctime)s [%(levelname)s] %(message)s") From 02c30c6f8e3c44267f8d902e4047d5c9ba0e6767 Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Wed, 26 Oct 2011 23:06:52 -0400 Subject: [PATCH 8/9] Update URL hash on double-click --- overviewer_core/data/web_assets/overviewer.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/overviewer_core/data/web_assets/overviewer.js b/overviewer_core/data/web_assets/overviewer.js index 34fbfe8..02fa8d9 100644 --- a/overviewer_core/data/web_assets/overviewer.js +++ b/overviewer_core/data/web_assets/overviewer.js @@ -261,6 +261,9 @@ var overviewer = { google.maps.event.addListener(overviewer.map, 'zoom_changed', function() { overviewer.util.updateHash(); }); + google.maps.event.addListener(overviewer.map, 'dblclick', function() { + overviewer.util.updateHash(); + }); // Make the link again whenever the map changes google.maps.event.addListener(overviewer.map, 'maptypeid_changed', function() { From bc9d368ae8b67f5bbaf8d140f31203d27c1bfd6c Mon Sep 17 00:00:00 2001 From: Andrew Brown Date: Thu, 27 Oct 2011 01:02:36 -0400 Subject: [PATCH 9/9] added section about biome support to docs --- docs/running.rst | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/docs/running.rst b/docs/running.rst index e5d873c..adc93c7 100644 --- a/docs/running.rst +++ b/docs/running.rst @@ -137,3 +137,23 @@ modification times intact, use ``cp -p``. For people who render from backups, GNU ``tar`` automatically handles modification times correctly. ``rsync -a`` will handle this correctly as well. If you use some other tool, you'll have to figure out how to do this yourself. + +Biome Support +============= + +Minecraft Overviewer has support for using the biome info from the `Minecraft +Biome Extractor`_. If you run the biome extractor on your world, during the +next run Overviewer will automatically recognize the biome info and use it to +colorize your grass and leaves appropriately. This will only appear on updated +chunks, though; to colorize the entire world you will need to re-render from +scratch by using :option:`--forcerender` + +.. note:: + + as of Minecraft 1.8, you currently need to use a patched Biome Extractor + that can be found `here + `_, + or `here on GitHub + `_. + +.. _Minecraft Biome Extractor: http://www.minecraftforum.net/viewtopic.php?f=25&t=80902