Implement some mossy blocks
This adds: - mossy stone brick stairs - mossy cobblestone stairs - mossy stone brick walls We also add another block class for walls, and while we're at it, clean up the stairs texture function to not have a huge sprawling elif mess for loading textures, but instead to a cheeky dictionary lookup. In case you're wondering, yes I am just as disgusted by this code as you are.
This commit is contained in:
@@ -75,7 +75,9 @@ const mc_block_t block_class_stair[] = {
|
|||||||
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_prismarine_brick_stairs,
|
||||||
|
block_mossy_cobblestone_stairs,
|
||||||
|
block_mossy_stone_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);
|
||||||
|
|
||||||
const mc_block_t block_class_door[] = {
|
const mc_block_t block_class_door[] = {
|
||||||
@@ -132,6 +134,8 @@ const mc_block_t block_class_ancil[] = {
|
|||||||
block_prismarine_stairs,
|
block_prismarine_stairs,
|
||||||
block_dark_prismarine_stairs,
|
block_dark_prismarine_stairs,
|
||||||
block_prismarine_brick_stairs,
|
block_prismarine_brick_stairs,
|
||||||
|
block_mossy_cobblestone_stairs,
|
||||||
|
block_mossy_stone_brick_stairs,
|
||||||
block_grass,
|
block_grass,
|
||||||
block_flowing_water,
|
block_flowing_water,
|
||||||
block_water,
|
block_water,
|
||||||
@@ -146,6 +150,7 @@ const mc_block_t block_class_ancil[] = {
|
|||||||
block_waterlily,
|
block_waterlily,
|
||||||
block_nether_brick_fence,
|
block_nether_brick_fence,
|
||||||
block_cobblestone_wall,
|
block_cobblestone_wall,
|
||||||
|
block_mossy_stone_brick_wall,
|
||||||
block_double_plant,
|
block_double_plant,
|
||||||
block_stained_glass_pane,
|
block_stained_glass_pane,
|
||||||
block_stained_glass,
|
block_stained_glass,
|
||||||
@@ -175,6 +180,8 @@ const mc_block_t block_class_alt_height[] = {
|
|||||||
block_prismarine_stairs,
|
block_prismarine_stairs,
|
||||||
block_dark_prismarine_stairs,
|
block_dark_prismarine_stairs,
|
||||||
block_prismarine_brick_stairs,
|
block_prismarine_brick_stairs,
|
||||||
|
block_mossy_cobblestone_stairs,
|
||||||
|
block_mossy_stone_brick_stairs,
|
||||||
block_prismarine_slab,
|
block_prismarine_slab,
|
||||||
block_dark_prismarine_slab,
|
block_dark_prismarine_slab,
|
||||||
block_prismarine_brick_slab,
|
block_prismarine_brick_slab,
|
||||||
@@ -199,3 +206,8 @@ const mc_block_t block_class_alt_height[] = {
|
|||||||
block_purpur_slab,
|
block_purpur_slab,
|
||||||
block_wooden_slab};
|
block_wooden_slab};
|
||||||
const size_t block_class_alt_height_len = COUNT_OF(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_cobblestone_wall,
|
||||||
|
block_mossy_stone_brick_wall};
|
||||||
|
const size_t block_class_wall_len = COUNT_OF(block_class_wall);
|
||||||
|
|||||||
@@ -46,4 +46,7 @@ extern const size_t block_class_ancil_len;
|
|||||||
extern const mc_block_t block_class_alt_height[];
|
extern const mc_block_t block_class_alt_height[];
|
||||||
extern const size_t block_class_alt_height_len;
|
extern const size_t block_class_alt_height_len;
|
||||||
|
|
||||||
|
extern const mc_block_t block_class_wall[];
|
||||||
|
extern const size_t block_class_wall_len;
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -390,7 +390,7 @@ generate_pseudo_data(RenderState* state, uint16_t ancilData) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
} else if (state->block == block_cobblestone_wall) {
|
} else if (block_class_is_subset(state->block, block_class_wall, block_class_wall_len)) {
|
||||||
/* check for walls and add one bit with the type of wall (mossy or cobblestone)*/
|
/* check for walls and add one bit with the type of wall (mossy or cobblestone)*/
|
||||||
if (ancilData == 0x1) {
|
if (ancilData == 0x1) {
|
||||||
return check_adjacent_blocks(state, x, y, z, state->block) | 0x10;
|
return check_adjacent_blocks(state, x, y, z, state->block) | 0x10;
|
||||||
|
|||||||
@@ -290,6 +290,9 @@ enum mc_block_id {
|
|||||||
block_loom = 11367,
|
block_loom = 11367,
|
||||||
block_stonecutter = 11368,
|
block_stonecutter = 11368,
|
||||||
block_grindstone = 11369,
|
block_grindstone = 11369,
|
||||||
|
block_mossy_stone_brick_stairs = 11370,
|
||||||
|
block_mossy_cobblestone_stairs = 11371,
|
||||||
|
block_mossy_stone_brick_wall = 11372,
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef uint16_t mc_block_t;
|
typedef uint16_t mc_block_t;
|
||||||
|
|||||||
@@ -31,7 +31,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 69
|
#define OVERVIEWER_EXTENSION_VERSION 70
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|||||||
@@ -1891,8 +1891,9 @@ def fire(self, blockid, data):
|
|||||||
# monster spawner
|
# monster spawner
|
||||||
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, (dark) prismarine, mossy brick and mossy cobblestone stairs.
|
||||||
@material(blockid=[53,67,108,109,114,128,134,135,136,156,163,164,180,203,11337,11338,11339], data=list(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,
|
||||||
|
11370, 11371], data=list(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
|
||||||
@@ -1905,40 +1906,29 @@ def stairs(self, blockid, data):
|
|||||||
numpy.roll(quarters, [0,1,3,2][self.rotation])
|
numpy.roll(quarters, [0,1,3,2][self.rotation])
|
||||||
nw,ne,se,sw = quarters
|
nw,ne,se,sw = quarters
|
||||||
|
|
||||||
if blockid == 53: # wooden
|
stair_id_to_tex = {
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/oak_planks.png").copy()
|
53: "assets/minecraft/textures/block/oak_planks.png",
|
||||||
elif blockid == 67: # cobblestone
|
67: "assets/minecraft/textures/block/cobblestone.png",
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/cobblestone.png").copy()
|
108: "assets/minecraft/textures/block/bricks.png",
|
||||||
elif blockid == 108: # red brick stairs
|
109: "assets/minecraft/textures/block/stone_bricks.png",
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/bricks.png").copy()
|
114: "assets/minecraft/textures/block/nether_bricks.png",
|
||||||
elif blockid == 109: # stone brick stairs
|
128: "assets/minecraft/textures/block/sandstone.png",
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/stone_bricks.png").copy()
|
134: "assets/minecraft/textures/block/spruce_planks.png",
|
||||||
elif blockid == 114: # netherbrick stairs
|
135: "assets/minecraft/textures/block/birch_planks.png",
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/nether_bricks.png").copy()
|
136: "assets/minecraft/textures/block/jungle_planks.png",
|
||||||
elif blockid == 128: # sandstone stairs
|
156: "assets/minecraft/textures/block/quartz_block_side.png",
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/sandstone.png").copy()
|
163: "assets/minecraft/textures/block/acacia_planks.png",
|
||||||
elif blockid == 134: # spruce wood stairs
|
164: "assets/minecraft/textures/block/dark_oak_planks.png",
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/spruce_planks.png").copy()
|
180: "assets/minecraft/textures/block/red_sandstone.png",
|
||||||
elif blockid == 135: # birch wood stairs
|
203: "assets/minecraft/textures/block/purpur_block.png",
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/birch_planks.png").copy()
|
11337: "assets/minecraft/textures/block/prismarine.png",
|
||||||
elif blockid == 136: # jungle good stairs
|
11338: "assets/minecraft/textures/block/dark_prismarine.png",
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/jungle_planks.png").copy()
|
11339: "assets/minecraft/textures/block/prismarine_bricks.png",
|
||||||
elif blockid == 156: # quartz block stairs
|
11370: "assets/minecraft/textures/block/mossy_stone_bricks.png",
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/quartz_block_side.png").copy()
|
11371: "assets/minecraft/textures/block/mossy_cobblestone.png",
|
||||||
elif blockid == 163: # acacia wood stairs
|
}
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/acacia_planks.png").copy()
|
|
||||||
elif blockid == 164: # dark oak stairs
|
texture = self.load_image_texture(stair_id_to_tex[blockid]).copy()
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/dark_oak_planks.png").copy()
|
|
||||||
elif blockid == 180: # red sandstone stairs
|
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/red_sandstone.png").copy()
|
|
||||||
elif blockid == 203: # purpur stairs
|
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/purpur_block.png").copy()
|
|
||||||
elif blockid == 11337: # prismarine stairs
|
|
||||||
texture = self.load_image_texture("assets/minecraft/textures/block/prismarine.png").copy()
|
|
||||||
elif blockid == 11338: # dark prismarine stairs
|
|
||||||
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()
|
||||||
@@ -4311,13 +4301,16 @@ def beacon(self, blockid, data):
|
|||||||
|
|
||||||
return img
|
return img
|
||||||
|
|
||||||
# cobblestone and mossy cobblestone walls, chorus plants
|
# cobblestone and mossy cobblestone walls, chorus plants, mossy stone brick walls
|
||||||
# one additional bit of data value added for mossy and cobblestone
|
# one additional bit of data value added for mossy and cobblestone
|
||||||
@material(blockid=[139, 199], data=list(range(32)), transparent=True, nospawn=True)
|
@material(blockid=[139, 199, 11372], data=list(range(32)), transparent=True, nospawn=True)
|
||||||
def cobblestone_wall(self, blockid, data):
|
def cobblestone_wall(self, blockid, data):
|
||||||
# chorus plants
|
# chorus plants
|
||||||
if blockid == 199:
|
if blockid == 199:
|
||||||
t = self.load_image_texture("assets/minecraft/textures/block/chorus_plant.png").copy()
|
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
|
# no rotation, uses pseudo data
|
||||||
elif data & 0b10000 == 0:
|
elif data & 0b10000 == 0:
|
||||||
# cobblestone
|
# cobblestone
|
||||||
|
|||||||
@@ -799,13 +799,15 @@ class RegionSet(object):
|
|||||||
"minecraft:fletching_table": (11359, 0),
|
"minecraft:fletching_table": (11359, 0),
|
||||||
"minecraft:cartography_table": (11360, 0),
|
"minecraft:cartography_table": (11360, 0),
|
||||||
"minecraft:smithing_table": (11361, 0),
|
"minecraft:smithing_table": (11361, 0),
|
||||||
|
|
||||||
"minecraft:blast_furnace": (11362, 0),
|
"minecraft:blast_furnace": (11362, 0),
|
||||||
"minecraft:smoker": (11364, 0),
|
"minecraft:smoker": (11364, 0),
|
||||||
"minecraft:lectern": (11366, 0),
|
"minecraft:lectern": (11366, 0),
|
||||||
"minecraft:loom": (11367, 0),
|
"minecraft:loom": (11367, 0),
|
||||||
"minecraft:stonecutter": (11368, 0),
|
"minecraft:stonecutter": (11368, 0),
|
||||||
"minecraft:grindstone": (11369, 0)
|
"minecraft:grindstone": (11369, 0),
|
||||||
|
"minecraft:mossy_stone_brick_stairs": (11370, 0),
|
||||||
|
"minecraft:mossy_cobblestone_stairs": (11371, 0),
|
||||||
|
"minecraft:mossy_stone_brick_wall": (11372, 0),
|
||||||
}
|
}
|
||||||
|
|
||||||
colors = [ 'white', 'orange', 'magenta', 'light_blue',
|
colors = [ 'white', 'orange', 'magenta', 'light_blue',
|
||||||
|
|||||||
Reference in New Issue
Block a user