Skip to content

Commit bf9a39a

Browse files
committed
Merge branch 'minecraft113' of https://github.com/gmcnew/Minecraft-Overviewer into minecraft113
2 parents 58db16a + 28dd058 commit bf9a39a

File tree

4 files changed

+54
-28
lines changed

4 files changed

+54
-28
lines changed

.travis.yml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ python:
44
- "2.7"
55
# - "3.2"
66
env:
7-
- MC_VERSION=1.12
7+
- MC_VERSION=1.13
88
before_install:
99
- wget https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/Imaging.h
1010
- wget https://raw.githubusercontent.com/python-pillow/Pillow/master/src/libImaging/ImagingUtils.h
@@ -15,7 +15,8 @@ install:
1515
- python setup.py build
1616
before_script:
1717
- git clone git://github.com/overviewer/Minecraft-Overviewer-Addons.git ~/mcoa/
18-
- wget -N https://s3.amazonaws.com/Minecraft.Download/versions/${MC_VERSION}/${MC_VERSION}.jar -P ~/.minecraft/versions/${MC_VERSION}/
18+
- mkdir -p ~/.minecraft/versions/${MC_VERSION}/
19+
- wget -N https://launcher.mojang.com/mc/game/1.13/client/c0b970952cdd279912da384cdbfc0c26e6c6090b/client.jar -O ~/.minecraft/versions/${MC_VERSION}/${MC_VERSION}.jar
1920
script:
2021
- PYTHONPATH=. python test/test_all.py
2122
- python overviewer.py ~/mcoa/exmaple ~/test-output --rendermodes=smooth-lighting -p1

overviewer_core/aux_files/genPOI.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ def handleEntities(rset, config, config_path, filters, markers):
175175
markers[name]['raw'].append(d)
176176
except nbt.CorruptChunkError:
177177
logging.warning("Ignoring POIs in corrupt chunk %d,%d", x,z)
178+
except world.ChunkDoesntExist:
179+
# iterate_chunks() doesn't inspect chunks and filter out
180+
# placeholder ones. It's okay for this chunk to not exist.
181+
pass
178182

179183
else:
180184
buckets = [[] for i in range(numbuckets)];

overviewer_core/tileset.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232

3333
from .util import roundrobin
3434
from . import nbt
35+
from . import world
3536
from .files import FileReplacer, get_fs_caps
3637
from .optimizeimages import optimize_image
3738
import rendermodes
@@ -1065,6 +1066,10 @@ def _render_rendertile(self, tile):
10651066
# A warning and traceback was already printed by world.py's
10661067
# get_chunk()
10671068
logging.debug("Skipping the render of corrupt chunk at %s,%s and moving on.", chunkx, chunkz)
1069+
except world.ChunkDoesntExist:
1070+
# Some chunks are present on disk but not fully initialized.
1071+
# This is okay.
1072+
pass
10681073
except Exception, e:
10691074
logging.error("Could not render chunk %s,%s for some reason. This is likely a render primitive option error.", chunkx, chunkz)
10701075
logging.error("Full error was:", exc_info=1)

overviewer_core/world.py

Lines changed: 42 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -497,22 +497,6 @@ def __init__(self, regiondir, rel):
497497
'minecraft:hopper': (154, 0),
498498
'minecraft:smooth_quartz': (155, 0),
499499
'minecraft:quartz_stairs': (156, 0),
500-
'minecraft:white_terracotta': (159, 0),
501-
'minecraft:orange_terracotta': (159, 1),
502-
'minecraft:magenta_terracotta': (159, 2),
503-
'minecraft:light_blue_terracotta': (159, 3),
504-
'minecraft:yellow_terracotta': (159, 4),
505-
'minecraft:lime_terracotta': (159, 5),
506-
'minecraft:pink_terracotta': (159, 6),
507-
'minecraft:gray_terracotta': (159, 7),
508-
'minecraft:light_gray_terracotta': (159, 8),
509-
'minecraft:cyan_terracotta': (159, 9),
510-
'minecraft:purple_terracotta': (159, 10),
511-
'minecraft:blue_terracotta': (159, 11),
512-
'minecraft:brown_terracotta': (159, 12),
513-
'minecraft:green_terracotta': (159, 13),
514-
'minecraft:red_terracotta': (159, 14),
515-
'minecraft:black_terracotta': (159, 15),
516500
'minecraft:acacia_log': (162, 0),
517501
'minecraft:dark_oak_log': (162, 1),
518502
'minecraft:acacia_stairs': (163, 0),
@@ -649,6 +633,29 @@ def __init__(self, regiondir, rel):
649633
'minecraft:tube_coral_wall_fan': (0, 0),
650634
}
651635

