mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
fix block codegen and stop using block data from burger
This commit is contained in:
parent
8e14951022
commit
a2a941f92a
7 changed files with 411 additions and 258 deletions
|
@ -7,6 +7,11 @@ use crate::{Block, BlockBehavior, BlockState, BlockStates, Property};
|
|||
make_block_states! {
|
||||
Properties => {
|
||||
"snowy" => Snowy(bool),
|
||||
"axis" => Axis {
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
},
|
||||
"stage" => OakSaplingStage {
|
||||
_0,
|
||||
_1,
|
||||
|
@ -35,6 +40,10 @@ make_block_states! {
|
|||
_0,
|
||||
_1,
|
||||
},
|
||||
"stage" => PaleOakSaplingStage {
|
||||
_0,
|
||||
_1,
|
||||
},
|
||||
"age" => MangrovePropaguleAge {
|
||||
_0,
|
||||
_1,
|
||||
|
@ -96,11 +105,6 @@ make_block_states! {
|
|||
_2,
|
||||
_3,
|
||||
},
|
||||
"axis" => Axis {
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
},
|
||||
"distance" => OakLeavesDistance {
|
||||
_1,
|
||||
_2,
|
||||
|
@ -165,6 +169,15 @@ make_block_states! {
|
|||
_6,
|
||||
_7,
|
||||
},
|
||||
"distance" => PaleOakLeavesDistance {
|
||||
_1,
|
||||
_2,
|
||||
_3,
|
||||
_4,
|
||||
_5,
|
||||
_6,
|
||||
_7,
|
||||
},
|
||||
"distance" => MangroveLeavesDistance {
|
||||
_1,
|
||||
_2,
|
||||
|
@ -284,7 +297,12 @@ make_block_states! {
|
|||
},
|
||||
"short" => Short(bool),
|
||||
"unstable" => Unstable(bool),
|
||||
"slot_5_occupied" => TrueFalse(bool),
|
||||
"slot_0_occupied" => Slot0Occupied(bool),
|
||||
"slot_1_occupied" => Slot1Occupied(bool),
|
||||
"slot_2_occupied" => Slot2Occupied(bool),
|
||||
"slot_3_occupied" => Slot3Occupied(bool),
|
||||
"slot_4_occupied" => Slot4Occupied(bool),
|
||||
"slot_5_occupied" => Slot5Occupied(bool),
|
||||
"age" => FireAge {
|
||||
_0,
|
||||
_1,
|
||||
|
@ -308,6 +326,8 @@ make_block_states! {
|
|||
"south" => South(bool),
|
||||
"up" => Up(bool),
|
||||
"west" => West(bool),
|
||||
"active" => Active(bool),
|
||||
"natural" => Natural(bool),
|
||||
"half" => TopBottom {
|
||||
Top,
|
||||
Bottom,
|
||||
|
@ -509,6 +529,24 @@ make_block_states! {
|
|||
_14,
|
||||
_15,
|
||||
},
|
||||
"rotation" => PaleOakSignRotation {
|
||||
_0,
|
||||
_1,
|
||||
_2,
|
||||
_3,
|
||||
_4,
|
||||
_5,
|
||||
_6,
|
||||
_7,
|
||||
_8,
|
||||
_9,
|
||||
_10,
|
||||
_11,
|
||||
_12,
|
||||
_13,
|
||||
_14,
|
||||
_15,
|
||||
},
|
||||
"rotation" => MangroveSignRotation {
|
||||
_0,
|
||||
_1,
|
||||
|
@ -689,6 +727,24 @@ make_block_states! {
|
|||
_14,
|
||||
_15,
|
||||
},
|
||||
"rotation" => PaleOakHangingSignRotation {
|
||||
_0,
|
||||
_1,
|
||||
_2,
|
||||
_3,
|
||||
_4,
|
||||
_5,
|
||||
_6,
|
||||
_7,
|
||||
_8,
|
||||
_9,
|
||||
_10,
|
||||
_11,
|
||||
_12,
|
||||
_13,
|
||||
_14,
|
||||
_15,
|
||||
},
|
||||
"rotation" => CrimsonHangingSignRotation {
|
||||
_0,
|
||||
_1,
|
||||
|
@ -855,6 +911,31 @@ make_block_states! {
|
|||
_7,
|
||||
},
|
||||
"in_wall" => InWall(bool),
|
||||
"type" => Type {
|
||||
Top,
|
||||
Bottom,
|
||||
Double,
|
||||
},
|
||||
"east" => WallEast {
|
||||
None,
|
||||
Low,
|
||||
Tall,
|
||||
},
|
||||
"north" => WallNorth {
|
||||
None,
|
||||
Low,
|
||||
Tall,
|
||||
},
|
||||
"south" => WallSouth {
|
||||
None,
|
||||
Low,
|
||||
Tall,
|
||||
},
|
||||
"west" => WallWest {
|
||||
None,
|
||||
Low,
|
||||
Tall,
|
||||
},
|
||||
"age" => NetherWartAge {
|
||||
_0,
|
||||
_1,
|
||||
|
@ -882,26 +963,6 @@ make_block_states! {
|
|||
},
|
||||
"disarmed" => Disarmed(bool),
|
||||
"conditional" => Conditional(bool),
|
||||
"east" => EastWall {
|
||||
None,
|
||||
Low,
|
||||
Tall,
|
||||
},
|
||||
"north" => NorthWall {
|
||||
None,
|
||||
Low,
|
||||
Tall,
|
||||
},
|
||||
"south" => SouthWall {
|
||||
None,
|
||||
Low,
|
||||
Tall,
|
||||
},
|
||||
"west" => WestWall {
|
||||
None,
|
||||
Low,
|
||||
Tall,
|
||||
},
|
||||
"age" => CarrotsAge {
|
||||
_0,
|
||||
_1,
|
||||
|
@ -1133,11 +1194,6 @@ make_block_states! {
|
|||
_14,
|
||||
_15,
|
||||
},
|
||||
"type" => Type {
|
||||
Top,
|
||||
Bottom,
|
||||
Double,
|
||||
},
|
||||
"rotation" => WhiteBannerRotation {
|
||||
_0,
|
||||
_1,
|
||||
|
@ -1438,17 +1494,13 @@ make_block_states! {
|
|||
_0,
|
||||
_1,
|
||||
},
|
||||
"age" => _0_1_2_3_4 {
|
||||
"age" => PitcherCropAge {
|
||||
_0,
|
||||
_1,
|
||||
_2,
|
||||
_3,
|
||||
_4,
|
||||
},
|
||||
"half" => UpperLower {
|
||||
Upper,
|
||||
Lower,
|
||||
},
|
||||
"age" => BeetrootsAge {
|
||||
_0,
|
||||
_1,
|
||||
|
@ -1673,7 +1725,7 @@ make_block_states! {
|
|||
_7,
|
||||
_8,
|
||||
},
|
||||
"power" => TargetOutputPower {
|
||||
"power" => TargetPower {
|
||||
_0,
|
||||
_1,
|
||||
_2,
|
||||
|
@ -1707,7 +1759,7 @@ make_block_states! {
|
|||
_4,
|
||||
_5,
|
||||
},
|
||||
"charges" => RespawnAnchorCharge {
|
||||
"charges" => RespawnAnchorCharges {
|
||||
_0,
|
||||
_1,
|
||||
_2,
|
||||
|
@ -1834,7 +1886,7 @@ make_block_states! {
|
|||
_14,
|
||||
_15,
|
||||
},
|
||||
"sculk_sensor_phase" => Phase {
|
||||
"sculk_sensor_phase" => SculkSensorPhase {
|
||||
Inactive,
|
||||
Active,
|
||||
Cooldown,
|
||||
|
@ -1867,7 +1919,7 @@ make_block_states! {
|
|||
Middle,
|
||||
Base,
|
||||
},
|
||||
"vertical_direction" => TipDirection {
|
||||
"vertical_direction" => VerticalDirection {
|
||||
Up,
|
||||
Down,
|
||||
},
|
||||
|
@ -1900,7 +1952,7 @@ make_block_states! {
|
|||
_25,
|
||||
},
|
||||
"berries" => Berries(bool),
|
||||
"flower_amount" => PinkPetalsAmount {
|
||||
"flower_amount" => PinkPetalsFlowerAmount {
|
||||
_1,
|
||||
_2,
|
||||
_3,
|
||||
|
@ -1912,11 +1964,6 @@ make_block_states! {
|
|||
Partial,
|
||||
Full,
|
||||
},
|
||||
"axis" => Falling {
|
||||
X,
|
||||
Y,
|
||||
Z,
|
||||
},
|
||||
"cracked" => Cracked(bool),
|
||||
"crafting" => Crafting(bool),
|
||||
"ominous" => Ominous(bool),
|
||||
|
@ -1934,6 +1981,7 @@ make_block_states! {
|
|||
Unlocking,
|
||||
Ejecting,
|
||||
},
|
||||
"tip" => Tip(bool),
|
||||
},
|
||||
Blocks => {
|
||||
air => BlockBehavior::new(), {},
|
||||
|
@ -1960,6 +2008,10 @@ make_block_states! {
|
|||
acacia_planks => BlockBehavior::new().strength(2.0, 3.0), {},
|
||||
cherry_planks => BlockBehavior::new().strength(2.0, 3.0), {},
|
||||
dark_oak_planks => BlockBehavior::new().strength(2.0, 3.0), {},
|
||||
pale_oak_wood => BlockBehavior::new(), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
pale_oak_planks => BlockBehavior::new(), {},
|
||||
mangrove_planks => BlockBehavior::new().strength(2.0, 3.0), {},
|
||||
bamboo_planks => BlockBehavior::new().strength(2.0, 3.0), {},
|
||||
bamboo_mosaic => BlockBehavior::new().strength(2.0, 3.0), {},
|
||||
|
@ -1984,6 +2036,9 @@ make_block_states! {
|
|||
dark_oak_sapling => BlockBehavior::new(), {
|
||||
"stage": DarkOakSaplingStage::_0,
|
||||
},
|
||||
pale_oak_sapling => BlockBehavior::new(), {
|
||||
"stage": PaleOakSaplingStage::_0,
|
||||
},
|
||||
mangrove_propagule => BlockBehavior::new(), {
|
||||
"age": MangrovePropaguleAge::_0,
|
||||
"hanging": Hanging(false),
|
||||
|
@ -2034,6 +2089,9 @@ make_block_states! {
|
|||
dark_oak_log => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
pale_oak_log => BlockBehavior::new(), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
mangrove_log => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
|
@ -2064,6 +2122,9 @@ make_block_states! {
|
|||
stripped_dark_oak_log => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
stripped_pale_oak_log => BlockBehavior::new(), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
stripped_oak_log => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
|
@ -2118,6 +2179,9 @@ make_block_states! {
|
|||
stripped_dark_oak_wood => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
stripped_pale_oak_wood => BlockBehavior::new(), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
stripped_mangrove_wood => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
|
@ -2156,6 +2220,11 @@ make_block_states! {
|
|||
"persistent": Persistent(false),
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_leaves => BlockBehavior::new(), {
|
||||
"distance": PaleOakLeavesDistance::_7,
|
||||
"persistent": Persistent(false),
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
mangrove_leaves => BlockBehavior::new().strength(0.2, 0.2), {
|
||||
"distance": MangroveLeavesDistance::_7,
|
||||
"persistent": Persistent(false),
|
||||
|
@ -2345,12 +2414,12 @@ make_block_states! {
|
|||
bookshelf => BlockBehavior::new().strength(1.5, 1.5), {},
|
||||
chiseled_bookshelf => BlockBehavior::new().strength(1.5, 1.5), {
|
||||
"facing": FacingCardinal::North,
|
||||
"slot_0_occupied": TrueFalse(false),
|
||||
"slot_1_occupied": TrueFalse(false),
|
||||
"slot_2_occupied": TrueFalse(false),
|
||||
"slot_3_occupied": TrueFalse(false),
|
||||
"slot_4_occupied": TrueFalse(false),
|
||||
"slot_5_occupied": TrueFalse(false),
|
||||
"slot_0_occupied": Slot0Occupied(false),
|
||||
"slot_1_occupied": Slot1Occupied(false),
|
||||
"slot_2_occupied": Slot2Occupied(false),
|
||||
"slot_3_occupied": Slot3Occupied(false),
|
||||
"slot_4_occupied": Slot4Occupied(false),
|
||||
"slot_5_occupied": Slot5Occupied(false),
|
||||
},
|
||||
mossy_cobblestone => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {},
|
||||
obsidian => BlockBehavior::new().requires_correct_tool_for_drops().strength(50.0, 1200.0), {},
|
||||
|
@ -2368,6 +2437,11 @@ make_block_states! {
|
|||
},
|
||||
soul_fire => BlockBehavior::new(), {},
|
||||
spawner => BlockBehavior::new().requires_correct_tool_for_drops().strength(5.0, 5.0), {},
|
||||
creaking_heart => BlockBehavior::new(), {
|
||||
"active": Active(false),
|
||||
"axis": Axis::Y,
|
||||
"natural": Natural(false),
|
||||
},
|
||||
oak_stairs => BlockBehavior::new().strength(2.0, 3.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": TopBottom::Bottom,
|
||||
|
@ -2428,6 +2502,10 @@ make_block_states! {
|
|||
"rotation": DarkOakSignRotation::_0,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_sign => BlockBehavior::new(), {
|
||||
"rotation": PaleOakSignRotation::_0,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
mangrove_sign => BlockBehavior::new().strength(1.0, 1.0), {
|
||||
"rotation": MangroveSignRotation::_0,
|
||||
"waterlogged": Waterlogged(false),
|
||||
|
@ -2485,6 +2563,10 @@ make_block_states! {
|
|||
"facing": FacingCardinal::North,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_wall_sign => BlockBehavior::new(), {
|
||||
"facing": FacingCardinal::North,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
mangrove_wall_sign => BlockBehavior::new().strength(1.0, 1.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"waterlogged": Waterlogged(false),
|
||||
|
@ -2528,6 +2610,11 @@ make_block_states! {
|
|||
"rotation": DarkOakHangingSignRotation::_0,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_hanging_sign => BlockBehavior::new(), {
|
||||
"attached": Attached(false),
|
||||
"rotation": PaleOakHangingSignRotation::_0,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
crimson_hanging_sign => BlockBehavior::new().strength(1.0, 1.0), {
|
||||
"attached": Attached(false),
|
||||
"rotation": CrimsonHangingSignRotation::_0,
|
||||
|
@ -2576,6 +2663,10 @@ make_block_states! {
|
|||
"facing": FacingCardinal::North,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_wall_hanging_sign => BlockBehavior::new(), {
|
||||
"facing": FacingCardinal::North,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
mangrove_wall_hanging_sign => BlockBehavior::new().strength(1.0, 1.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"waterlogged": Waterlogged(false),
|
||||
|
@ -2628,6 +2719,9 @@ make_block_states! {
|
|||
dark_oak_pressure_plate => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
"powered": Powered(false),
|
||||
},
|
||||
pale_oak_pressure_plate => BlockBehavior::new(), {
|
||||
"powered": Powered(false),
|
||||
},
|
||||
mangrove_pressure_plate => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
"powered": Powered(false),
|
||||
},
|
||||
|
@ -2771,6 +2865,13 @@ make_block_states! {
|
|||
"powered": Powered(false),
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_trapdoor => BlockBehavior::new(), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": TopBottom::Bottom,
|
||||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
mangrove_trapdoor => BlockBehavior::new().strength(3.0, 3.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": TopBottom::Bottom,
|
||||
|
@ -2869,6 +2970,15 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
"west": West(false),
|
||||
},
|
||||
resin_clump => BlockBehavior::new(), {
|
||||
"down": Down(false),
|
||||
"east": East(false),
|
||||
"north": North(false),
|
||||
"south": South(false),
|
||||
"up": Up(false),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": West(false),
|
||||
},
|
||||
oak_fence_gate => BlockBehavior::new().strength(2.0, 3.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"in_wall": InWall(false),
|
||||
|
@ -2897,6 +3007,27 @@ make_block_states! {
|
|||
"snowy": Snowy(false),
|
||||
},
|
||||
lily_pad => BlockBehavior::new(), {},
|
||||
resin_block => BlockBehavior::new(), {},
|
||||
resin_bricks => BlockBehavior::new(), {},
|
||||
resin_brick_stairs => BlockBehavior::new(), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": TopBottom::Bottom,
|
||||
"shape": StairShape::Straight,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
resin_brick_slab => BlockBehavior::new(), {
|
||||
"type": Type::Bottom,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
resin_brick_wall => BlockBehavior::new(), {
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WallWest::None,
|
||||
},
|
||||
chiseled_resin_bricks => BlockBehavior::new(), {},
|
||||
nether_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {},
|
||||
nether_brick_fence => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {
|
||||
"east": East(false),
|
||||
|
@ -2993,20 +3124,20 @@ make_block_states! {
|
|||
},
|
||||
beacon => BlockBehavior::new().strength(3.0, 3.0), {},
|
||||
cobblestone_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
mossy_cobblestone_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
flower_pot => BlockBehavior::new(), {},
|
||||
potted_torchflower => BlockBehavior::new(), {},
|
||||
|
@ -3017,6 +3148,7 @@ make_block_states! {
|
|||
potted_acacia_sapling => BlockBehavior::new(), {},
|
||||
potted_cherry_sapling => BlockBehavior::new(), {},
|
||||
potted_dark_oak_sapling => BlockBehavior::new(), {},
|
||||
potted_pale_oak_sapling => BlockBehavior::new(), {},
|
||||
potted_mangrove_propagule => BlockBehavior::new(), {},
|
||||
potted_fern => BlockBehavior::new(), {},
|
||||
potted_dandelion => BlockBehavior::new(), {},
|
||||
|
@ -3077,6 +3209,11 @@ make_block_states! {
|
|||
"facing": FacingCardinal::North,
|
||||
"powered": Powered(false),
|
||||
},
|
||||
pale_oak_button => BlockBehavior::new(), {
|
||||
"face": Face::Wall,
|
||||
"facing": FacingCardinal::North,
|
||||
"powered": Powered(false),
|
||||
},
|
||||
mangrove_button => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
"face": Face::Wall,
|
||||
"facing": FacingCardinal::North,
|
||||
|
@ -3344,6 +3481,12 @@ make_block_states! {
|
|||
"shape": StairShape::Straight,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_stairs => BlockBehavior::new(), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": TopBottom::Bottom,
|
||||
"shape": StairShape::Straight,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
mangrove_stairs => BlockBehavior::new().strength(2.0, 3.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": TopBottom::Bottom,
|
||||
|
@ -3584,6 +3727,10 @@ make_block_states! {
|
|||
"type": Type::Bottom,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_slab => BlockBehavior::new(), {
|
||||
"type": Type::Bottom,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
mangrove_slab => BlockBehavior::new().strength(2.0, 3.0), {
|
||||
"type": Type::Bottom,
|
||||
"waterlogged": Waterlogged(false),
|
||||
|
@ -3692,6 +3839,12 @@ make_block_states! {
|
|||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
pale_oak_fence_gate => BlockBehavior::new(), {
|
||||
"facing": FacingCardinal::North,
|
||||
"in_wall": InWall(false),
|
||||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
mangrove_fence_gate => BlockBehavior::new().strength(2.0, 3.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"in_wall": InWall(false),
|
||||
|
@ -3746,6 +3899,13 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
"west": West(false),
|
||||
},
|
||||
pale_oak_fence => BlockBehavior::new(), {
|
||||
"east": East(false),
|
||||
"north": North(false),
|
||||
"south": South(false),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": West(false),
|
||||
},
|
||||
mangrove_fence => BlockBehavior::new().strength(2.0, 3.0), {
|
||||
"east": East(false),
|
||||
"north": North(false),
|
||||
|
@ -3802,6 +3962,13 @@ make_block_states! {
|
|||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
pale_oak_door => BlockBehavior::new(), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": Half::Lower,
|
||||
"hinge": Hinge::Left,
|
||||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
mangrove_door => BlockBehavior::new().strength(3.0, 3.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": Half::Lower,
|
||||
|
@ -3845,8 +4012,8 @@ make_block_states! {
|
|||
"age": TorchflowerCropAge::_0,
|
||||
},
|
||||
pitcher_crop => BlockBehavior::new(), {
|
||||
"age": _0_1_2_3_4::_0,
|
||||
"half": UpperLower::Lower,
|
||||
"age": PitcherCropAge::_0,
|
||||
"half": Half::Lower,
|
||||
},
|
||||
pitcher_plant => BlockBehavior::new(), {
|
||||
"half": Half::Lower,
|
||||
|
@ -4288,108 +4455,108 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
prismarine_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
red_sandstone_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.8, 0.8), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
mossy_stone_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
granite_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
stone_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
mud_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 3.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
nether_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
andesite_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
red_nether_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
sandstone_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.8, 0.8), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
end_stone_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 9.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
diorite_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
scaffolding => BlockBehavior::new(), {
|
||||
"bottom": Bottom(false),
|
||||
|
@ -4613,7 +4780,7 @@ make_block_states! {
|
|||
"level": ComposterLevel::_0,
|
||||
},
|
||||
target => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
"power": TargetOutputPower::_0,
|
||||
"power": TargetPower::_0,
|
||||
},
|
||||
bee_nest => BlockBehavior::new().strength(0.3, 0.3), {
|
||||
"facing": FacingCardinal::North,
|
||||
|
@ -4629,7 +4796,7 @@ make_block_states! {
|
|||
ancient_debris => BlockBehavior::new().requires_correct_tool_for_drops().strength(30.0, 1200.0), {},
|
||||
crying_obsidian => BlockBehavior::new().requires_correct_tool_for_drops().strength(50.0, 1200.0), {},
|
||||
respawn_anchor => BlockBehavior::new().requires_correct_tool_for_drops().strength(50.0, 1200.0), {
|
||||
"charges": RespawnAnchorCharge::_0,
|
||||
"charges": RespawnAnchorCharges::_0,
|
||||
},
|
||||
potted_crimson_fungus => BlockBehavior::new(), {},
|
||||
potted_warped_fungus => BlockBehavior::new(), {},
|
||||
|
@ -4644,12 +4811,12 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
blackstone_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
blackstone_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {
|
||||
"type": Type::Bottom,
|
||||
|
@ -4670,12 +4837,12 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
polished_blackstone_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
gilded_blackstone => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {},
|
||||
polished_blackstone_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {
|
||||
|
@ -4697,12 +4864,12 @@ make_block_states! {
|
|||
"powered": Powered(false),
|
||||
},
|
||||
polished_blackstone_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
chiseled_nether_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {},
|
||||
cracked_nether_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(2.0, 6.0), {},
|
||||
|
@ -4873,12 +5040,12 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
tuff_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
polished_tuff => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {},
|
||||
polished_tuff_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
|
@ -4892,12 +5059,12 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
polished_tuff_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
chiseled_tuff => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {},
|
||||
tuff_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {},
|
||||
|
@ -4912,12 +5079,12 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
tuff_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
chiseled_tuff_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {},
|
||||
calcite => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.75, 0.75), {},
|
||||
|
@ -4925,13 +5092,13 @@ make_block_states! {
|
|||
powder_snow => BlockBehavior::new().strength(0.25, 0.25), {},
|
||||
sculk_sensor => BlockBehavior::new().strength(1.5, 1.5), {
|
||||
"power": SculkSensorPower::_0,
|
||||
"sculk_sensor_phase": Phase::Inactive,
|
||||
"sculk_sensor_phase": SculkSensorPhase::Inactive,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
calibrated_sculk_sensor => BlockBehavior::new().strength(1.5, 1.5), {
|
||||
"facing": FacingCardinal::North,
|
||||
"power": CalibratedSculkSensorPower::_0,
|
||||
"sculk_sensor_phase": Phase::Inactive,
|
||||
"sculk_sensor_phase": SculkSensorPhase::Inactive,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
sculk => BlockBehavior::new().strength(0.2, 0.2), {},
|
||||
|
@ -5233,7 +5400,7 @@ make_block_states! {
|
|||
},
|
||||
pointed_dripstone => BlockBehavior::new().strength(1.5, 3.0), {
|
||||
"thickness": Thickness::Tip,
|
||||
"vertical_direction": TipDirection::Up,
|
||||
"vertical_direction": VerticalDirection::Up,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
dripstone_block => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 1.0), {},
|
||||
|
@ -5250,7 +5417,7 @@ make_block_states! {
|
|||
moss_carpet => BlockBehavior::new().strength(0.1, 0.1), {},
|
||||
pink_petals => BlockBehavior::new(), {
|
||||
"facing": FacingCardinal::North,
|
||||
"flower_amount": PinkPetalsAmount::_1,
|
||||
"flower_amount": PinkPetalsFlowerAmount::_1,
|
||||
},
|
||||
moss_block => BlockBehavior::new().strength(0.1, 0.1), {},
|
||||
big_dripleaf => BlockBehavior::new().strength(0.1, 0.1), {
|
||||
|
@ -5287,12 +5454,12 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
cobbled_deepslate_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
polished_deepslate => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {},
|
||||
polished_deepslate_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {
|
||||
|
@ -5306,12 +5473,12 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
polished_deepslate_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
deepslate_tiles => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {},
|
||||
deepslate_tile_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {
|
||||
|
@ -5325,12 +5492,12 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
deepslate_tile_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
deepslate_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {},
|
||||
deepslate_brick_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {
|
||||
|
@ -5344,18 +5511,18 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
deepslate_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {
|
||||
"east": EastWall::None,
|
||||
"north": NorthWall::None,
|
||||
"south": SouthWall::None,
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"up": Up(true),
|
||||
"waterlogged": Waterlogged(false),
|
||||
"west": WestWall::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
chiseled_deepslate => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {},
|
||||
cracked_deepslate_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {},
|
||||
cracked_deepslate_tiles => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 6.0), {},
|
||||
infested_deepslate => BlockBehavior::new().strength(1.5, 0.75), {
|
||||
"axis": Falling::Y,
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
smooth_basalt => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.25, 4.2), {},
|
||||
raw_iron_block => BlockBehavior::new().requires_correct_tool_for_drops().strength(5.0, 6.0), {},
|
||||
|
@ -5396,5 +5563,20 @@ make_block_states! {
|
|||
heavy_core => BlockBehavior::new(), {
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_moss_block => BlockBehavior::new(), {},
|
||||
pale_moss_carpet => BlockBehavior::new(), {
|
||||
"bottom": Bottom(true),
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
"west": WallWest::None,
|
||||
},
|
||||
pale_hanging_moss => BlockBehavior::new(), {
|
||||
"tip": Tip(true),
|
||||
},
|
||||
open_eyeblossom => BlockBehavior::new(), {},
|
||||
closed_eyeblossom => BlockBehavior::new(), {},
|
||||
potted_open_eyeblossom => BlockBehavior::new(), {},
|
||||
potted_closed_eyeblossom => BlockBehavior::new(), {},
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1740,11 +1740,11 @@ impl BlockWithShape for BlockState {
|
|||
}
|
||||
|
||||
fn is_shape_empty(&self) -> bool {
|
||||
matches!(self.id, 0|29..=42|45..=84|86..=117|1987..=2034|2047..=2053|2106..=2133|2398..=2915|3030..=4325|4330..=4337|4354..=4577|4610..=4673|4746..=4765|4846..=4901|4910..=5373|5438..=5693|5790..=5815|5880..=5893|5896..=5899|5904..=5938|5965..=5980|6024..=6028|6030..=6031|7043..=7228|7231..=7232|7235..=7236|7239..=7240|7243..=7244|7247..=7248|7251..=7252|7255..=7256|7615..=7618|7636|7751..=7894|8155|8158|8479|8482|8826..=9009|9034..=9081|9398..=9429|9575..=9598|10702..=10733|11082..=11413|11651..=11652|11655..=11656|11659..=11660|11663..=11664|11667..=11668|11671..=11672|11675..=11676|11679..=11680|11683..=11684|11687..=11688|11691..=11692|11695..=11696|11699..=11700|11703..=11704|11707..=11708|11711..=11712|11715..=11716|11719..=11720|11723..=11724|11727..=11728|11731..=11732|11735..=11736|11739..=11740|11743..=11744|11747..=11748|11751..=11752|11755..=11756|11759..=11760|11763..=11764|11767..=11768|11771..=11772|11775..=11776|11779..=11780|11783..=11784|11787..=11788|11791..=11792|11795..=11796|11799..=11800|11803..=11804|11807..=11808|11811..=11812|11815..=11816|11819..=11820|11823..=11824|11827..=11828|11831..=11832|11835..=11836|11839..=11840|11875..=11876|11879..=11880|11883..=11884|11887..=11888|11891..=11892|11895..=11896|11899..=11900|11903..=11904|11907..=11908|11911..=11912|11915..=11916|11919..=11920|11923..=11924|11927..=11928|11931..=11932|11935..=11936|12964..=12965|12968|12970|12972|12974|12976..=12981|12983|13018|13229..=13255|13282..=13401|13413|13427..=13430|14635|14638|14959|14962|15283|15286|15607|15610|15931|15934|16255|16258|16579|16582|16903|16906|17227|17230|17551|17554|17875|17878|18199|18202|18523|18526|19044..=19047|19061|19063..=19064|19078|19080..=19134|19149..=19152|19345..=19346|19349..=19350|19353..=19354|19357..=19358|19361..=19362|19365..=19366|19369..=19370|19373..=19374|19377..=19378|19381..=19382|19385..=19386|19389..=19390|19393..=19394|19397..=19398|19401..=19402|19405..=19406|19569..=19616|19745..=19824|20016|20019|20436|20439|20841..=20866|20873|20876|21643|21646|22054|22057|22466|22469|22787|23269..=23396|25238..=25292|25296..=25311|25319..=25320|25327..=25328|25335..=25336|25343..=25370|25469|25472|25880|25883|26291|26294|26702|26705|27041)
|
||||
matches!(self.id, 0|29..=42|45..=84|86..=117|1987..=2034|2047..=2053|2106..=2133|2398..=2915|3033..=4328|4333..=4340|4357..=4580|4613..=4676|4749..=4768|4849..=4904|4913..=5376|5441..=5696|5793..=5818|5883..=5896|5899..=5902|5907..=5941|5968..=5983|6027..=6031|6033..=6034|7046..=7229|7358..=7359|7362..=7363|7366..=7367|7370..=7371|7374..=7375|7378..=7379|7382..=7383|7386..=7387|8159..=8162|8180|8295..=8438|8699|8702|9023|9026|9370..=9553|9578..=9625|9942..=9973|10119..=10142|11246..=11277|11626..=11957|12195..=12196|12199..=12200|12203..=12204|12207..=12208|12211..=12212|12215..=12216|12219..=12220|12223..=12224|12227..=12228|12231..=12232|12235..=12236|12239..=12240|12243..=12244|12247..=12248|12251..=12252|12255..=12256|12259..=12260|12263..=12264|12267..=12268|12271..=12272|12275..=12276|12279..=12280|12283..=12284|12287..=12288|12291..=12292|12295..=12296|12299..=12300|12303..=12304|12307..=12308|12311..=12312|12315..=12316|12319..=12320|12323..=12324|12327..=12328|12331..=12332|12335..=12336|12339..=12340|12343..=12344|12347..=12348|12351..=12352|12355..=12356|12359..=12360|12363..=12364|12367..=12368|12371..=12372|12375..=12376|12379..=12380|12383..=12384|12419..=12420|12423..=12424|12427..=12428|12431..=12432|12435..=12436|12439..=12440|12443..=12444|12447..=12448|12451..=12452|12455..=12456|12459..=12460|12463..=12464|12467..=12468|12471..=12472|12475..=12476|12479..=12480|13508..=13509|13512|13514|13516|13518|13520..=13525|13527|13562|13773..=13799|13826..=13945|13957|13971..=13974|15179|15182|15503|15506|15827|15830|16151|16154|16475|16478|16799|16802|17123|17126|17447|17450|17771|17774|18095|18098|18419|18422|18743|18746|19067|19070|19588..=19591|19605|19607..=19608|19622|19624..=19678|19693..=19696|19889..=19890|19893..=19894|19897..=19898|19901..=19902|19905..=19906|19909..=19910|19913..=19914|19917..=19918|19921..=19922|19925..=19926|19929..=19930|19933..=19934|19937..=19938|19941..=19942|19945..=19946|19949..=19950|20113..=20160|20289..=20368|20560|20563|20980|20983|21385..=21410|21417|21420|22187|22190|22598|22601|23010|23013|23331|23813..=23940|25782..=25836|25840..=25855|25863..=25864|25871..=25872|25879..=25880|25887..=25914|26013|26016|26424|26427|26835|26838|27246|27249|27585)
|
||||
}
|
||||
|
||||
fn is_shape_full(&self) -> bool {
|
||||
matches!(self.id, 1..=21|26..=28|85|118..=156|160..=188|192..=245|249..=447|476..=1730|2041..=2046|2060..=2065|2090..=2105|2134..=2397|2916|4326..=4329|4346..=4353|5900..=5903|5946..=5947|5964|5981..=5982|6015|6017..=6023|6029|6032..=6039|6111..=6126|6767..=6970|7041..=7042|7499..=7500|7502|7645|7647..=7648|7741..=7742|7895|8136..=8148|9478..=9479|9490..=9494|9599..=9626|10699..=10701|10798..=10800|11045..=11046|11051..=11052|11057..=11062|11079..=11081|11414..=11416|11501..=11502|11507..=11508|11513..=11514|11519..=11520|11525..=11526|11531..=11532|11537..=11538|11549..=11550|11555..=11556|11561..=11562|11567..=11568|11573..=11574|11579..=11580|11585..=11586|11591..=11592|11597..=11598|11603..=11604|11609..=11610|11615..=11616|11621..=11622|11627..=11628|11633..=11634|11639..=11640|11645..=11650|12873..=12882|12963|12984..=13017|13019..=13228|13256|13272..=13281|13410|14555..=14556|14561..=14562|14567..=14568|14573..=14574|14579..=14580|14585..=14586|14591..=14592|14597..=14598|14603..=14604|14609..=14610|14615..=14616|14621..=14622|14627..=14628|18873..=18906|18935|19048..=19060|19062|19065..=19077|19079|19135..=19136|19141..=19142|19147..=19148|19825..=19840|19850..=19913|19915..=19923|19928..=19929|20338..=20343|20348..=20349|20754|20839..=20840|21191..=21193|21500..=21501|21550|21555..=21556|21961|21966..=21967|22372..=22373|22378..=22379|22784..=22786|23268|23397..=23398|23407..=23424|23749..=23750|23755..=23756|23761..=23762|23767..=23776|24101..=24102|24107..=24108|24113..=24114|24119..=24120|25145..=25192|25237|25312|25371|25373..=25376|25461..=25462|25787|25872..=25873|26198|26283..=26284|26609|26694..=26695|27020..=27029|27032..=27040|27042|27059..=27112)
|
||||
matches!(self.id, 1..=21|26..=28|85|118..=156|160..=188|192..=245|249..=447|476..=1730|2041..=2046|2060..=2065|2090..=2105|2134..=2397|2916|4329..=4332|4349..=4356|5903..=5906|5949..=5950|5967|5984..=5985|6018|6020..=6026|6032|6035..=6042|6114..=6129|6770..=6973|7044..=7045|7630..=7631|8046|8189|8191..=8192|8285..=8286|8439|8680..=8692|10022..=10023|10034..=10038|10143..=10170|11243..=11245|11342..=11344|11589..=11590|11595..=11596|11601..=11606|11623..=11625|11958..=11960|12045..=12046|12051..=12052|12057..=12058|12063..=12064|12069..=12070|12075..=12076|12081..=12082|12093..=12094|12099..=12100|12105..=12106|12111..=12112|12117..=12118|12123..=12124|12129..=12130|12135..=12136|12141..=12142|12147..=12148|12153..=12154|12159..=12160|12165..=12166|12171..=12172|12177..=12178|12183..=12184|12189..=12194|13417..=13426|13507|13528..=13561|13563..=13772|13800|13816..=13825|13954|15099..=15100|15105..=15106|15111..=15112|15117..=15118|15123..=15124|15129..=15130|15135..=15136|15141..=15142|15147..=15148|15153..=15154|15159..=15160|15165..=15166|15171..=15172|19417..=19450|19479|19592..=19604|19606|19609..=19621|19623|19679..=19680|19685..=19686|19691..=19692|20369..=20384|20394..=20457|20459..=20467|20472..=20473|20882..=20887|20892..=20893|21298|21383..=21384|21735..=21737|22044..=22045|22094|22099..=22100|22505|22510..=22511|22916..=22917|22922..=22923|23328..=23330|23812|23941..=23942|23951..=23968|24293..=24294|24299..=24300|24305..=24306|24311..=24320|24645..=24646|24651..=24652|24657..=24658|24663..=24664|25689..=25736|25781|25856|25915|25917..=25920|26005..=26006|26331|26416..=26417|26742|26827..=26828|27153|27238..=27239|27564..=27573|27576..=27584|27586|27603..=27656)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -7,25 +7,49 @@ import lib.download
|
|||
import lib.extract
|
||||
import lib.utils
|
||||
|
||||
version_id = lib.code.version.get_version_id()
|
||||
def generate():
|
||||
version_id = lib.code.version.get_version_id()
|
||||
|
||||
# TODO: pixlyzer is broken so we use old data
|
||||
shape_datas = lib.extract.get_pixlyzer_data(
|
||||
'1.20.3-pre4', 'shapes')
|
||||
pixlyzer_block_datas = lib.extract.get_pixlyzer_data(
|
||||
'1.20.3-pre4', 'blocks')
|
||||
# TODO: pixlyzer is broken so we use old data
|
||||
shape_datas = lib.extract.get_pixlyzer_data(
|
||||
'1.20.3-pre4', 'shapes')
|
||||
pixlyzer_block_datas = lib.extract.get_pixlyzer_data(
|
||||
'1.20.3-pre4', 'blocks')
|
||||
|
||||
mappings = lib.download.get_mappings_for_version(version_id)
|
||||
block_states_burger = lib.extract.get_block_states_burger(version_id)
|
||||
ordered_blocks = lib.extract.get_ordered_blocks_burger(version_id)
|
||||
block_states_report = lib.extract.get_block_states_report(version_id)
|
||||
|
||||
lib.code.blocks.generate_blocks(
|
||||
block_states_burger, block_states_report, pixlyzer_block_datas, ordered_blocks, mappings)
|
||||
mappings = lib.download.get_mappings_for_version(version_id)
|
||||
block_states_report = lib.extract.get_block_states_report(version_id)
|
||||
|
||||
lib.code.shapes.generate_block_shapes(
|
||||
pixlyzer_block_datas, shape_datas['shapes'], shape_datas['aabbs'], block_states_report, block_states_burger, mappings)
|
||||
registries = lib.extract.get_registries_report(version_id)
|
||||
ordered_blocks = get_ordered_blocks(registries)
|
||||
|
||||
lib.code.utils.fmt()
|
||||
lib.code.blocks.generate_blocks(
|
||||
block_states_report, pixlyzer_block_datas, ordered_blocks, mappings)
|
||||
|
||||
print('Done!')
|
||||
lib.code.shapes.generate_block_shapes(
|
||||
pixlyzer_block_datas, shape_datas['shapes'], shape_datas['aabbs'], block_states_report, mappings)
|
||||
|
||||
lib.code.utils.fmt()
|
||||
|
||||
print('Done!')
|
||||
|
||||
def get_ordered_blocks(registries_report: dict[str, dict]) -> list[str]:
|
||||
'''
|
||||
Returns a list of block ids (like ['air', 'stone', ...]) ordered by their protocol id.
|
||||
'''
|
||||
blocks_registry = registries_report['minecraft:block']
|
||||
|
||||
blocks_to_ids = {}
|
||||
for block_id, value in blocks_registry['entries'].items():
|
||||
prefix = 'minecraft:'
|
||||
assert block_id.startswith(prefix)
|
||||
block_id = block_id[len(prefix):]
|
||||
protocol_id = value['protocol_id']
|
||||
blocks_to_ids[block_id] = protocol_id
|
||||
|
||||
ordered_blocks = []
|
||||
for block_id in sorted(blocks_to_ids, key=blocks_to_ids.get):
|
||||
ordered_blocks.append(block_id)
|
||||
return ordered_blocks
|
||||
|
||||
generate()
|
||||
|
|
|
@ -14,7 +14,6 @@ def generate(version_id: str):
|
|||
lib.code.registry.generate_registries(registries)
|
||||
lib.code.inventory.update_menus(registries['minecraft:menu']['entries'])
|
||||
|
||||
|
||||
block_tags = lib.extract.get_registry_tags(version_id, 'block')
|
||||
item_tags = lib.extract.get_registry_tags(version_id, 'item')
|
||||
fluid_tags = lib.extract.get_registry_tags(version_id, 'fluid')
|
||||
|
|
|
@ -12,7 +12,7 @@ BLOCKS_RS_DIR = get_dir_location('../azalea-block/src/generated.rs')
|
|||
# - Block: Has properties and states.
|
||||
|
||||
|
||||
def generate_blocks(blocks_burger: dict, blocks_report: dict, pixlyzer_block_datas: dict, ordered_blocks: list[str], mappings: Mappings):
|
||||
def generate_blocks(blocks_report: dict, pixlyzer_block_datas: dict, ordered_blocks: list[str], mappings: Mappings):
|
||||
with open(BLOCKS_RS_DIR, 'r') as f:
|
||||
existing_code = f.read().splitlines()
|
||||
|
||||
|
@ -25,25 +25,14 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, pixlyzer_block_dat
|
|||
# This dict looks like { 'FloweringAzaleaLeavesDistance': 'distance' }
|
||||
property_struct_names_to_names = {}
|
||||
for block_id in ordered_blocks:
|
||||
block_data_burger = blocks_burger[block_id]
|
||||
block_data_report = blocks_report[f'minecraft:{block_id}']
|
||||
|
||||
block_properties = {}
|
||||
for property_name in list(block_data_report.get('properties', {}).keys()):
|
||||
property_burger = None
|
||||
for property in block_data_burger.get('states', []):
|
||||
if property['name'] == property_name:
|
||||
property_burger = property
|
||||
break
|
||||
|
||||
property_variants = block_data_report['properties'][property_name]
|
||||
|
||||
if property_burger is None:
|
||||
print(
|
||||
f'Warning: The reports have states for a block, but Burger doesn\'t! (missing "{property_name}")', block_data_burger)
|
||||
for property_id in list(block_data_report.get('properties', {}).keys()):
|
||||
property_variants = block_data_report['properties'][property_id]
|
||||
|
||||
property_struct_name = get_property_struct_name(
|
||||
property_burger, block_data_burger, property_variants, mappings)
|
||||
block_id, property_id, property_variants, mappings)
|
||||
|
||||
if property_struct_name in properties:
|
||||
if not properties[property_struct_name] == property_variants:
|
||||
|
@ -55,7 +44,7 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, pixlyzer_block_dat
|
|||
|
||||
block_properties[property_struct_name] = property_variants
|
||||
|
||||
property_struct_names_to_names[property_struct_name] = property_name
|
||||
property_struct_names_to_names[property_struct_name] = property_id
|
||||
|
||||
properties.update(block_properties)
|
||||
|
||||
|
@ -67,7 +56,7 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, pixlyzer_block_dat
|
|||
# Wall,
|
||||
# Ceiling,
|
||||
# },
|
||||
property_name = property_struct_names_to_names[property_struct_name]
|
||||
property_id = property_struct_names_to_names[property_struct_name]
|
||||
|
||||
# if the only variants are true and false, we make it unit struct with a boolean instead of an enum
|
||||
if property_variants == ['true', 'false']:
|
||||
|
@ -79,38 +68,28 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, pixlyzer_block_dat
|
|||
property_shape_code += ' }'
|
||||
|
||||
new_make_block_states_macro_code.append(
|
||||
f' "{property_name}" => {property_shape_code},')
|
||||
f' "{property_id}" => {property_shape_code},')
|
||||
|
||||
new_make_block_states_macro_code.append(' },')
|
||||
|
||||
# Block codegen
|
||||
new_make_block_states_macro_code.append(' Blocks => {')
|
||||
for block_id in ordered_blocks:
|
||||
block_data_burger = blocks_burger[block_id]
|
||||
block_data_report = blocks_report['minecraft:' + block_id]
|
||||
block_data_pixlyzer = pixlyzer_block_datas.get(f'minecraft:{block_id}', {})
|
||||
|
||||
block_properties = block_data_burger.get('states', [])
|
||||
block_properties_burger = block_data_burger.get('states', [])
|
||||
|
||||
default_property_variants: dict[str, str] = {}
|
||||
for state in block_data_report['states']:
|
||||
if state.get('default'):
|
||||
default_property_variants = state.get('properties', {})
|
||||
|
||||
properties_code = '{'
|
||||
for property_name in list(block_data_report.get('properties', {}).keys()):
|
||||
property_burger = None
|
||||
for property in block_data_burger.get('states', []):
|
||||
if property['name'] == property_name:
|
||||
property_burger = property
|
||||
break
|
||||
|
||||
property_default = default_property_variants.get(property_name)
|
||||
property_variants = block_data_report['properties'][property_name]
|
||||
for property_id in list(block_data_report.get('properties', {}).keys()):
|
||||
property_default = default_property_variants.get(property_id)
|
||||
property_variants = block_data_report['properties'][property_id]
|
||||
|
||||
property_struct_name = get_property_struct_name(
|
||||
property_burger, block_data_burger, property_variants, mappings)
|
||||
block_id, property_id, property_variants, mappings)
|
||||
|
||||
is_boolean_property = property_variants == ['true', 'false']
|
||||
|
||||
|
@ -123,7 +102,7 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, pixlyzer_block_dat
|
|||
|
||||
assert property_default is not None
|
||||
|
||||
this_property_code = f'"{property_name}": {property_default_type}'
|
||||
this_property_code = f'"{property_id}": {property_default_type}'
|
||||
|
||||
properties_code += f'\n {this_property_code},'
|
||||
# if there's nothing inside the properties, keep it in one line
|
||||
|
@ -177,8 +156,7 @@ def generate_blocks(blocks_burger: dict, blocks_report: dict, pixlyzer_block_dat
|
|||
with open(BLOCKS_RS_DIR, 'w') as f:
|
||||
f.write('\n'.join(new_code))
|
||||
|
||||
|
||||
def get_property_struct_name(property: Optional[dict], block_data_burger: dict, property_variants: list[str], mappings: Mappings) -> str:
|
||||
def get_property_struct_name(block_id: str, property_id: str, property_variants: list[str], mappings: Mappings) -> str:
|
||||
# these are hardcoded because otherwise they cause conflicts
|
||||
# some names inspired by https://github.com/feather-rs/feather/blob/main/feather/blocks/src/generated/table.rs
|
||||
if property_variants == ['north', 'east', 'south', 'west', 'up', 'down']:
|
||||
|
@ -205,34 +183,15 @@ def get_property_struct_name(property: Optional[dict], block_data_burger: dict,
|
|||
return 'VaultState'
|
||||
if 'harp' in property_variants and 'didgeridoo' in property_variants:
|
||||
return 'Sound'
|
||||
|
||||
if property is None:
|
||||
return ''.join(map(to_camel_case, property_variants))
|
||||
|
||||
if property_variants == ['true', 'false']:
|
||||
# booleans are weird, so just return the string name minecraft uses
|
||||
return to_camel_case(property['name'])
|
||||
|
||||
for class_name in [block_data_burger['class']] + block_data_burger['super']:
|
||||
property_name = mappings.get_field(
|
||||
class_name, property['field_name'])
|
||||
if property_name:
|
||||
break
|
||||
if property_name is None:
|
||||
if 'declared_in' in property:
|
||||
property_name = mappings.get_field(
|
||||
property['declared_in'], property['field_name'])
|
||||
if property_name is None:
|
||||
property_name = property['name']
|
||||
assert property_name
|
||||
property_name = to_camel_case(property_name.lower())
|
||||
if property['type'] == 'int':
|
||||
property_name = to_camel_case(
|
||||
block_data_burger['text_id']) + property_name
|
||||
|
||||
# if property_variants == ['none', 'low', 'tall']:
|
||||
|
||||
if is_list_of_string_integers(property_variants):
|
||||
# if the values are all integers, then prepend the block name
|
||||
return to_camel_case(block_id) + to_camel_case(property_id)
|
||||
if property_variants == ['up', 'side', 'none']:
|
||||
property_name = 'Wire' + to_camel_case(property_name)
|
||||
return 'Wire' + to_camel_case(property_id)
|
||||
if property_variants == ['none', 'low', 'tall']:
|
||||
return 'Wall' + to_camel_case(property_id)
|
||||
|
||||
return property_name
|
||||
return to_camel_case(property_id)
|
||||
|
||||
def is_list_of_string_integers(l: list[str]) -> bool:
|
||||
return all(map(str.isdigit, l))
|
||||
|
|
|
@ -5,11 +5,11 @@ COLLISION_BLOCKS_RS_DIR = get_dir_location(
|
|||
'../azalea-physics/src/collision/blocks.rs')
|
||||
|
||||
|
||||
def generate_block_shapes(blocks_pixlyzer: dict, shapes: dict, aabbs: dict, block_states_report, block_datas_burger, mappings: Mappings):
|
||||
def generate_block_shapes(blocks_pixlyzer: dict, shapes: dict, aabbs: dict, block_states_report, mappings: Mappings):
|
||||
blocks, shapes = simplify_shapes(blocks_pixlyzer, shapes, aabbs)
|
||||
|
||||
code = generate_block_shapes_code(
|
||||
blocks, shapes, block_states_report, block_datas_burger, mappings)
|
||||
blocks, shapes, block_states_report, mappings)
|
||||
with open(COLLISION_BLOCKS_RS_DIR, 'w') as f:
|
||||
f.write(code)
|
||||
|
||||
|
@ -63,7 +63,7 @@ def simplify_shapes(blocks: dict, shapes: dict, aabbs: dict):
|
|||
return new_blocks, new_shapes
|
||||
|
||||
|
||||
def generate_block_shapes_code(blocks: dict, shapes: dict, block_states_report, block_datas_burger, mappings: Mappings):
|
||||
def generate_block_shapes_code(blocks: dict, shapes: dict, block_states_report, mappings: Mappings):
|
||||
# look at __cache__/generator-mod-*/blockCollisionShapes.json for format of blocks and shapes
|
||||
|
||||
generated_shape_code = ''
|
||||
|
|
|
@ -50,17 +50,6 @@ def get_registry_tags(version_id: str, name: str):
|
|||
tags[relative_path[:-5]] = json.load(f)
|
||||
return tags
|
||||
|
||||
|
||||
def get_block_states_burger(version_id: str):
|
||||
burger_data = get_burger_data_for_version(version_id)
|
||||
return burger_data[0]['blocks']['block']
|
||||
|
||||
|
||||
def get_ordered_blocks_burger(version_id: str):
|
||||
burger_data = get_burger_data_for_version(version_id)
|
||||
return burger_data[0]['blocks']['ordered_blocks']
|
||||
|
||||
|
||||
python_command = None
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue