Skip to content

Commit

Permalink
Merge pull request #1664 from IncredibleHolg/addblocks-dec19
Browse files Browse the repository at this point in the history
Addblocks dec19
  • Loading branch information
CounterPillow committed Oct 27, 2019
2 parents 240a02a + 17bb942 commit dce1c21
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 22 deletions.
29 changes: 28 additions & 1 deletion overviewer_core/src/block_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ const mc_block_t block_class_stair[] = {
block_acacia_stairs,
block_dark_oak_stairs,
block_red_sandstone_stairs,
block_smooth_red_sandstone_stairs,
block_purpur_stairs,
block_prismarine_stairs,
block_dark_prismarine_stairs,
Expand Down Expand Up @@ -140,6 +141,7 @@ const mc_block_t block_class_ancil[] = {
block_acacia_stairs,
block_dark_oak_stairs,
block_red_sandstone_stairs,
block_smooth_red_sandstone_stairs,
block_purpur_stairs,
block_prismarine_stairs,
block_dark_prismarine_stairs,
Expand Down Expand Up @@ -171,8 +173,20 @@ const mc_block_t block_class_ancil[] = {
block_glass_pane,
block_waterlily,
block_nether_brick_fence,
block_andesite_wall,
block_brick_wall,
block_cobblestone_wall,
block_diorite_wall,
block_end_stone_brick_wall,
block_granite_wall,
block_mossy_cobblestone_wall,
block_mossy_stone_brick_wall,
block_nether_brick_wall,
block_prismarine_wall,
block_red_nether_brick_wall,
block_red_sandstone_wall,
block_sandstone_wall,
block_stone_brick_wall,
block_double_plant,
block_stained_glass_pane,
block_stained_glass,
Expand All @@ -198,6 +212,7 @@ const mc_block_t block_class_alt_height[] = {
block_acacia_stairs,
block_dark_oak_stairs,
block_red_sandstone_stairs,
block_smooth_red_sandstone_stairs,
block_prismarine_stairs,
block_dark_prismarine_stairs,
block_prismarine_brick_stairs,
Expand Down Expand Up @@ -241,6 +256,18 @@ const mc_block_t block_class_alt_height[] = {
const size_t block_class_alt_height_len = COUNT_OF(block_class_alt_height);

const mc_block_t block_class_wall[] = {
block_andesite_wall,
block_brick_wall,
block_cobblestone_wall,
block_mossy_stone_brick_wall};
block_diorite_wall,
block_end_stone_brick_wall,
block_granite_wall,
block_mossy_cobblestone_wall,
block_mossy_stone_brick_wall,
block_nether_brick_wall,
block_prismarine_wall,
block_red_nether_brick_wall,
block_red_sandstone_wall,
block_sandstone_wall,
block_stone_brick_wall};
const size_t block_class_wall_len = COUNT_OF(block_class_wall);
20 changes: 18 additions & 2 deletions overviewer_core/src/mc_id.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,6 @@ enum mc_block_id {
block_jungle_stairs = 136,
block_command_block = 137,
block_beacon = 138,
block_cobblestone_wall = 139,
block_flower_pot = 140,
block_carrots = 141,
block_potatoes = 142,
Expand Down Expand Up @@ -184,6 +183,7 @@ enum mc_block_id {
block_daylight_detector_inverted = 178,
block_red_sandstone = 179,
block_red_sandstone_stairs = 180,
block_smooth_red_sandstone_stairs = 11415,
block_double_stone_slab2 = 181,
block_stone_slab2 = 182,
block_spruce_fence_gate = 183,
Expand Down Expand Up @@ -292,7 +292,6 @@ enum mc_block_id {
block_grindstone = 11369,
block_mossy_stone_brick_stairs = 11370,
block_mossy_cobblestone_stairs = 11371,
block_mossy_stone_brick_wall = 11372,
block_lantern = 11373,
block_smooth_sandstone_stairs = 11374,
block_smooth_quartz_stairs = 11375,
Expand Down Expand Up @@ -324,6 +323,23 @@ enum mc_block_id {
block_acacia_wall_sign = 11411,
block_dark_oak_wall_sign = 11412,
block_bamboo_sapling = 11413,
block_scaffolding = 11414,
// adding a gap in the numbering of walls to keep them all
// in one numbering block starting at 21000
block_andesite_wall = 21000,
block_brick_wall = 21001,
block_cobblestone_wall = 21002,
block_diorite_wall = 21003,
block_end_stone_brick_wall = 21004,
block_granite_wall = 21005,
block_mossy_cobblestone_wall = 21006,
block_mossy_stone_brick_wall = 21007,
block_nether_brick_wall = 21008,
block_prismarine_wall = 21009,
block_red_nether_brick_wall = 21010,
block_red_sandstone_wall = 21011,
block_sandstone_wall = 21012,
block_stone_brick_wall = 21013
};

typedef uint16_t mc_block_t;
Expand Down
2 changes: 1 addition & 1 deletion overviewer_core/src/overviewer.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 75
#define OVERVIEWER_EXTENSION_VERSION 76

#include <stdbool.h>
#include <stdint.h>
Expand Down
40 changes: 25 additions & 15 deletions overviewer_core/textures.py
Original file line number Diff line number Diff line change
Expand Up @@ -1958,8 +1958,9 @@ def fire(self, blockid, data):
# wooden, cobblestone, red brick, stone brick, netherbrick, sandstone, spruce, birch,
# jungle, quartz, red sandstone, (dark) prismarine, mossy brick and mossy cobblestone, stone smooth_quartz
# polished_granite polished_andesite polished_diorite granite diorite andesite end_stone_bricks red_nether_brick stairs
# smooth_red_sandstone_stairs
@material(blockid=[53, 67, 108, 109, 114, 128, 134, 135, 136, 156, 163, 164, 180, 203, 11337, 11338, 11339,
11370, 11371, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 11381, 11382, 11383, 11384],
11370, 11371, 11374, 11375, 11376, 11377, 11378, 11379, 11380, 11381, 11382, 11383, 11384, 11415],
data=list(range(128)), transparent=True, solid=True, nospawn=True)
def stairs(self, blockid, data):
# preserve the upside-down bit
Expand Down Expand Up @@ -2004,6 +2005,7 @@ def stairs(self, blockid, data):
11382: "assets/minecraft/textures/block/andesite.png",
11383: "assets/minecraft/textures/block/end_stone_bricks.png",
11384: "assets/minecraft/textures/block/red_nether_bricks.png",
11415: "assets/minecraft/textures/block/red_sandstone_top.png",
}

texture = self.load_image_texture(stair_id_to_tex[blockid]).copy()
Expand Down Expand Up @@ -4407,21 +4409,26 @@ def beacon(self, blockid, data):

# cobblestone and mossy cobblestone walls, chorus plants, mossy stone brick walls
# one additional bit of data value added for mossy and cobblestone
@material(blockid=[139, 199, 11372], data=list(range(32)), transparent=True, nospawn=True)
@material(blockid=[199, *range(21000,21013+1)], data=list(range(32)), transparent=True, nospawn=True)
def cobblestone_wall(self, blockid, data):
# chorus plants
if blockid == 199:
t = self.load_image_texture("assets/minecraft/textures/block/chorus_plant.png").copy()
# mossy stone bricks
elif blockid == 11372:
t = self.load_image_texture("assets/minecraft/textures/block/mossy_stone_bricks.png").copy()
# no rotation, uses pseudo data
elif data & 0b10000 == 0:
# cobblestone
t = self.load_image_texture("assets/minecraft/textures/block/cobblestone.png").copy()
else:
# mossy cobblestone
t = self.load_image_texture("assets/minecraft/textures/block/mossy_cobblestone.png").copy()
walls_id_to_tex = {
199: "assets/minecraft/textures/block/chorus_plant.png", # chorus plants
21000: "assets/minecraft/textures/block/andesite.png",
21001: "assets/minecraft/textures/block/bricks.png",
21002: "assets/minecraft/textures/block/cobblestone.png",
21003: "assets/minecraft/textures/block/diorite.png",
21004: "assets/minecraft/textures/block/end_stone_bricks.png",
21005: "assets/minecraft/textures/block/granite.png",
21006: "assets/minecraft/textures/block/mossy_cobblestone.png",
21007: "assets/minecraft/textures/block/mossy_stone_bricks.png",
21008: "assets/minecraft/textures/block/nether_bricks.png",
21009: "assets/minecraft/textures/block/prismarine.png",
21010: "assets/minecraft/textures/block/red_nether_bricks.png",
21011: "assets/minecraft/textures/block/red_sandstone.png",
21012: "assets/minecraft/textures/block/sandstone.png",
21013: "assets/minecraft/textures/block/stone_bricks.png"
}
t = self.load_image_texture(walls_id_to_tex[blockid]).copy()

wall_pole_top = t.copy()
wall_pole_side = t.copy()
Expand Down Expand Up @@ -5076,3 +5083,6 @@ def glazed_terracotta(self, blockid, data):
def sandstone(self, blockid, data):
top = self.load_image_texture("assets/minecraft/textures/block/dried_kelp_top.png")
return self.build_block(top, self.load_image_texture("assets/minecraft/textures/block/dried_kelp_side.png"))

# scaffolding
block(blockid=11414, top_image="assets/minecraft/textures/block/scaffolding_top.png", side_image="assets/minecraft/textures/block/scaffolding_side.png", solid=False, transparent=True)
21 changes: 18 additions & 3 deletions overviewer_core/world.py
Original file line number Diff line number Diff line change
Expand Up @@ -524,8 +524,6 @@ def __init__(self, regiondir, rel):
'minecraft:jungle_stairs': (136, 0),
'minecraft:command_block': (137, 0),
'minecraft:beacon': (138, 0),
'minecraft:cobblestone_wall': (139, 0),
'minecraft:mossy_cobblestone_wall': (139, 1),
'minecraft:flower_pot': (140, 0),
'minecraft:potted_poppy': (140, 0), # Pots not rendering
'minecraft:potted_blue_orchid': (140, 0),
Expand Down Expand Up @@ -813,7 +811,6 @@ def __init__(self, regiondir, rel):
"minecraft:grindstone": (11369, 0),
"minecraft:mossy_stone_brick_stairs": (11370, 0),
"minecraft:mossy_cobblestone_stairs": (11371, 0),
"minecraft:mossy_stone_brick_wall": (11372, 0),
"minecraft:lantern": (11373, 0),
"minecraft:smooth_sandstone_stairs": (11374, 0),
'minecraft:smooth_quartz_stairs': (11375, 0),
Expand All @@ -833,6 +830,24 @@ def __init__(self, regiondir, rel):
'minecraft:acacia_sapling': (11389, 0),
'minecraft:dark_oak_sapling': (11390, 0),
'minecraft:bamboo_sapling': (11413, 0),
'minecraft:scaffolding': (11414, 0),
"minecraft:smooth_red_sandstone_stairs": (11415, 0),
# adding a gap in the numbering of walls to keep them all
# in one numbering block starting at 21000
'minecraft:andesite_wall': (21000, 0),
'minecraft:brick_wall': (21001, 0),
'minecraft:cobblestone_wall': (21002, 0),
'minecraft:diorite_wall': (21003, 0),
'minecraft:end_stone_brick_wall': (21004, 0),
'minecraft:granite_wall': (21005, 0),
'minecraft:mossy_cobblestone_wall': (21006, 0),
'minecraft:mossy_stone_brick_wall': (21007, 0),
'minecraft:nether_brick_wall': (21008, 0),
'minecraft:prismarine_wall': (21009, 0),
'minecraft:red_nether_brick_wall': (21010, 0),
'minecraft:red_sandstone_wall': (21011, 0),
'minecraft:sandstone_wall': (21012, 0),
'minecraft:stone_brick_wall': (21013, 0),
}

colors = [ 'white', 'orange', 'magenta', 'light_blue',
Expand Down

0 comments on commit dce1c21

Please sign in to comment.