Merge rebased sign changes from Gyzie's 1-14-signs (#1627)
This commit is contained in:
@@ -305,6 +305,18 @@ enum mc_block_id {
|
||||
block_andesite_stairs = 11382,
|
||||
block_end_stone_brick_stairs = 11383,
|
||||
block_red_nether_brick_stairs = 11384,
|
||||
block_oak_sign = 11401,
|
||||
block_spruce_sign = 11402,
|
||||
block_birch_sign = 11403,
|
||||
block_jungle_sign = 11404,
|
||||
block_acacia_sign = 11405,
|
||||
block_dark_oak_sign = 11406,
|
||||
block_oak_wall_sign = 11407,
|
||||
block_spruce_wall_sign = 11408,
|
||||
block_birch_wall_sign = 11409,
|
||||
block_jungle_wall_sign = 11410,
|
||||
block_acacia_wall_sign = 11411,
|
||||
block_dark_oak_wall_sign = 11412,
|
||||
};
|
||||
|
||||
typedef uint16_t mc_block_t;
|
||||
|
||||
@@ -31,7 +31,7 @@
|
||||
|
||||
// increment this value if you've made a change to the c extesion
|
||||
// and want to force users to rebuild
|
||||
#define OVERVIEWER_EXTENSION_VERSION 73
|
||||
#define OVERVIEWER_EXTENSION_VERSION 74
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
@@ -2493,7 +2493,7 @@ def farmland(self, blockid, data):
|
||||
|
||||
|
||||
# signposts
|
||||
@material(blockid=63, data=list(range(16)), transparent=True)
|
||||
@material(blockid=[63,11401,11402,11403,11404,11405,11406], data=list(range(16)), transparent=True)
|
||||
def signpost(self, blockid, data):
|
||||
|
||||
# first rotations
|
||||
@@ -2503,8 +2503,21 @@ def signpost(self, blockid, data):
|
||||
data = (data + 8) % 16
|
||||
elif self.rotation == 3:
|
||||
data = (data + 12) % 16
|
||||
|
||||
texture = self.load_image_texture("assets/minecraft/textures/block/oak_planks.png").copy()
|
||||
|
||||
sign_texture = {
|
||||
# (texture on sign, texture on stick)
|
||||
63: ("oak_planks.png", "oak_log.png"),
|
||||
11401: ("oak_planks.png", "oak_log.png"),
|
||||
11402: ("spruce_planks.png", "spruce_log.png"),
|
||||
11403: ("birch_planks.png", "birch_log.png"),
|
||||
11404: ("jungle_planks.png", "jungle_log.png"),
|
||||
11405: ("acacia_planks.png", "acacia_log.png"),
|
||||
11406: ("dark_oak_planks.png", "dark_oak_log.png"),
|
||||
}
|
||||
texture_path, texture_stick_path = ["assets/minecraft/textures/block/" + x for x in sign_texture[blockid]]
|
||||
|
||||
texture = self.load_image_texture(texture_path).copy()
|
||||
|
||||
# cut the planks to the size of a signpost
|
||||
ImageDraw.Draw(texture).rectangle((0,12,15,15),outline=(0,0,0,0),fill=(0,0,0,0))
|
||||
|
||||
@@ -2517,7 +2530,7 @@ def signpost(self, blockid, data):
|
||||
texture.putpixel((x,y),(0,0,0,255))
|
||||
|
||||
# Minecraft uses wood texture for the signpost stick
|
||||
texture_stick = self.load_image_texture("assets/minecraft/textures/block/oak_log.png")
|
||||
texture_stick = self.load_image_texture(texture_stick_path)
|
||||
texture_stick = texture_stick.resize((12,12), Image.ANTIALIAS)
|
||||
ImageDraw.Draw(texture_stick).rectangle((2,0,12,12),outline=(0,0,0,0),fill=(0,0,0,0))
|
||||
|
||||
@@ -2739,7 +2752,7 @@ def ladder(self, blockid, data):
|
||||
|
||||
|
||||
# wall signs
|
||||
@material(blockid=68, data=[2, 3, 4, 5], transparent=True)
|
||||
@material(blockid=[68,11407,11408,11409,11410,11411,11412], data=[2, 3, 4, 5], transparent=True)
|
||||
def wall_sign(self, blockid, data): # wall sign
|
||||
|
||||
# first rotations
|
||||
@@ -2758,8 +2771,18 @@ def wall_sign(self, blockid, data): # wall sign
|
||||
elif data == 3: data = 5
|
||||
elif data == 4: data = 3
|
||||
elif data == 5: data = 2
|
||||
|
||||
texture = self.load_image_texture("assets/minecraft/textures/block/oak_planks.png").copy()
|
||||
|
||||
sign_texture = {
|
||||
68: "oak_planks.png",
|
||||
11407: "oak_planks.png",
|
||||
11408: "spruce_planks.png",
|
||||
11409: "birch_planks.png",
|
||||
11410: "jungle_planks.png",
|
||||
11411: "acacia_planks.png",
|
||||
11412: "dark_oak_planks.png",
|
||||
}
|
||||
texture_path = "assets/minecraft/textures/block/" + sign_texture[blockid]
|
||||
texture = self.load_image_texture(texture_path).copy()
|
||||
# cut the planks to the size of a signpost
|
||||
ImageDraw.Draw(texture).rectangle((0,12,15,15),outline=(0,0,0,0),fill=(0,0,0,0))
|
||||
|
||||
|
||||
@@ -432,11 +432,23 @@ class RegionSet(object):
|
||||
'minecraft:farmland': (60, 0),
|
||||
'minecraft:furnace': (61, 0),
|
||||
'minecraft:sign': (63, 0),
|
||||
'minecraft:oak_sign': (11401, 0),
|
||||
'minecraft:spruce_sign': (11402, 0),
|
||||
'minecraft:birch_sign': (11403, 0),
|
||||
'minecraft:jungle_sign': (11404, 0),
|
||||
'minecraft:acacia_sign': (11405, 0),
|
||||
'minecraft:dark_oak_sign': (11406, 0),
|
||||
'minecraft:oak_door': (64, 0),
|
||||
'minecraft:ladder': (65, 0),
|
||||
'minecraft:rail': (66, 0),
|
||||
'minecraft:cobblestone_stairs': (67, 0),
|
||||
'minecraft:wall_sign': (68, 0),
|
||||
'minecraft:oak_wall_sign': (11407, 0),
|
||||
'minecraft:spruce_wall_sign': (11408, 0),
|
||||
'minecraft:birch_wall_sign': (11409, 0),
|
||||
'minecraft:jungle_wall_sign': (11410, 0),
|
||||
'minecraft:acacia_wall_sign': (11411, 0),
|
||||
'minecraft:dark_oak_wall_sign': (11412, 0),
|
||||
'minecraft:lever': (69, 0),
|
||||
'minecraft:stone_pressure_plate': (70, 0),
|
||||
'minecraft:iron_door': (71, 0),
|
||||
@@ -1051,15 +1063,16 @@ class RegionSet(object):
|
||||
if facing == 'west': data += 1
|
||||
if facing == 'north': data += 2
|
||||
if facing == 'east': data += 3
|
||||
elif key == 'minecraft:sign':
|
||||
p = palette_entry['Properties']
|
||||
data = p['rotation']
|
||||
elif key == 'minecraft:wall_sign':
|
||||
facing = palette_entry['Properties']['facing']
|
||||
if facing == 'north': data = 2
|
||||
elif facing == 'west': data = 4
|
||||
elif facing == 'south': data = 3
|
||||
elif facing == 'east': data = 5
|
||||
elif key.endswith('sign'):
|
||||
if key.endswith('wall_sign'):
|
||||
facing = palette_entry['Properties']['facing']
|
||||
if facing == 'north': data = 2
|
||||
elif facing == 'west': data = 4
|
||||
elif facing == 'south': data = 3
|
||||
elif facing == 'east': data = 5
|
||||
else:
|
||||
p = palette_entry['Properties']
|
||||
data = p['rotation']
|
||||
elif key.endswith('_fence'):
|
||||
p = palette_entry['Properties']
|
||||
if p['north'] == 'true': data |= 1
|
||||
|
||||
Reference in New Issue
Block a user