Default block material to solid.

This commit is contained in:
Scetch 2016-04-13 10:50:08 -04:00
parent f349d516f2
commit dab2c3fc89
1 changed files with 4 additions and 71 deletions

View File

@ -74,7 +74,7 @@ macro_rules! define_blocks {
)* )*
}, },
$(data $datafunc:expr,)* $(data $datafunc:expr,)*
material $mat:expr, $(material $mat:expr,)*
model $model:expr, model $model:expr,
$(variant $variant:expr,)* $(variant $variant:expr,)*
$(tint $tint:expr,)* $(tint $tint:expr,)*
@ -179,14 +179,15 @@ macro_rules! define_blocks {
VANILLA_ID_MAP.get(id).and_then(|v| *v).unwrap_or(Block::Missing{}) VANILLA_ID_MAP.get(id).and_then(|v| *v).unwrap_or(Block::Missing{})
} }
#[allow(unused_variables)] #[allow(unused_variables, unreachable_code)]
pub fn get_material(&self) -> Material { pub fn get_material(&self) -> Material {
match *self { match *self {
$( $(
Block::$name { Block::$name {
$($fname,)* $($fname,)*
} => { } => {
$mat $(return $mat;)*
material::SOLID
} }
)+ )+
} }
@ -346,7 +347,6 @@ define_blocks! {
], ],
}, },
data Some(variant.data()), data Some(variant.data()),
material material::SOLID,
model { ("minecraft", variant.as_string() ) }, model { ("minecraft", variant.as_string() ) },
} }
Grass { Grass {
@ -354,7 +354,6 @@ define_blocks! {
snowy: bool = [false, true], snowy: bool = [false, true],
}, },
data { if snowy { None } else { Some(0) } }, data { if snowy { None } else { Some(0) } },
material material::SOLID,
model { ("minecraft", "grass") }, model { ("minecraft", "grass") },
variant format!("snowy={}", snowy), variant format!("snowy={}", snowy),
tint TintType::Grass, tint TintType::Grass,
@ -370,7 +369,6 @@ define_blocks! {
], ],
}, },
data if !snowy { Some(variant.data()) } else { None }, data if !snowy { Some(variant.data()) } else { None },
material material::SOLID,
model { ("minecraft", variant.as_string()) }, model { ("minecraft", variant.as_string()) },
variant { variant {
if variant == DirtVariant::Podzol { if variant == DirtVariant::Podzol {
@ -387,7 +385,6 @@ define_blocks! {
} }
Cobblestone { Cobblestone {
props {}, props {},
material material::SOLID,
model { ("minecraft", "cobblestone") }, model { ("minecraft", "cobblestone") },
} }
Planks { Planks {
@ -402,7 +399,6 @@ define_blocks! {
], ],
}, },
data Some(variant.plank_data()), data Some(variant.plank_data()),
material material::SOLID,
model { ("minecraft", format!("{}_planks", variant.as_string()) ) }, model { ("minecraft", format!("{}_planks", variant.as_string()) ) },
} }
Sapling { Sapling {
@ -425,7 +421,6 @@ define_blocks! {
} }
Bedrock { Bedrock {
props {}, props {},
material material::SOLID,
model { ("minecraft", "bedrock") }, model { ("minecraft", "bedrock") },
} }
FlowingWater { FlowingWater {
@ -483,27 +478,22 @@ define_blocks! {
red: bool = [false, true], red: bool = [false, true],
}, },
data Some(if red { 1 } else { 0 }), data Some(if red { 1 } else { 0 }),
material material::SOLID,
model { ("minecraft", if red { "red_sand" } else { "sand" } ) }, model { ("minecraft", if red { "red_sand" } else { "sand" } ) },
} }
Gravel { Gravel {
props {}, props {},
material material::SOLID,
model { ("minecraft", "gravel") }, model { ("minecraft", "gravel") },
} }
GoldOre { GoldOre {
props {}, props {},
material material::SOLID,
model { ("minecraft", "gold_ore") }, model { ("minecraft", "gold_ore") },
} }
IronOre { IronOre {
props {}, props {},
material material::SOLID,
model { ("minecraft", "iron_ore") }, model { ("minecraft", "iron_ore") },
} }
CoalOre { CoalOre {
props {}, props {},
material material::SOLID,
model { ("minecraft", "coal_ore") }, model { ("minecraft", "coal_ore") },
} }
Log { Log {
@ -517,7 +507,6 @@ define_blocks! {
axis: Axis = [Axis::Y, Axis::Z, Axis::X, Axis::None], axis: Axis = [Axis::Y, Axis::Z, Axis::X, Axis::None],
}, },
data Some(variant.data() | (axis.index() << 2)), data Some(variant.data() | (axis.index() << 2)),
material material::SOLID,
model { ("minecraft", format!("{}_log", variant.as_string()) ) }, model { ("minecraft", format!("{}_log", variant.as_string()) ) },
variant format!("axis={}", axis.as_string()), variant format!("axis={}", axis.as_string()),
} }
@ -544,7 +533,6 @@ define_blocks! {
wet: bool = [false, true], wet: bool = [false, true],
}, },
data Some(if wet { 1 } else { 0 }), data Some(if wet { 1 } else { 0 }),
material material::SOLID,
model { ("minecraft", "sponge") }, model { ("minecraft", "sponge") },
variant format!("wet={}", wet), variant format!("wet={}", wet),
} }
@ -555,12 +543,10 @@ define_blocks! {
} }
LapisOre { LapisOre {
props {}, props {},
material material::SOLID,
model { ("minecraft", "lapis_ore") }, model { ("minecraft", "lapis_ore") },
} }
LapisBlock { LapisBlock {
props {}, props {},
material material::SOLID,
model { ("minecraft", "lapis_block") }, model { ("minecraft", "lapis_block") },
} }
Dispenser { Dispenser {
@ -576,7 +562,6 @@ define_blocks! {
triggered: bool = [false, true], triggered: bool = [false, true],
}, },
data Some(facing.index() | (if triggered { 0x8 } else { 0x0 })), data Some(facing.index() | (if triggered { 0x8 } else { 0x0 })),
material material::SOLID,
model { ("minecraft", "dispenser") }, model { ("minecraft", "dispenser") },
variant format!("facing={}", facing.as_string()), variant format!("facing={}", facing.as_string()),
} }
@ -589,12 +574,10 @@ define_blocks! {
], ],
}, },
data Some(variant.data()), data Some(variant.data()),
material material::SOLID,
model { ("minecraft", variant.as_string() ) }, model { ("minecraft", variant.as_string() ) },
} }
NoteBlock { NoteBlock {
props {}, props {},
material material::SOLID,
model { ("minecraft", "noteblock") }, model { ("minecraft", "noteblock") },
} }
Bed { Bed {
@ -776,7 +759,6 @@ define_blocks! {
], ],
}, },
data Some(color.data()), data Some(color.data()),
material material::SOLID,
model { ("minecraft", format!("{}_wool", color.as_string()) ) }, model { ("minecraft", format!("{}_wool", color.as_string()) ) },
} }
PistonExtension { PistonExtension {
@ -826,12 +808,10 @@ define_blocks! {
} }
GoldBlock { GoldBlock {
props {}, props {},
material material::SOLID,
model { ("minecraft", "gold_block") }, model { ("minecraft", "gold_block") },
} }
IronBlock { IronBlock {
props {}, props {},
material material::SOLID,
model { ("minecraft", "iron_block") }, model { ("minecraft", "iron_block") },
} }
DoubleStoneSlab { DoubleStoneSlab {
@ -862,7 +842,6 @@ define_blocks! {
Some(data) Some(data)
}, },
material material::SOLID,
model { ("minecraft", format!("{}_double_slab", variant.as_string()) ) }, model { ("minecraft", format!("{}_double_slab", variant.as_string()) ) },
variant if seamless { "all" } else { "normal" }, variant if seamless { "all" } else { "normal" },
} }
@ -898,7 +877,6 @@ define_blocks! {
} }
BrickBlock { BrickBlock {
props {}, props {},
material material::SOLID,
model { ("minecraft", "brick_block") }, model { ("minecraft", "brick_block") },
} }
TNT { TNT {
@ -906,22 +884,18 @@ define_blocks! {
explode: bool = [false, true], explode: bool = [false, true],
}, },
data Some(if explode { 1 } else { 0 }), data Some(if explode { 1 } else { 0 }),
material material::SOLID,
model { ("minecraft", "tnt") }, model { ("minecraft", "tnt") },
} }
BookShelf { BookShelf {
props {}, props {},
material material::SOLID,
model { ("minecraft", "bookshelf") }, model { ("minecraft", "bookshelf") },
} }
MossyCobblestone { MossyCobblestone {
props {}, props {},
material material::SOLID,
model { ("minecraft", "mossy_cobblestone") }, model { ("minecraft", "mossy_cobblestone") },
} }
Obsidian { Obsidian {
props {}, props {},
material material::SOLID,
model { ("minecraft", "obsidian") }, model { ("minecraft", "obsidian") },
} }
Torch { Torch {
@ -1055,17 +1029,14 @@ define_blocks! {
} }
DiamondOre { DiamondOre {
props {}, props {},
material material::SOLID,
model { ("minecraft", "diamond_ore") }, model { ("minecraft", "diamond_ore") },
} }
DiamondBlock { DiamondBlock {
props {}, props {},
material material::SOLID,
model { ("minecraft", "diamond_block") }, model { ("minecraft", "diamond_block") },
} }
CraftingTable { CraftingTable {
props {}, props {},
material material::SOLID,
model { ("minecraft", "crafting_table") }, model { ("minecraft", "crafting_table") },
} }
Wheat { Wheat {
@ -1101,7 +1072,6 @@ define_blocks! {
], ],
}, },
data Some(facing.index()), data Some(facing.index()),
material material::SOLID,
model { ("minecraft", "furnace") }, model { ("minecraft", "furnace") },
variant format!("facing={}", facing.as_string()), variant format!("facing={}", facing.as_string()),
} }
@ -1309,7 +1279,6 @@ define_blocks! {
} }
RedstoneOre { RedstoneOre {
props {}, props {},
material material::SOLID,
model { ("minecraft", "redstone_ore") }, model { ("minecraft", "redstone_ore") },
} }
RedstoneOreLit { RedstoneOreLit {
@ -1422,7 +1391,6 @@ define_blocks! {
} }
Snow { Snow {
props {}, props {},
material material::SOLID,
model { ("minecraft", "snow") }, model { ("minecraft", "snow") },
} }
Cactus { Cactus {
@ -1439,7 +1407,6 @@ define_blocks! {
} }
Clay { Clay {
props {}, props {},
material material::SOLID,
model { ("minecraft", "clay") }, model { ("minecraft", "clay") },
} }
Reeds { Reeds {
@ -1457,7 +1424,6 @@ define_blocks! {
has_record: bool = [false, true], has_record: bool = [false, true],
}, },
data Some(if has_record { 1 } else { 0 }), data Some(if has_record { 1 } else { 0 }),
material material::SOLID,
model { ("minecraft", "jukebox") }, model { ("minecraft", "jukebox") },
} }
Fence { Fence {
@ -1494,13 +1460,11 @@ define_blocks! {
without_face: bool = [false, true], without_face: bool = [false, true],
}, },
data Some(facing.horizontal_index() | (if without_face { 0x4 } else { 0x0 })), data Some(facing.horizontal_index() | (if without_face { 0x4 } else { 0x0 })),
material material::SOLID,
model { ("minecraft", "pumpkin") }, model { ("minecraft", "pumpkin") },
variant format!("facing={}", facing.as_string()), variant format!("facing={}", facing.as_string()),
} }
Netherrack { Netherrack {
props {}, props {},
material material::SOLID,
model { ("minecraft", "netherrack") }, model { ("minecraft", "netherrack") },
} }
SoulSand { SoulSand {
@ -1664,7 +1628,6 @@ define_blocks! {
], ],
}, },
data Some(variant.data()), data Some(variant.data()),
material material::SOLID,
model { ("minecraft", format!("{}_monster_egg", variant.as_string())) }, model { ("minecraft", format!("{}_monster_egg", variant.as_string())) },
} }
StoneBrick { StoneBrick {
@ -1677,7 +1640,6 @@ define_blocks! {
], ],
}, },
data Some(variant.data()), data Some(variant.data()),
material material::SOLID,
model { ("minecraft", variant.as_string() ) }, model { ("minecraft", variant.as_string() ) },
} }
BrownMushroomBlock { BrownMushroomBlock {
@ -1699,7 +1661,6 @@ define_blocks! {
], ],
}, },
data Some(variant.data()), data Some(variant.data()),
material material::SOLID,
model { ("minecraft", "brown_mushroom_block") }, model { ("minecraft", "brown_mushroom_block") },
variant format!("variant={}", variant.as_string()), variant format!("variant={}", variant.as_string()),
} }
@ -1722,7 +1683,6 @@ define_blocks! {
], ],
}, },
data Some(variant.data()), data Some(variant.data()),
material material::SOLID,
model { ("minecraft", "red_mushroom_block") }, model { ("minecraft", "red_mushroom_block") },
variant format!("variant={}", variant.as_string()), variant format!("variant={}", variant.as_string()),
} }
@ -1779,7 +1739,6 @@ define_blocks! {
} }
MelonBlock { MelonBlock {
props {}, props {},
material material::SOLID,
model { ("minecraft", "melon_block") }, model { ("minecraft", "melon_block") },
} }
PumpkinStem { PumpkinStem {
@ -1962,7 +1921,6 @@ define_blocks! {
} }
NetherBrick { NetherBrick {
props {}, props {},
material material::SOLID,
model { ("minecraft", "nether_brick") }, model { ("minecraft", "nether_brick") },
} }
NetherBrickFence { NetherBrickFence {
@ -2115,7 +2073,6 @@ define_blocks! {
} }
EndStone { EndStone {
props {}, props {},
material material::SOLID,
model { ("minecraft", "end_stone") }, model { ("minecraft", "end_stone") },
} }
DragonEgg { DragonEgg {
@ -2132,7 +2089,6 @@ define_blocks! {
} }
RedstoneLamp { RedstoneLamp {
props {}, props {},
material material::SOLID,
model { ("minecraft", "redstone_lamp") }, model { ("minecraft", "redstone_lamp") },
} }
RedstoneLampLit { RedstoneLampLit {
@ -2155,7 +2111,6 @@ define_blocks! {
], ],
}, },
data Some(variant.data()), data Some(variant.data()),
material material::SOLID,
model { ("minecraft", format!("{}_double_slab", variant.as_string()) ) }, model { ("minecraft", format!("{}_double_slab", variant.as_string()) ) },
} }
WoodenSlab { WoodenSlab {
@ -2311,7 +2266,6 @@ define_blocks! {
} }
EmeraldBlock { EmeraldBlock {
props {}, props {},
material material::SOLID,
model { ("minecraft", "emerald_block") }, model { ("minecraft", "emerald_block") },
} }
SpruceStairs { SpruceStairs {
@ -2396,7 +2350,6 @@ define_blocks! {
], ],
}, },
data Some(facing.index() | (if conditional { 0x8 } else { 0x0 })), data Some(facing.index() | (if conditional { 0x8 } else { 0x0 })),
material material::SOLID,
model { ("minecraft", "command_block") }, model { ("minecraft", "command_block") },
variant format!("conditional={},facing={}", conditional, facing.as_string()), variant format!("conditional={},facing={}", conditional, facing.as_string()),
} }
@ -2681,12 +2634,10 @@ define_blocks! {
} }
RedstoneBlock { RedstoneBlock {
props {}, props {},
material material::SOLID,
model { ("minecraft", "redstone_block") }, model { ("minecraft", "redstone_block") },
} }
QuartzOre { QuartzOre {
props {}, props {},
material material::SOLID,
model { ("minecraft", "quartz_ore") }, model { ("minecraft", "quartz_ore") },
} }
Hopper { Hopper {
@ -2716,7 +2667,6 @@ define_blocks! {
], ],
}, },
data Some(variant.data()), data Some(variant.data()),
material material::SOLID,
model { ("minecraft", match variant { model { ("minecraft", match variant {
QuartzVariant::Normal => "quartz_block", QuartzVariant::Normal => "quartz_block",
QuartzVariant::Chiseled => "chiseled_quartz_block", QuartzVariant::Chiseled => "chiseled_quartz_block",
@ -2780,7 +2730,6 @@ define_blocks! {
triggered: bool = [false, true], triggered: bool = [false, true],
}, },
data Some(facing.index() | (if triggered { 0x8 } else { 0x0 })), data Some(facing.index() | (if triggered { 0x8 } else { 0x0 })),
material material::SOLID,
model { ("minecraft", "dropper") }, model { ("minecraft", "dropper") },
variant format!("facing={}", facing.as_string()), variant format!("facing={}", facing.as_string()),
} }
@ -2806,7 +2755,6 @@ define_blocks! {
], ],
}, },
data Some(color.data()), data Some(color.data()),
material material::SOLID,
model { ("minecraft", format!("{}_stained_hardened_clay", color.as_string()) ) }, model { ("minecraft", format!("{}_stained_hardened_clay", color.as_string()) ) },
} }
StainedGlassPane { StainedGlassPane {
@ -2875,7 +2823,6 @@ define_blocks! {
], ],
}, },
data Some(variant.data() | (axis.index() << 2)), data Some(variant.data() | (axis.index() << 2)),
material material::SOLID,
model { ("minecraft", format!("{}_log", variant.as_string()) ) }, model { ("minecraft", format!("{}_log", variant.as_string()) ) },
variant format!("axis={}", axis.as_string()), variant format!("axis={}", axis.as_string()),
} }
@ -2967,7 +2914,6 @@ define_blocks! {
], ],
}, },
data Some(variant.data()), data Some(variant.data()),
material material::SOLID,
model { ("minecraft", variant.as_string() ) }, model { ("minecraft", variant.as_string() ) },
} }
SeaLantern { SeaLantern {
@ -2983,7 +2929,6 @@ define_blocks! {
axis: Axis = [Axis::X, Axis::Y, Axis::Z], axis: Axis = [Axis::X, Axis::Y, Axis::Z],
}, },
data Some(match axis { Axis::X => 0x4, Axis::Y => 0x0, Axis::Z => 0x8, _ => unreachable!() }), data Some(match axis { Axis::X => 0x4, Axis::Y => 0x0, Axis::Z => 0x8, _ => unreachable!() }),
material material::SOLID,
model { ("minecraft", "hay_block") }, model { ("minecraft", "hay_block") },
variant format!("axis={}", axis.as_string()), variant format!("axis={}", axis.as_string()),
} }
@ -3018,17 +2963,14 @@ define_blocks! {
} }
HardenedClay { HardenedClay {
props {}, props {},
material material::SOLID,
model { ("minecraft", "hardened_clay") }, model { ("minecraft", "hardened_clay") },
} }
CoalBlock { CoalBlock {
props {}, props {},
material material::SOLID,
model { ("minecraft", "coal_block") }, model { ("minecraft", "coal_block") },
} }
PackedIce { PackedIce {
props {}, props {},
material material::SOLID,
model { ("minecraft", "packed_ice") }, model { ("minecraft", "packed_ice") },
} }
DoublePlant { DoublePlant {
@ -3116,7 +3058,6 @@ define_blocks! {
], ],
}, },
data Some(variant.data()), data Some(variant.data()),
material material::SOLID,
model { ("minecraft", variant.as_string()) }, model { ("minecraft", variant.as_string()) },
} }
RedSandstoneStairs { RedSandstoneStairs {
@ -3622,7 +3563,6 @@ define_blocks! {
} }
PurpurBlock { PurpurBlock {
props {}, props {},
material material::SOLID,
model { ("minecraft", "purpur_block") }, model { ("minecraft", "purpur_block") },
} }
PurpurPillar { PurpurPillar {
@ -3630,7 +3570,6 @@ define_blocks! {
axis: Axis = [Axis::X, Axis::Y, Axis::Z], axis: Axis = [Axis::X, Axis::Y, Axis::Z],
}, },
data Some(match axis { Axis::X => 0x4, Axis::Y => 0x0, Axis::Z => 0x8, _ => unreachable!() }), data Some(match axis { Axis::X => 0x4, Axis::Y => 0x0, Axis::Z => 0x8, _ => unreachable!() }),
material material::SOLID,
model { ("minecraft", "purpur_pillar") }, model { ("minecraft", "purpur_pillar") },
variant format!("axis={}", axis.as_string()), variant format!("axis={}", axis.as_string()),
} }
@ -3661,7 +3600,6 @@ define_blocks! {
props { props {
variant: StoneSlabVariant = [StoneSlabVariant::Purpur], variant: StoneSlabVariant = [StoneSlabVariant::Purpur],
}, },
material material::SOLID,
model { ("minecraft", format!("{}_double_slab", variant.as_string()) ) }, model { ("minecraft", format!("{}_double_slab", variant.as_string()) ) },
} }
PurpurSlab { PurpurSlab {
@ -3687,7 +3625,6 @@ define_blocks! {
} }
EndBricks { EndBricks {
props {}, props {},
material material::SOLID,
model { ("minecraft", "end_bricks") }, model { ("minecraft", "end_bricks") },
} }
Beetroots { Beetroots {
@ -3728,7 +3665,6 @@ define_blocks! {
], ],
}, },
data Some(facing.index() | (if conditional { 0x8 } else { 0x0 })), data Some(facing.index() | (if conditional { 0x8 } else { 0x0 })),
material material::SOLID,
model { ("minecraft", "repeating_command_block") }, model { ("minecraft", "repeating_command_block") },
variant format!("conditional={},facing={}", conditional, facing.as_string()), variant format!("conditional={},facing={}", conditional, facing.as_string()),
} }
@ -3745,19 +3681,16 @@ define_blocks! {
], ],
}, },
data Some(facing.index() | (if conditional { 0x8 } else { 0x0 })), data Some(facing.index() | (if conditional { 0x8 } else { 0x0 })),
material material::SOLID,
model { ("minecraft", "chain_command_block") }, model { ("minecraft", "chain_command_block") },
variant format!("conditional={},facing={}", conditional, facing.as_string()), variant format!("conditional={},facing={}", conditional, facing.as_string()),
} }
FrostedIce { FrostedIce {
props {}, props {},
material material::SOLID,
model { ("minecraft", "frosted_ice") }, model { ("minecraft", "frosted_ice") },
} }
Missing { Missing {
props {}, props {},
data None::<usize>, data None::<usize>,
material material::SOLID,
model { ("steven", "missing_block") }, model { ("steven", "missing_block") },
} }
} }