636+
637+
# The following blocks are underwater and are not yet rendered.
638+
# To avoid spurious warnings, we'll treat them as water for now.
639+
treat_as_water = [
640+
'brain_coral', 'brain_coral_block', 'brain_coral_fan', 'brain_coral_wall_fan',
641+
'bubble_coral', 'bubble_coral_block', 'bubble_coral_fan', 'bubble_coral_wall_fan',
642+
'fire_coral', 'fire_coral_block', 'fire_coral_fan', 'fire_coral_wall_fan',
643+
'horn_coral', 'horn_coral_block', 'horn_coral_fan', 'horn_coral_wall_fan',
644+
'tube_coral', 'tube_coral_block', 'tube_coral_fan', 'tube_coral_wall_fan',
645+
'kelp', 'kelp_plant', 'sea_pickle', 'seagrass', 'tall_seagrass',
646+
'bubble_column',
647+
]
648+
for t in treat_as_water:
649+
self._blockmap['minecraft:%s' % t] = (8, 0)
650+
651+
colors = [ 'white', 'orange', 'magenta', 'light_blue',
652+
'yellow', 'lime', 'pink', 'gray',
653+
'light_gray', 'cyan', 'purple', 'blue',
654+
'brown', 'green', 'red', 'black']
655+
for i in range(len(colors)):
656+
self._blockmap['minecraft:%s_terracotta' % colors[i]] = (159, i)
657+
self._blockmap['minecraft:%s_concrete' % colors[i]] = (251, i)
658+
652659
# Re-initialize upon unpickling
653660
def __getstate__(self):
654661
return (self.regiondir, self.rel)
@@ -697,10 +704,10 @@ def _get_block(self, palette_entry):
697704
if p['east'] == 'true': data |= 8
698705
elif key.endswith('_stairs'):
699706
facing = palette_entry['Properties']['facing']
700-
if facing == 'north': data |= 0x20 | 0x40
701-
elif facing == 'west': data |= 0x10 | 0x20
702-
elif facing == 'south': data |= 0x08 | 0x10
703-
elif facing == 'east': data |= 0x08 | 0x40
707+
if facing == 'south': data |= 0x60
708+
elif facing == 'east': data |= 0x30
709+
elif facing == 'north': data |= 0x18
710+
elif facing == 'west': data |= 0x48
704711
elif key.endswith('_door'):
705712
p = palette_entry['Properties']
706713
if p['hinge'] == 'left': data |= 0x10
@@ -738,7 +745,7 @@ def _packed_longarray_to_shorts(self, long_array, n):
738745
bits_per_value = (len(long_array) * 64) / n
739746
if bits_per_value < 4 or 12 < bits_per_value:
740747
raise nbt.CorruptChunkError()
741-
b = numpy.frombuffer(numpy.asarray(long_array), dtype=numpy.uint8)
748+
b = numpy.frombuffer(numpy.asarray(long_array, dtype=numpy.uint64), dtype=numpy.uint8)
742749
if bits_per_value == 8:
743750
result = b.astype(numpy.uint16)
744751
else:
@@ -894,19 +901,28 @@ def get_chunk(self, x, z):
894901
# no exception raised: break out of the loop
895902
break
896903

897-
898904
if data is None:
899905
raise ChunkDoesntExist("Chunk %s,%s doesn't exist" % (x,z))
900906

901907
level = data[1]['Level']
902908
chunk_data = level
903909

910+
# From the interior of a map to the edge, a chunk's status may be one of:
911+
# - postprocessed (interior, or next to fullchunk)
912+
# - fullchunk (next to decorated)
913+
# - decorated (next to liquid_carved)
914+
# - liquid_carved (next to carved)
915+
# - carved (edge of world)
916+
# - empty
917+
# Empty is self-explanatory, and liquid_carved and carved seem to correspond
918+
# to SkyLight not being calculated, which results in mostly-black chunks,
919+
# so we'll just pretend they aren't there.
920+
if chunk_data['Status'] in ("empty", "carved", "liquid_carved", "decorated"):
921+
raise ChunkDoesntExist("Chunk %s,%s doesn't exist" % (x,z))
922+
904923
# Turn the Biomes array into a 16x16 numpy array
905924
biomes = numpy.asarray(chunk_data['Biomes'])
906-
if len(biomes) == 0:
907-
biomes = numpy.zeros((16, 16), dtype=numpy.uint8)
908-
else:
909-
biomes = biomes.reshape((16,16))
925+
biomes = biomes.reshape((16,16))
910926
chunk_data['Biomes'] = biomes
911927

912928
unrecognized_block_types = {}

0 commit comments

Comments
 (0)