From 53bb352246c0f591e9f14d472196250fb99b3585 Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Tue, 7 Aug 2018 08:37:41 -0400 Subject: [PATCH 1/6] Update travis to use 1.13 textures --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ad6acd8..6160ff4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,7 @@ python: - "2.7" # - "3.2" env: - - MC_VERSION=1.12 + - MC_VERSION=1.13 before_install: - wget https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/Imaging.h - wget https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/ImagingUtils.h From 01058baf2c6b8b8399d59c8bdd6a6fb7c1f17641 Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Tue, 7 Aug 2018 09:01:53 -0400 Subject: [PATCH 2/6] Use hard-coded 1.13 client jar URL in travis config --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6160ff4..f932d61 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,7 @@ install: - python setup.py build before_script: - git clone git://github.com/overviewer/Minecraft-Overviewer-Addons.git ~/mcoa/ - - wget -N https://s3.amazonaws.com/Minecraft.Download/versions/${MC_VERSION}/${MC_VERSION}.jar -P ~/.minecraft/versions/${MC_VERSION}/ + - wget -N https://launcher.mojang.com/mc/game/1.13/client/c0b970952cdd279912da384cdbfc0c26e6c6090b/client.jar -P ~/.minecraft/versions/${MC_VERSION}/ -O ${MC_VERSION}.jar script: - PYTHONPATH=. python test/test_all.py - python overviewer.py ~/mcoa/exmaple ~/test-output --rendermodes=smooth-lighting -p1 From d73242454430a15fe345e933644ef83c747f712c Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Tue, 7 Aug 2018 09:28:05 -0400 Subject: [PATCH 3/6] Yet another attempt to get travis working I am bad at this --- .travis.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index f932d61..b504dc5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -15,7 +15,8 @@ install: - python setup.py build before_script: - git clone git://github.com/overviewer/Minecraft-Overviewer-Addons.git ~/mcoa/ - - wget -N https://launcher.mojang.com/mc/game/1.13/client/c0b970952cdd279912da384cdbfc0c26e6c6090b/client.jar -P ~/.minecraft/versions/${MC_VERSION}/ -O ${MC_VERSION}.jar + - mkdir -p ~/.minecraft/versions/${MC_VERSION}/ + - wget -N https://launcher.mojang.com/mc/game/1.13/client/c0b970952cdd279912da384cdbfc0c26e6c6090b/client.jar -O ~/.minecraft/versions/${MC_VERSION}/${MC_VERSION}.jar script: - PYTHONPATH=. python test/test_all.py - python overviewer.py ~/mcoa/exmaple ~/test-output --rendermodes=smooth-lighting -p1 From 7236aefc94b9d7649f885a035617262b31ce0a47 Mon Sep 17 00:00:00 2001 From: gmcnew Date: Tue, 7 Aug 2018 22:52:32 +0000 Subject: [PATCH 4/6] Misc fixes --- overviewer_core/aux_files/genPOI.py | 4 + overviewer_core/tileset.py | 5 ++ overviewer_core/world.py | 113 +++++++++++----------------- 3 files changed, 52 insertions(+), 70 deletions(-) diff --git a/overviewer_core/aux_files/genPOI.py b/overviewer_core/aux_files/genPOI.py index 9fd8704..2f99757 100755 --- a/overviewer_core/aux_files/genPOI.py +++ b/overviewer_core/aux_files/genPOI.py @@ -175,6 +175,10 @@ def handleEntities(rset, config, config_path, filters, markers): markers[name]['raw'].append(d) except nbt.CorruptChunkError: logging.warning("Ignoring POIs in corrupt chunk %d,%d", x,z) + except world.ChunkDoesntExist: + # iterate_chunks() doesn't inspect chunks and filter out + # placeholder ones. It's okay for this chunk to not exist. + pass else: buckets = [[] for i in range(numbuckets)]; diff --git a/overviewer_core/tileset.py b/overviewer_core/tileset.py index c3de7f6..6c7a331 100644 --- a/overviewer_core/tileset.py +++ b/overviewer_core/tileset.py @@ -32,6 +32,7 @@ from PIL import Image from .util import roundrobin from . import nbt +from . import world from .files import FileReplacer, get_fs_caps from .optimizeimages import optimize_image import rendermodes @@ -1065,6 +1066,10 @@ class TileSet(object): # A warning and traceback was already printed by world.py's # get_chunk() logging.debug("Skipping the render of corrupt chunk at %s,%s and moving on.", chunkx, chunkz) + except world.ChunkDoesntExist: + # Some chunks are present on disk but not fully initialized. + # This is okay. + pass except Exception, e: logging.error("Could not render chunk %s,%s for some reason. This is likely a render primitive option error.", chunkx, chunkz) logging.error("Full error was:", exc_info=1) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index db6a43f..26e351b 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -424,6 +424,7 @@ class RegionSet(object): 'minecraft:red_brick_stairs': (108, 0), 'minecraft:stone_brick_stairs': (109, 0), 'minecraft:lily_pad': (111, 0), + 'minecraft:nether_bricks': (112, 0), 'minecraft:nether_brick_fence': (113, 0), 'minecraft:nether_brick_stairs': (114, 0), 'minecraft:nether_wart': (115, 0), @@ -442,22 +443,6 @@ class RegionSet(object): 'minecraft:nether_quartz_ore': (153, 0), 'minecraft:hopper': (154, 0), 'minecraft:quartz_stairs': (156, 0), - 'minecraft:white_terracotta': (159, 0), - 'minecraft:orange_terracotta': (159, 1), - 'minecraft:magenta_terracotta': (159, 2), - 'minecraft:light_blue_terracotta': (159, 3), - 'minecraft:yellow_terracotta': (159, 4), - 'minecraft:lime_terracotta': (159, 5), - 'minecraft:pink_terracotta': (159, 6), - 'minecraft:gray_terracotta': (159, 7), - 'minecraft:light_gray_terracotta': (159, 8), - 'minecraft:cyan_terracotta': (159, 9), - 'minecraft:purple_terracotta': (159, 10), - 'minecraft:blue_terracotta': (159, 11), - 'minecraft:brown_terracotta': (159, 12), - 'minecraft:green_terracotta': (159, 13), - 'minecraft:red_terracotta': (159, 14), - 'minecraft:black_terracotta': (159, 15), 'minecraft:acacia_log': (162, 0), 'minecraft:dark_oak_log': (162, 1), 'minecraft:acacia_stairs': (163, 0), @@ -487,53 +472,32 @@ class RegionSet(object): 'minecraft:purpur_stairs': (203, 0), 'minecraft:grass_path': (208, 0), 'minecraft:magma_block': (213, 0), - 'minecraft:white_concrete': (251, 0), - 'minecraft:orange_concrete': (251, 1), - 'minecraft:magenta_concrete': (251, 2), - 'minecraft:light_blue_concrete': (251, 3), - 'minecraft:yellow_concrete': (251, 4), - 'minecraft:lime_concrete': (251, 5), - 'minecraft:pink_concrete': (251, 6), - 'minecraft:gray_concrete': (251, 7), - 'minecraft:light_gray_concrete': (251, 8), - 'minecraft:cyan_concrete': (251, 9), - 'minecraft:purple_concrete': (251, 10), - 'minecraft:blue_concrete': (251, 11), - 'minecraft:brown_concrete': (251, 12), - 'minecraft:green_concrete': (251, 13), - 'minecraft:red_concrete': (251, 14), - 'minecraft:black_concrete': (251, 15), - - # The following blocks are underwater and are not yet rendered. - # To avoid spurious warnings, we'll treat them as air for now. - 'minecraft:brain_coral': (0, 0), - 'minecraft:brain_coral_block': (0, 0), - 'minecraft:brain_coral_fan': (0, 0), - 'minecraft:brain_coral_wall_fan': (0, 0), - 'minecraft:bubble_column': (0, 0), - 'minecraft:bubble_coral': (0, 0), - 'minecraft:bubble_coral_block': (0, 0), - 'minecraft:bubble_coral_fan': (0, 0), - 'minecraft:bubble_coral_wall_fan': (0, 0), - 'minecraft:fire_coral': (0, 0), - 'minecraft:fire_coral_block': (0, 0), - 'minecraft:fire_coral_fan': (0, 0), - 'minecraft:fire_coral_wall_fan': (0, 0), - 'minecraft:horn_coral': (0, 0), - 'minecraft:horn_coral_block': (0, 0), - 'minecraft:horn_coral_fan': (0, 0), - 'minecraft:horn_coral_wall_fan': (0, 0), - 'minecraft:kelp': (0, 0), - 'minecraft:kelp_plant': (0, 0), - 'minecraft:sea_pickle': (0, 0), - 'minecraft:seagrass': (0, 0), - 'minecraft:tall_seagrass': (0, 0), - 'minecraft:tube_coral': (0, 0), - 'minecraft:tube_coral_block': (0, 0), - 'minecraft:tube_coral_fan': (0, 0), - 'minecraft:tube_coral_wall_fan': (0, 0), + 'minecraft:red_nether_bricks': (215, 0), } + + # The following blocks are underwater and are not yet rendered. + # To avoid spurious warnings, we'll treat them as water for now. + treat_as_water = [ + 'brain_coral', 'brain_coral_block', 'brain_coral_fan', 'brain_coral_wall_fan', + 'bubble_coral', 'bubble_coral_block', 'bubble_coral_fan', 'bubble_coral_wall_fan', + 'fire_coral', 'fire_coral_block', 'fire_coral_fan', 'fire_coral_wall_fan', + 'horn_coral', 'horn_coral_block', 'horn_coral_fan', 'horn_coral_wall_fan', + 'tube_coral', 'tube_coral_block', 'tube_coral_fan', 'tube_coral_wall_fan', + 'kelp', 'kelp_plant', 'sea_pickle', 'seagrass', 'tall_seagrass', + 'bubble_column', + ] + for t in treat_as_water: + self._blockmap['minecraft:%s' % t] = (8, 0) + + colors = [ 'white', 'orange', 'magenta', 'light_blue', + 'yellow', 'lime', 'pink', 'gray', + 'light_gray', 'cyan', 'purple', 'blue', + 'brown', 'green', 'red', 'black'] + for i in range(len(colors)): + self._blockmap['minecraft:%s_terracotta' % colors[i]] = (159, i) + self._blockmap['minecraft:%s_concrete' % colors[i]] = (251, i) + # Re-initialize upon unpickling def __getstate__(self): return (self.regiondir, self.rel) @@ -582,10 +546,10 @@ class RegionSet(object): if p['east'] == 'true': data |= 8 elif key.endswith('_stairs'): facing = palette_entry['Properties']['facing'] - if facing == 'north': data |= 0x20 | 0x40 - elif facing == 'west': data |= 0x10 | 0x20 - elif facing == 'south': data |= 0x08 | 0x10 - elif facing == 'east': data |= 0x08 | 0x40 + if facing == 'south': data |= 0x60 + elif facing == 'east': data |= 0x30 + elif facing == 'north': data |= 0x18 + elif facing == 'west': data |= 0x48 elif key.endswith('_door'): p = palette_entry['Properties'] if p['hinge'] == 'left': data |= 0x10 @@ -779,19 +743,28 @@ class RegionSet(object): # no exception raised: break out of the loop break - if data is None: raise ChunkDoesntExist("Chunk %s,%s doesn't exist" % (x,z)) level = data[1]['Level'] chunk_data = level + # From the interior of a map to the edge, a chunk's status may be one of: + # - postprocessed (interior, or next to fullchunk) + # - fullchunk (next to decorated) + # - decorated (next to liquid_carved) + # - liquid_carved (next to carved) + # - carved (edge of world) + # - empty + # Empty is self-explanatory, and liquid_carved and carved seem to correspond + # to SkyLight not being calculated, which results in mostly-black chunks, + # so we'll just pretend they aren't there. + if chunk_data['Status'] in ("empty", "carved", "liquid_carved"): + raise ChunkDoesntExist("Chunk %s,%s doesn't exist" % (x,z)) + # Turn the Biomes array into a 16x16 numpy array biomes = numpy.asarray(chunk_data['Biomes']) - if len(biomes) == 0: - biomes = numpy.zeros((16, 16), dtype=numpy.uint8) - else: - biomes = biomes.reshape((16,16)) + biomes = biomes.reshape((16,16)) chunk_data['Biomes'] = biomes unrecognized_block_types = {} From e6ea08021ef5a0c205955d5d07cddc785f4ffaed Mon Sep 17 00:00:00 2001 From: Aaron Griffith Date: Tue, 7 Aug 2018 20:09:30 -0400 Subject: [PATCH 5/6] Always interpret long_array as 64-bit previously, some arrays could (by chance) be interpreted as smaller integers --- overviewer_core/world.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index 26e351b..d13b181 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -587,7 +587,7 @@ class RegionSet(object): bits_per_value = (len(long_array) * 64) / n if bits_per_value < 4 or 12 < bits_per_value: raise nbt.CorruptChunkError() - b = numpy.frombuffer(numpy.asarray(long_array), dtype=numpy.uint8) + b = numpy.frombuffer(numpy.asarray(long_array, dtype=numpy.uint64), dtype=numpy.uint8) if bits_per_value == 8: result = b.astype(numpy.uint16) else: From 28dd0589b367de97e4f2935d194961202cc77021 Mon Sep 17 00:00:00 2001 From: Andrew Chin Date: Tue, 7 Aug 2018 20:24:42 -0400 Subject: [PATCH 6/6] ignore "decorated" chunks This seems to fix lighting problems by ignoring chunks with no lighting (wiki suggests that "decorating" happens before "lighting") --- overviewer_core/world.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/overviewer_core/world.py b/overviewer_core/world.py index d13b181..97c01c6 100644 --- a/overviewer_core/world.py +++ b/overviewer_core/world.py @@ -759,7 +759,7 @@ class RegionSet(object): # Empty is self-explanatory, and liquid_carved and carved seem to correspond # to SkyLight not being calculated, which results in mostly-black chunks, # so we'll just pretend they aren't there. - if chunk_data['Status'] in ("empty", "carved", "liquid_carved"): + if chunk_data['Status'] in ("empty", "carved", "liquid_carved", "decorated"): raise ChunkDoesntExist("Chunk %s,%s doesn't exist" % (x,z)) # Turn the Biomes array into a 16x16 numpy array