diff --git a/crates/resource/src/block_types.rs b/crates/resource/src/block_types.rs index f9ec70d..7ee50af 100644 --- a/crates/resource/src/block_types.rs +++ b/crates/resource/src/block_types.rs @@ -147,7 +147,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "acacia_wall_hanging_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("acacia"), @@ -157,7 +157,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "acacia_wall_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("acacia"), @@ -507,7 +507,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "bamboo_wall_hanging_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("bamboo"), @@ -517,7 +517,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "bamboo_wall_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("bamboo"), @@ -777,7 +777,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "birch_wall_hanging_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("birch"), @@ -787,7 +787,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "birch_wall_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("birch"), @@ -1787,7 +1787,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "cherry_wall_hanging_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("cherry"), @@ -1797,7 +1797,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "cherry_wall_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("cherry"), @@ -2387,7 +2387,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "crimson_wall_hanging_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("crimson"), @@ -2397,7 +2397,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "crimson_wall_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("crimson"), @@ -2787,7 +2787,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "dark_oak_wall_hanging_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("dark_oak"), @@ -2797,7 +2797,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "dark_oak_wall_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("dark_oak"), @@ -4577,7 +4577,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "jungle_wall_hanging_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("jungle"), @@ -4587,7 +4587,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "jungle_wall_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("jungle"), @@ -5527,7 +5527,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "mangrove_wall_hanging_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("mangrove"), @@ -5537,7 +5537,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "mangrove_wall_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("mangrove"), @@ -6057,7 +6057,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "oak_wall_hanging_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("oak"), @@ -6067,7 +6067,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "oak_wall_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("oak"), @@ -8637,7 +8637,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "spruce_wall_hanging_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("spruce"), @@ -8647,7 +8647,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "spruce_wall_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("spruce"), @@ -9287,7 +9287,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "wall_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("oak"), @@ -9467,7 +9467,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "warped_wall_hanging_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("warped"), @@ -9477,7 +9477,7 @@ pub const BLOCK_TYPES: &[(&str, ConstBlockType)] = &[ "warped_wall_sign", ConstBlockType { block_color: BlockColor { - flags: make_bitflags!(BlockFlag::{}), + flags: make_bitflags!(BlockFlag::{WallSign}), color: Color([0, 0, 0]), }, sign_material: Some("warped"), diff --git a/crates/resource/src/lib.rs b/crates/resource/src/lib.rs index 1175c88..1baffda 100644 --- a/crates/resource/src/lib.rs +++ b/crates/resource/src/lib.rs @@ -31,6 +31,11 @@ pub enum BlockFlag { Spruce, /// The block type is colored using biome water colors Water, + /// The block type is a wall sign + /// + /// The WallSign flag is used to distinguish wall signs from + /// freestanding or -hanging signs. + WallSign, } /// An RGB color with u8 components diff --git a/resource/blocks.json b/resource/blocks.json index ce5c497..ee052bd 100644 --- a/resource/blocks.json +++ b/resource/blocks.json @@ -37,11 +37,13 @@ "acacia_trapdoor": {}, "acacia_wall_hanging_sign": { "sign_material": "acacia", - "texture": null + "texture": null, + "wall_sign": true }, "acacia_wall_sign": { "sign_material": "acacia", - "texture": null + "texture": null, + "wall_sign": true }, "acacia_wood": { "texture": "acacia_log" @@ -123,11 +125,13 @@ "bamboo_trapdoor": {}, "bamboo_wall_hanging_sign": { "sign_material": "bamboo", - "texture": null + "texture": null, + "wall_sign": true }, "bamboo_wall_sign": { "sign_material": "bamboo", - "texture": null + "texture": null, + "wall_sign": true }, "barrel": { "texture": "barrel_top" @@ -192,11 +196,13 @@ "birch_trapdoor": {}, "birch_wall_hanging_sign": { "sign_material": "birch", - "texture": null + "texture": null, + "wall_sign": true }, "birch_wall_sign": { "sign_material": "birch", - "texture": null + "texture": null, + "wall_sign": true }, "birch_wood": { "texture": "birch_log" @@ -382,11 +388,13 @@ "cherry_trapdoor": {}, "cherry_wall_hanging_sign": { "sign_material": "cherry", - "texture": null + "texture": null, + "wall_sign": true }, "cherry_wall_sign": { "sign_material": "cherry", - "texture": null + "texture": null, + "wall_sign": true }, "cherry_wood": { "texture": "cherry_log" @@ -502,11 +510,13 @@ "crimson_trapdoor": {}, "crimson_wall_hanging_sign": { "sign_material": "crimson", - "texture": null + "texture": null, + "wall_sign": true }, "crimson_wall_sign": { "sign_material": "crimson", - "texture": null + "texture": null, + "wall_sign": true }, "crying_obsidian": {}, "cut_copper": {}, @@ -590,11 +600,13 @@ "dark_oak_trapdoor": {}, "dark_oak_wall_hanging_sign": { "sign_material": "dark_oak", - "texture": null + "texture": null, + "wall_sign": true }, "dark_oak_wall_sign": { "sign_material": "dark_oak", - "texture": null + "texture": null, + "wall_sign": true }, "dark_oak_wood": { "texture": "dark_oak_log" @@ -920,11 +932,13 @@ "jungle_trapdoor": {}, "jungle_wall_hanging_sign": { "sign_material": "jungle", - "texture": null + "texture": null, + "wall_sign": true }, "jungle_wall_sign": { "sign_material": "jungle", - "texture": null + "texture": null, + "wall_sign": true }, "jungle_wood": { "texture": "jungle_log" @@ -1092,11 +1106,13 @@ "mangrove_trapdoor": {}, "mangrove_wall_hanging_sign": { "sign_material": "mangrove", - "texture": null + "texture": null, + "wall_sign": true }, "mangrove_wall_sign": { "sign_material": "mangrove", - "texture": null + "texture": null, + "wall_sign": true }, "mangrove_wood": { "texture": "mangrove_log" @@ -1213,11 +1229,13 @@ "oak_trapdoor": {}, "oak_wall_hanging_sign": { "sign_material": "oak", - "texture": null + "texture": null, + "wall_sign": true }, "oak_wall_sign": { "sign_material": "oak", - "texture": null + "texture": null, + "wall_sign": true }, "oak_wood": { "texture": "oak_log" @@ -1757,11 +1775,13 @@ "spruce_trapdoor": {}, "spruce_wall_hanging_sign": { "sign_material": "spruce", - "texture": null + "texture": null, + "wall_sign": true }, "spruce_wall_sign": { "sign_material": "spruce", - "texture": null + "texture": null, + "wall_sign": true }, "spruce_wood": { "texture": "spruce_log" @@ -1911,7 +1931,8 @@ "void_air": null, "wall_sign": { "sign_material": "oak", - "texture": null + "texture": null, + "wall_sign": true }, "wall_torch": null, "warped_button": null, @@ -1954,11 +1975,13 @@ "warped_trapdoor": {}, "warped_wall_hanging_sign": { "sign_material": "warped", - "texture": null + "texture": null, + "wall_sign": true }, "warped_wall_sign": { "sign_material": "warped", - "texture": null + "texture": null, + "wall_sign": true }, "warped_wart_block": {}, "water": { diff --git a/resource/extract.py b/resource/extract.py index 22a6c76..9621b95 100755 --- a/resource/extract.py +++ b/resource/extract.py @@ -45,6 +45,7 @@ for name, info in blocks.items(): 'birch': False, 'spruce': False, 'water': False, + 'wall_sign': False, 'sign_material': None, } @@ -59,11 +60,13 @@ for name, info in blocks.items(): if color: output[id]['color'] = color output[id]['opaque'] = True - output[id]['grass'] = info.get('grass', False) - output[id]['foliage'] = info.get('foliage', False) - output[id]['birch'] = info.get('birch', False) - output[id]['spruce'] = info.get('spruce', False) - output[id]['water'] = info.get('water', False) + + output[id]['grass'] = info.get('grass', False) + output[id]['foliage'] = info.get('foliage', False) + output[id]['birch'] = info.get('birch', False) + output[id]['spruce'] = info.get('spruce', False) + output[id]['water'] = info.get('water', False) + output[id]['wall_sign'] = info.get('wall_sign', False) output[id]['sign_material'] = info.get('sign_material') diff --git a/resource/generate.py b/resource/generate.py index da5cb94..8064482 100755 --- a/resource/generate.py +++ b/resource/generate.py @@ -34,6 +34,8 @@ with open(sys.argv[2], 'w') as f: flags.append('Spruce') if info['water']: flags.append('Water') + if info['wall_sign']: + flags.append('WallSign') flags = 'make_bitflags!(BlockFlag::{' + '|'.join(flags) + '})' sign_material = 'None'