Merge pull request #1550 from InrcedibleHolg/master
Rebased to clean the git history a little.
This commit is contained in:
@@ -78,7 +78,8 @@ const mc_block_t block_class_stair[] = {
|
|||||||
block_red_sandstone_stairs,
|
block_red_sandstone_stairs,
|
||||||
block_purpur_stairs,
|
block_purpur_stairs,
|
||||||
block_prismarine_stairs,
|
block_prismarine_stairs,
|
||||||
block_dark_prismarine_stairs
|
block_dark_prismarine_stairs,
|
||||||
|
block_prismarine_brick_stairs
|
||||||
};
|
};
|
||||||
const size_t block_class_stair_len = COUNT_OF(block_class_stair);
|
const size_t block_class_stair_len = COUNT_OF(block_class_stair);
|
||||||
|
|
||||||
@@ -138,6 +139,7 @@ const mc_block_t block_class_ancil[] = {
|
|||||||
block_purpur_stairs,
|
block_purpur_stairs,
|
||||||
block_prismarine_stairs,
|
block_prismarine_stairs,
|
||||||
block_dark_prismarine_stairs,
|
block_dark_prismarine_stairs,
|
||||||
|
block_prismarine_brick_stairs,
|
||||||
block_grass,
|
block_grass,
|
||||||
block_flowing_water,
|
block_flowing_water,
|
||||||
block_water,
|
block_water,
|
||||||
@@ -181,6 +183,10 @@ const mc_block_t block_class_alt_height[] = {
|
|||||||
block_red_sandstone_stairs,
|
block_red_sandstone_stairs,
|
||||||
block_prismarine_stairs,
|
block_prismarine_stairs,
|
||||||
block_dark_prismarine_stairs,
|
block_dark_prismarine_stairs,
|
||||||
|
block_prismarine_brick_stairs,
|
||||||
|
block_prismarine_slab,
|
||||||
|
block_dark_prismarine_slab,
|
||||||
|
block_prismarine_brick_slab,
|
||||||
block_stone_slab2,
|
block_stone_slab2,
|
||||||
block_purpur_stairs,
|
block_purpur_stairs,
|
||||||
block_purpur_slab,
|
block_purpur_slab,
|
||||||
|
|||||||
@@ -259,7 +259,11 @@ enum mc_block_id
|
|||||||
block_concrete_powder = 252,
|
block_concrete_powder = 252,
|
||||||
block_structure_block = 255,
|
block_structure_block = 255,
|
||||||
block_prismarine_stairs = 11337,
|
block_prismarine_stairs = 11337,
|
||||||
block_dark_prismarine_stairs = 11338
|
block_dark_prismarine_stairs = 11338,
|
||||||
|
block_prismarine_brick_stairs = 11339,
|
||||||
|
block_prismarine_slab = 11340,
|
||||||
|
block_dark_prismarine_slab = 11341,
|
||||||
|
block_prismarine_brick_slab = 11342
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef uint16_t mc_block_t;
|
typedef uint16_t mc_block_t;
|
||||||
|
|||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
// increment this value if you've made a change to the c extesion
|
// increment this value if you've made a change to the c extesion
|
||||||
// and want to force users to rebuild
|
// and want to force users to rebuild
|
||||||
#define OVERVIEWER_EXTENSION_VERSION 59
|
#define OVERVIEWER_EXTENSION_VERSION 60
|
||||||
|
|
||||||
/* Python PIL, and numpy headers */
|
/* Python PIL, and numpy headers */
|
||||||
#include <Python.h>
|
#include <Python.h>
|
||||||
|
|||||||
@@ -1707,8 +1707,8 @@ block(blockid=42, top_image="assets/minecraft/textures/block/iron_block.png")
|
|||||||
|
|
||||||
# double slabs and slabs
|
# double slabs and slabs
|
||||||
# these wooden slabs are unobtainable without cheating, they are still
|
# these wooden slabs are unobtainable without cheating, they are still
|
||||||
# here because lots of pre-1.3 worlds use this blocks
|
# here because lots of pre-1.3 worlds use this blocks, add prismarine slabs
|
||||||
@material(blockid=[43, 44, 181, 182, 204, 205], data=range(16), transparent=(44,182,205), solid=True)
|
@material(blockid=[43, 44, 181, 182, 204, 205,11340,11341,11342], data=range(16), transparent=(44,182,205), solid=True)
|
||||||
def slabs(self, blockid, data):
|
def slabs(self, blockid, data):
|
||||||
if blockid == 44 or blockid == 182:
|
if blockid == 44 or blockid == 182:
|
||||||
texture = data & 7
|
texture = data & 7
|
||||||
@@ -1759,6 +1759,12 @@ def slabs(self, blockid, data):
|
|||||||
elif blockid == 204 or blockid == 205: # purpur slab (single=205 double=204)
|
elif blockid == 204 or blockid == 205: # purpur slab (single=205 double=204)
|
||||||
top = side = self.load_image_texture("assets/minecraft/textures/block/purpur_block.png");
|
top = side = self.load_image_texture("assets/minecraft/textures/block/purpur_block.png");
|
||||||
|
|
||||||
|
elif blockid == 11340: # prismarine slabs
|
||||||
|
top = side = self.load_image_texture("assets/minecraft/textures/block/prismarine.png").copy()
|
||||||
|
elif blockid == 11341: # dark prismarine slabs
|
||||||
|
top = side = self.load_image_texture("assets/minecraft/textures/block/dark_prismarine.png").copy()
|
||||||
|
elif blockid == 11342: # prismarine brick slabs
|
||||||
|
top = side = self.load_image_texture("assets/minecraft/textures/block/prismarine_bricks.png").copy()
|
||||||
|
|
||||||
if blockid == 43 or blockid == 181 or blockid == 204: # double slab
|
if blockid == 43 or blockid == 181 or blockid == 204: # double slab
|
||||||
return self.build_block(top, side)
|
return self.build_block(top, side)
|
||||||
@@ -1867,7 +1873,7 @@ def fire(self, blockid, data):
|
|||||||
block(blockid=52, top_image="assets/minecraft/textures/block/spawner.png", transparent=True)
|
block(blockid=52, top_image="assets/minecraft/textures/block/spawner.png", transparent=True)
|
||||||
|
|
||||||
# wooden, cobblestone, red brick, stone brick, netherbrick, sandstone, spruce, birch, jungle, quartz, red sandstone and (dark) prismarine stairs.
|
# wooden, cobblestone, red brick, stone brick, netherbrick, sandstone, spruce, birch, jungle, quartz, red sandstone and (dark) prismarine stairs.
|
||||||
@material(blockid=[53,67,108,109,114,128,134,135,136,156,163,164,180,203,11337,11338], data=range(128), transparent=True, solid=True, nospawn=True)
|
@material(blockid=[53,67,108,109,114,128,134,135,136,156,163,164,180,203,11337,11338,11339], data=range(128), transparent=True, solid=True, nospawn=True)
|
||||||
def stairs(self, blockid, data):
|
def stairs(self, blockid, data):
|
||||||
# preserve the upside-down bit
|
# preserve the upside-down bit
|
||||||
upside_down = data & 0x4
|
upside_down = data & 0x4
|
||||||
@@ -1912,6 +1918,8 @@ def stairs(self, blockid, data):
|
|||||||
texture = self.load_image_texture("assets/minecraft/textures/block/prismarine.png").copy()
|
texture = self.load_image_texture("assets/minecraft/textures/block/prismarine.png").copy()
|
||||||
elif blockid == 11338: # dark prismarine stairs
|
elif blockid == 11338: # dark prismarine stairs
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/dark_prismarine.png").copy()
|
texture = self.load_image_texture("assets/minecraft/textures/block/dark_prismarine.png").copy()
|
||||||
|
elif blockid == 11339: # prismarine brick stairs
|
||||||
|
texture = self.load_image_texture("assets/minecraft/textures/block/prismarine_bricks.png").copy()
|
||||||
|
|
||||||
outside_l = texture.copy()
|
outside_l = texture.copy()
|
||||||
outside_r = texture.copy()
|
outside_r = texture.copy()
|
||||||
|
|||||||
@@ -626,6 +626,7 @@ class RegionSet(object):
|
|||||||
'minecraft:cut_red_sandstone': (179, 2),
|
'minecraft:cut_red_sandstone': (179, 2),
|
||||||
'minecraft:chiseled_red_sandstone': (179, 3),
|
'minecraft:chiseled_red_sandstone': (179, 3),
|
||||||
'minecraft:red_sandstone_stairs': (180, 0),
|
'minecraft:red_sandstone_stairs': (180, 0),
|
||||||
|
'minecraft:red_sandstone_slab': (182,0),
|
||||||
'minecraft:spruce_fence_gate': (183, 0),
|
'minecraft:spruce_fence_gate': (183, 0),
|
||||||
'minecraft:birch_fence_gate': (184, 0),
|
'minecraft:birch_fence_gate': (184, 0),
|
||||||
'minecraft:jungle_fence_gate': (185, 0),
|
'minecraft:jungle_fence_gate': (185, 0),
|
||||||
@@ -774,6 +775,10 @@ class RegionSet(object):
|
|||||||
'minecraft:petrified_oak_slab': (126, 0),
|
'minecraft:petrified_oak_slab': (126, 0),
|
||||||
'minecraft:prismarine_stairs': (11337, 0),
|
'minecraft:prismarine_stairs': (11337, 0),
|
||||||
'minecraft:dark_prismarine_stairs': (11338, 0),
|
'minecraft:dark_prismarine_stairs': (11338, 0),
|
||||||
|
'minecraft:prismarine_brick_stairs': (11339,0),
|
||||||
|
'minecraft:prismarine_slab': (11340, 0),
|
||||||
|
'minecraft:dark_prismarine_slab': (11341, 0),
|
||||||
|
'minecraft:prismarine_brick_slab': (11342, 0),
|
||||||
}
|
}
|
||||||
|
|
||||||
colors = [ 'white', 'orange', 'magenta', 'light_blue',
|
colors = [ 'white', 'orange', 'magenta', 'light_blue',
|
||||||
@@ -799,6 +804,14 @@ class RegionSet(object):
|
|||||||
return "<RegionSet regiondir=%r>" % self.regiondir
|
return "<RegionSet regiondir=%r>" % self.regiondir
|
||||||
|
|
||||||
def _get_block(self, palette_entry):
|
def _get_block(self, palette_entry):
|
||||||
|
wood_slabs = ('minecraft:oak_slab','minecraft:spruce_slab','minecraft:birch_slab','minecraft:jungle_slab',
|
||||||
|
'minecraft:acacia_slab','minecraft:dark_oak_slab','minecraft:petrified_oak_slab')
|
||||||
|
stone_slabs = ('minecraft:stone_slab', 'minecraft:sandstone_slab','minecraft:red_sandstone_slab',
|
||||||
|
'minecraft:cobblestone_slab', 'minecraft:brick_slab','minecraft:purpur_slab',
|
||||||
|
'minecraft:stone_brick_slab', 'minecraft:nether_brick_slab',
|
||||||
|
'minecraft:quartz_slab')
|
||||||
|
prismarine_slabs = ('minecraft:prismarine_slab','minecraft:dark_prismarine_slab','minecraft:prismarine_brick_slab')
|
||||||
|
|
||||||
key = palette_entry['Name']
|
key = palette_entry['Name']
|
||||||
(block, data) = self._blockmap[key]
|
(block, data) = self._blockmap[key]
|
||||||
if key in ['minecraft:redstone_ore', 'minecraft:redstone_lamp']:
|
if key in ['minecraft:redstone_ore', 'minecraft:redstone_lamp']:
|
||||||
@@ -830,17 +843,40 @@ class RegionSet(object):
|
|||||||
elif key in ('minecraft:sunflower', 'minecraft:lilac', 'minecraft:tall_grass', 'minecraft:large_fern', 'minecraft:rose_bush', 'minecraft:peony'):
|
elif key in ('minecraft:sunflower', 'minecraft:lilac', 'minecraft:tall_grass', 'minecraft:large_fern', 'minecraft:rose_bush', 'minecraft:peony'):
|
||||||
if palette_entry['Properties']['half'] == 'upper':
|
if palette_entry['Properties']['half'] == 'upper':
|
||||||
data |= 0x08
|
data |= 0x08
|
||||||
elif key in ['minecraft:stone_slab', 'minecraft:sandstone_slab', 'minecraft:oak_slab',
|
elif key in wood_slabs + stone_slabs + prismarine_slabs:
|
||||||
'minecraft:cobblestone_slab', 'minecraft:brick_slab',
|
# handle double slabs
|
||||||
'minecraft:stone_brick_slab', 'minecraft:nether_brick_slab',
|
|
||||||
'minecraft:quartz_slab', 'minecraft:petrified_oak_slab']:
|
|
||||||
if palette_entry['Properties']['type'] == 'top':
|
if palette_entry['Properties']['type'] == 'top':
|
||||||
data += 8
|
data |= 0x08
|
||||||
elif palette_entry['Properties']['type'] == 'double':
|
elif palette_entry['Properties']['type'] == 'double':
|
||||||
if 'oak' in key:
|
if key in wood_slabs:
|
||||||
block = 125
|
block = 125 # block_double_wooden_slab
|
||||||
elif key == 'minecraft:stone_brick_slab':
|
elif key in stone_slabs:
|
||||||
|
if key == 'minecraft:stone_brick_slab':
|
||||||
block = 98
|
block = 98
|
||||||
|
elif key == 'minecraft:stone_slab':
|
||||||
|
block = 43 # block_double_stone_slab
|
||||||
|
elif key == 'minecraft:cobblestone_slab':
|
||||||
|
block = 4 # cobblestone
|
||||||
|
elif key == 'minecraft:sandstone_slab':
|
||||||
|
block = 24 # minecraft:sandstone
|
||||||
|
elif key == 'minecraft:red_sandstone_slab':
|
||||||
|
block = 179 # minecraft:red_sandstone
|
||||||
|
elif key == 'minecraft:nether_brick_slab':
|
||||||
|
block = 112 # minecraft:nether_bricks
|
||||||
|
elif key == 'minecraft:quartz_slab':
|
||||||
|
block = 155 # minecraft:quartz_block
|
||||||
|
elif key == 'minecraft:brick_slab':
|
||||||
|
block = 45 # minecraft:bricks
|
||||||
|
elif key == 'minecraft:purpur_slab':
|
||||||
|
block = 201 # minecraft:purpur_block
|
||||||
|
elif key in prismarine_slabs:
|
||||||
|
block = 168 # minecraft:prismarine variants
|
||||||
|
if key == 'minecraft:prismarine_slab':
|
||||||
|
data = 0
|
||||||
|
elif key == 'minecraft:prismarine_brick_slab':
|
||||||
|
data = 1
|
||||||
|
elif key == 'minecraft:dark_prismarine_slab':
|
||||||
|
data = 2
|
||||||
elif key in ['minecraft:ladder', 'minecraft:chest', 'minecraft:ender_chest', 'minecraft:trapped_chest', 'minecraft:furnace']:
|
elif key in ['minecraft:ladder', 'minecraft:chest', 'minecraft:ender_chest', 'minecraft:trapped_chest', 'minecraft:furnace']:
|
||||||
facing = palette_entry['Properties']['facing']
|
facing = palette_entry['Properties']['facing']
|
||||||
data = {'north': 2, 'south': 3, 'west': 4, 'east': 5}[facing]
|
data = {'north': 2, 'south': 3, 'west': 4, 'east': 5}[facing]
|
||||||
|
|||||||
Reference in New Issue
Block a user