0

Added sign variants added in 1.14

This commit is contained in:
Gijs Oortgiese
2019-08-16 14:28:40 +02:00
committed by Nicolas F
parent 56a0d5bef2
commit f73e5d92ff
4 changed files with 65 additions and 17 deletions

View File

@@ -295,6 +295,18 @@ enum mc_block_id {
block_mossy_stone_brick_wall = 11372,
block_lantern = 11373,
block_smooth_sandstone_stairs = 11374,
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;

View File

@@ -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 72
#define OVERVIEWER_EXTENSION_VERSION 73
#include <stdbool.h>
#include <stdint.h>

View File

@@ -2477,7 +2477,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
@@ -2488,7 +2488,20 @@ def signpost(self, blockid, data):
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))
@@ -2501,7 +2514,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))
@@ -2723,7 +2736,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
@@ -2743,7 +2756,17 @@ def wall_sign(self, blockid, data): # wall sign
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))

View File

@@ -432,12 +432,24 @@ 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:stone_stairs': (67, 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),
@@ -1042,15 +1054,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