mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
Merge branch 'main' into autoreconnect
This commit is contained in:
commit
a3897bbde3
12 changed files with 8864 additions and 7813 deletions
|
@ -2030,10 +2030,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(), {
|
||||
pale_oak_wood => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
pale_oak_planks => BlockBehavior::new(), {},
|
||||
pale_oak_planks => BlockBehavior::new().strength(2.0, 3.0), {},
|
||||
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), {},
|
||||
|
@ -2111,7 +2111,7 @@ make_block_states! {
|
|||
dark_oak_log => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
pale_oak_log => BlockBehavior::new(), {
|
||||
pale_oak_log => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
mangrove_log => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
|
@ -2144,7 +2144,7 @@ make_block_states! {
|
|||
stripped_dark_oak_log => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
stripped_pale_oak_log => BlockBehavior::new(), {
|
||||
stripped_pale_oak_log => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
stripped_oak_log => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
|
@ -2201,7 +2201,7 @@ make_block_states! {
|
|||
stripped_dark_oak_wood => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
stripped_pale_oak_wood => BlockBehavior::new(), {
|
||||
stripped_pale_oak_wood => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
"axis": Axis::Y,
|
||||
},
|
||||
stripped_mangrove_wood => BlockBehavior::new().strength(2.0, 2.0), {
|
||||
|
@ -2242,7 +2242,7 @@ make_block_states! {
|
|||
"persistent": Persistent(false),
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_leaves => BlockBehavior::new(), {
|
||||
pale_oak_leaves => BlockBehavior::new().strength(0.2, 0.2), {
|
||||
"distance": PaleOakLeavesDistance::_7,
|
||||
"persistent": Persistent(false),
|
||||
"waterlogged": Waterlogged(false),
|
||||
|
@ -2462,7 +2462,7 @@ make_block_states! {
|
|||
},
|
||||
soul_fire => BlockBehavior::new(), {},
|
||||
spawner => BlockBehavior::new().requires_correct_tool_for_drops().strength(5.0, 5.0), {},
|
||||
creaking_heart => BlockBehavior::new(), {
|
||||
creaking_heart => BlockBehavior::new().strength(10.0, 10.0), {
|
||||
"axis": Axis::Y,
|
||||
"creaking_heart_state": CreakingHeartState::Uprooted,
|
||||
"natural": Natural(false),
|
||||
|
@ -2527,7 +2527,7 @@ make_block_states! {
|
|||
"rotation": DarkOakSignRotation::_0,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_sign => BlockBehavior::new().force_solid(true), {
|
||||
pale_oak_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), {
|
||||
"rotation": PaleOakSignRotation::_0,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
|
@ -2588,7 +2588,7 @@ make_block_states! {
|
|||
"facing": FacingCardinal::North,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_wall_sign => BlockBehavior::new().force_solid(true), {
|
||||
pale_oak_wall_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), {
|
||||
"facing": FacingCardinal::North,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
|
@ -2635,7 +2635,7 @@ make_block_states! {
|
|||
"rotation": DarkOakHangingSignRotation::_0,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_hanging_sign => BlockBehavior::new().force_solid(true), {
|
||||
pale_oak_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), {
|
||||
"attached": Attached(false),
|
||||
"rotation": PaleOakHangingSignRotation::_0,
|
||||
"waterlogged": Waterlogged(false),
|
||||
|
@ -2688,7 +2688,7 @@ make_block_states! {
|
|||
"facing": FacingCardinal::North,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_wall_hanging_sign => BlockBehavior::new().force_solid(true), {
|
||||
pale_oak_wall_hanging_sign => BlockBehavior::new().strength(1.0, 1.0).force_solid(true), {
|
||||
"facing": FacingCardinal::North,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
|
@ -2713,10 +2713,10 @@ make_block_states! {
|
|||
"facing": FacingCardinal::North,
|
||||
"powered": Powered(false),
|
||||
},
|
||||
stone_pressure_plate => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.5, 0.5).force_solid(true), {
|
||||
stone_pressure_plate => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"powered": Powered(false),
|
||||
},
|
||||
iron_door => BlockBehavior::new().requires_correct_tool_for_drops().strength(5.0, 5.0), {
|
||||
iron_door => BlockBehavior::new().strength(5.0, 5.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": Half::Lower,
|
||||
"hinge": Hinge::Left,
|
||||
|
@ -2744,7 +2744,7 @@ make_block_states! {
|
|||
dark_oak_pressure_plate => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"powered": Powered(false),
|
||||
},
|
||||
pale_oak_pressure_plate => BlockBehavior::new().force_solid(true), {
|
||||
pale_oak_pressure_plate => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"powered": Powered(false),
|
||||
},
|
||||
mangrove_pressure_plate => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
|
@ -2891,7 +2891,7 @@ make_block_states! {
|
|||
"powered": Powered(false),
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_trapdoor => BlockBehavior::new(), {
|
||||
pale_oak_trapdoor => BlockBehavior::new().strength(3.0, 3.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": TopBottom::Bottom,
|
||||
"open": Open(false),
|
||||
|
@ -3034,18 +3034,18 @@ make_block_states! {
|
|||
},
|
||||
lily_pad => BlockBehavior::new(), {},
|
||||
resin_block => BlockBehavior::new(), {},
|
||||
resin_bricks => BlockBehavior::new(), {},
|
||||
resin_brick_stairs => BlockBehavior::new(), {
|
||||
resin_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {},
|
||||
resin_brick_stairs => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": TopBottom::Bottom,
|
||||
"shape": StairShape::Straight,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
resin_brick_slab => BlockBehavior::new(), {
|
||||
resin_brick_slab => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"type": Type::Bottom,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
resin_brick_wall => BlockBehavior::new(), {
|
||||
resin_brick_wall => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
"south": WallSouth::None,
|
||||
|
@ -3053,7 +3053,7 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
"west": WallWest::None,
|
||||
},
|
||||
chiseled_resin_bricks => BlockBehavior::new(), {},
|
||||
chiseled_resin_bricks => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 6.0), {},
|
||||
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),
|
||||
|
@ -3072,7 +3072,7 @@ make_block_states! {
|
|||
"age": NetherWartAge::_0,
|
||||
},
|
||||
enchanting_table => BlockBehavior::new().requires_correct_tool_for_drops().strength(5.0, 1200.0), {},
|
||||
brewing_stand => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.5, 0.5), {
|
||||
brewing_stand => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
"has_bottle_0": HasBottle0(false),
|
||||
"has_bottle_1": HasBottle1(false),
|
||||
"has_bottle_2": HasBottle2(false),
|
||||
|
@ -3107,7 +3107,7 @@ make_block_states! {
|
|||
},
|
||||
emerald_ore => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 3.0), {},
|
||||
deepslate_emerald_ore => BlockBehavior::new().requires_correct_tool_for_drops().strength(4.5, 3.0), {},
|
||||
ender_chest => BlockBehavior::new().requires_correct_tool_for_drops().strength(22.5, 600.0), {
|
||||
ender_chest => BlockBehavior::new().strength(22.5, 600.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
|
@ -3235,7 +3235,7 @@ make_block_states! {
|
|||
"facing": FacingCardinal::North,
|
||||
"powered": Powered(false),
|
||||
},
|
||||
pale_oak_button => BlockBehavior::new(), {
|
||||
pale_oak_button => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
"face": Face::Wall,
|
||||
"facing": FacingCardinal::North,
|
||||
"powered": Powered(false),
|
||||
|
@ -3320,10 +3320,10 @@ make_block_states! {
|
|||
"facing": FacingCardinal::North,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
light_weighted_pressure_plate => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.5, 0.5).force_solid(true), {
|
||||
light_weighted_pressure_plate => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"power": LightWeightedPressurePlatePower::_0,
|
||||
},
|
||||
heavy_weighted_pressure_plate => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.5, 0.5).force_solid(true), {
|
||||
heavy_weighted_pressure_plate => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"power": HeavyWeightedPressurePlatePower::_0,
|
||||
},
|
||||
comparator => BlockBehavior::new(), {
|
||||
|
@ -3507,7 +3507,7 @@ make_block_states! {
|
|||
"shape": StairShape::Straight,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_stairs => BlockBehavior::new(), {
|
||||
pale_oak_stairs => BlockBehavior::new().strength(2.0, 3.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": TopBottom::Bottom,
|
||||
"shape": StairShape::Straight,
|
||||
|
@ -3753,7 +3753,7 @@ make_block_states! {
|
|||
"type": Type::Bottom,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_oak_slab => BlockBehavior::new(), {
|
||||
pale_oak_slab => BlockBehavior::new().strength(2.0, 3.0), {
|
||||
"type": Type::Bottom,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
|
@ -3865,7 +3865,7 @@ make_block_states! {
|
|||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
pale_oak_fence_gate => BlockBehavior::new().force_solid(true), {
|
||||
pale_oak_fence_gate => BlockBehavior::new().strength(2.0, 3.0).force_solid(true), {
|
||||
"facing": FacingCardinal::North,
|
||||
"in_wall": InWall(false),
|
||||
"open": Open(false),
|
||||
|
@ -3925,7 +3925,7 @@ make_block_states! {
|
|||
"waterlogged": Waterlogged(false),
|
||||
"west": West(false),
|
||||
},
|
||||
pale_oak_fence => BlockBehavior::new(), {
|
||||
pale_oak_fence => BlockBehavior::new().strength(2.0, 3.0), {
|
||||
"east": East(false),
|
||||
"north": North(false),
|
||||
"south": South(false),
|
||||
|
@ -3988,7 +3988,7 @@ make_block_states! {
|
|||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
pale_oak_door => BlockBehavior::new(), {
|
||||
pale_oak_door => BlockBehavior::new().strength(3.0, 3.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": Half::Lower,
|
||||
"hinge": Hinge::Left,
|
||||
|
@ -4619,16 +4619,16 @@ make_block_states! {
|
|||
stonecutter => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 3.5), {
|
||||
"facing": FacingCardinal::North,
|
||||
},
|
||||
bell => BlockBehavior::new().requires_correct_tool_for_drops().strength(5.0, 5.0).force_solid(true), {
|
||||
bell => BlockBehavior::new().strength(5.0, 5.0).force_solid(true), {
|
||||
"attachment": Attachment::Floor,
|
||||
"facing": FacingCardinal::North,
|
||||
"powered": Powered(false),
|
||||
},
|
||||
lantern => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 3.5).force_solid(true), {
|
||||
lantern => BlockBehavior::new().strength(3.5, 3.5).force_solid(true), {
|
||||
"hanging": Hanging(false),
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
soul_lantern => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.5, 3.5).force_solid(true), {
|
||||
soul_lantern => BlockBehavior::new().strength(3.5, 3.5).force_solid(true), {
|
||||
"hanging": Hanging(false),
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
|
@ -4802,10 +4802,10 @@ make_block_states! {
|
|||
jigsaw => BlockBehavior::new().requires_correct_tool_for_drops().strength(-1.0, 3600000.0), {
|
||||
"orientation": Orientation::NorthUp,
|
||||
},
|
||||
test_block => BlockBehavior::new(), {
|
||||
test_block => BlockBehavior::new().strength(-1.0, 3600000.0), {
|
||||
"mode": TestMode::Start,
|
||||
},
|
||||
test_instance_block => BlockBehavior::new(), {},
|
||||
test_instance_block => BlockBehavior::new().strength(-1.0, 3600000.0), {},
|
||||
composter => BlockBehavior::new().strength(0.6, 0.6), {
|
||||
"level": ComposterLevel::_0,
|
||||
},
|
||||
|
@ -4885,7 +4885,7 @@ make_block_states! {
|
|||
"type": Type::Bottom,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
polished_blackstone_pressure_plate => BlockBehavior::new().requires_correct_tool_for_drops().strength(0.5, 0.5).force_solid(true), {
|
||||
polished_blackstone_pressure_plate => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"powered": Powered(false),
|
||||
},
|
||||
polished_blackstone_button => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
|
@ -4989,55 +4989,55 @@ make_block_states! {
|
|||
"lit": Lit(false),
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
white_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
white_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
orange_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
orange_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
magenta_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
magenta_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
light_blue_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
light_blue_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
yellow_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
yellow_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
lime_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
lime_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
pink_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
pink_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
gray_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
gray_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
light_gray_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
light_gray_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
cyan_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
cyan_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
purple_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
purple_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
blue_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
blue_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
brown_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
brown_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
green_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
green_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
red_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
red_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
black_candle_cake => BlockBehavior::new().strength(0.5, 0.5), {
|
||||
black_candle_cake => BlockBehavior::new().strength(0.5, 0.5).force_solid(true), {
|
||||
"lit": Lit(false),
|
||||
},
|
||||
amethyst_block => BlockBehavior::new().requires_correct_tool_for_drops().strength(1.5, 1.5), {},
|
||||
|
@ -5046,15 +5046,15 @@ make_block_states! {
|
|||
"facing": FacingCubic::Up,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
large_amethyst_bud => BlockBehavior::new().strength(1.5, 1.5), {
|
||||
large_amethyst_bud => BlockBehavior::new().strength(1.5, 1.5).force_solid(true), {
|
||||
"facing": FacingCubic::Up,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
medium_amethyst_bud => BlockBehavior::new().strength(1.5, 1.5), {
|
||||
medium_amethyst_bud => BlockBehavior::new().strength(1.5, 1.5).force_solid(true), {
|
||||
"facing": FacingCubic::Up,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
small_amethyst_bud => BlockBehavior::new().strength(1.5, 1.5), {
|
||||
small_amethyst_bud => BlockBehavior::new().strength(1.5, 1.5).force_solid(true), {
|
||||
"facing": FacingCubic::Up,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
|
@ -5255,56 +5255,56 @@ make_block_states! {
|
|||
"type": Type::Bottom,
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
copper_door => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), {
|
||||
copper_door => BlockBehavior::new().strength(3.0, 6.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": Half::Lower,
|
||||
"hinge": Hinge::Left,
|
||||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
exposed_copper_door => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), {
|
||||
exposed_copper_door => BlockBehavior::new().strength(3.0, 6.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": Half::Lower,
|
||||
"hinge": Hinge::Left,
|
||||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
oxidized_copper_door => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), {
|
||||
oxidized_copper_door => BlockBehavior::new().strength(3.0, 6.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": Half::Lower,
|
||||
"hinge": Hinge::Left,
|
||||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
weathered_copper_door => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), {
|
||||
weathered_copper_door => BlockBehavior::new().strength(3.0, 6.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": Half::Lower,
|
||||
"hinge": Hinge::Left,
|
||||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
waxed_copper_door => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), {
|
||||
waxed_copper_door => BlockBehavior::new().strength(3.0, 6.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": Half::Lower,
|
||||
"hinge": Hinge::Left,
|
||||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
waxed_exposed_copper_door => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), {
|
||||
waxed_exposed_copper_door => BlockBehavior::new().strength(3.0, 6.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": Half::Lower,
|
||||
"hinge": Hinge::Left,
|
||||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
waxed_oxidized_copper_door => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), {
|
||||
waxed_oxidized_copper_door => BlockBehavior::new().strength(3.0, 6.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": Half::Lower,
|
||||
"hinge": Hinge::Left,
|
||||
"open": Open(false),
|
||||
"powered": Powered(false),
|
||||
},
|
||||
waxed_weathered_copper_door => BlockBehavior::new().requires_correct_tool_for_drops().strength(3.0, 6.0), {
|
||||
waxed_weathered_copper_door => BlockBehavior::new().strength(3.0, 6.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"half": Half::Lower,
|
||||
"hinge": Hinge::Left,
|
||||
|
@ -5589,20 +5589,20 @@ make_block_states! {
|
|||
"orientation": Orientation::NorthUp,
|
||||
"triggered": Triggered(false),
|
||||
},
|
||||
trial_spawner => BlockBehavior::new().requires_correct_tool_for_drops().strength(50.0, 50.0), {
|
||||
trial_spawner => BlockBehavior::new().strength(50.0, 50.0), {
|
||||
"ominous": Ominous(false),
|
||||
"trial_spawner_state": TrialSpawnerState::Inactive,
|
||||
},
|
||||
vault => BlockBehavior::new(), {
|
||||
vault => BlockBehavior::new().strength(50.0, 50.0), {
|
||||
"facing": FacingCardinal::North,
|
||||
"ominous": Ominous(false),
|
||||
"vault_state": VaultState::Inactive,
|
||||
},
|
||||
heavy_core => BlockBehavior::new(), {
|
||||
heavy_core => BlockBehavior::new().strength(10.0, 1200.0), {
|
||||
"waterlogged": Waterlogged(false),
|
||||
},
|
||||
pale_moss_block => BlockBehavior::new(), {},
|
||||
pale_moss_carpet => BlockBehavior::new(), {
|
||||
pale_moss_block => BlockBehavior::new().strength(0.1, 0.1), {},
|
||||
pale_moss_carpet => BlockBehavior::new().strength(0.1, 0.1), {
|
||||
"bottom": Bottom(true),
|
||||
"east": WallEast::None,
|
||||
"north": WallNorth::None,
|
||||
|
|
|
@ -30,7 +30,7 @@ use azalea_protocol::{
|
|||
resolver,
|
||||
};
|
||||
use azalea_world::{Instance, InstanceContainer, InstanceName, MinecraftEntityId, PartialInstance};
|
||||
use bevy_app::{App, Plugin, PluginsState, Update};
|
||||
use bevy_app::{App, Plugin, PluginsState, SubApp, Update};
|
||||
use bevy_ecs::{
|
||||
prelude::*,
|
||||
schedule::{InternedScheduleLabel, LogLevel, ScheduleBuildSettings},
|
||||
|
@ -124,7 +124,7 @@ impl StartClientOpts {
|
|||
let mut app = App::new();
|
||||
app.add_plugins(DefaultPlugins);
|
||||
|
||||
let (ecs_lock, start_running_systems) = start_ecs_runner(app);
|
||||
let (ecs_lock, start_running_systems) = start_ecs_runner(app.main_mut());
|
||||
start_running_systems();
|
||||
|
||||
Self {
|
||||
|
@ -660,7 +660,7 @@ impl Plugin for AzaleaPlugin {
|
|||
/// You can create your app with `App::new()`, but don't forget to add
|
||||
/// [`DefaultPlugins`].
|
||||
#[doc(hidden)]
|
||||
pub fn start_ecs_runner(mut app: App) -> (Arc<Mutex<World>>, impl FnOnce()) {
|
||||
pub fn start_ecs_runner(app: &mut SubApp) -> (Arc<Mutex<World>>, impl FnOnce()) {
|
||||
// this block is based on Bevy's default runner:
|
||||
// https://github.com/bevyengine/bevy/blob/390877cdae7a17095a75c8f9f1b4241fe5047e83/crates/bevy_app/src/schedule_runner.rs#L77-L85
|
||||
if app.plugins_state() != PluginsState::Cleaned {
|
||||
|
@ -681,7 +681,7 @@ pub fn start_ecs_runner(mut app: App) -> (Arc<Mutex<World>>, impl FnOnce()) {
|
|||
let ecs = Arc::new(Mutex::new(mem::take(app.world_mut())));
|
||||
|
||||
let ecs_clone = ecs.clone();
|
||||
let outer_schedule_label = *app.main().update_schedule.as_ref().unwrap();
|
||||
let outer_schedule_label = *app.update_schedule.as_ref().unwrap();
|
||||
let start_running_systems = move || {
|
||||
tokio::spawn(run_schedule_loop(ecs_clone, outer_schedule_label));
|
||||
};
|
||||
|
|
File diff suppressed because it is too large
Load diff
|
@ -44,7 +44,8 @@ use protocol::{ServerAddress, resolver::ResolverError};
|
|||
use swarm::SwarmBuilder;
|
||||
use thiserror::Error;
|
||||
|
||||
pub type BoxHandleFn<S, R> = Box<dyn Fn(Client, azalea_client::Event, S) -> BoxFuture<'static, R>>;
|
||||
pub type BoxHandleFn<S, R> =
|
||||
Box<dyn Fn(Client, azalea_client::Event, S) -> BoxFuture<'static, R> + Send>;
|
||||
pub type HandleFn<S, Fut> = fn(Client, azalea_client::Event, S) -> Fut;
|
||||
|
||||
#[derive(Error, Debug)]
|
||||
|
@ -77,6 +78,7 @@ pub struct ClientBuilder<S, R>
|
|||
where
|
||||
S: Default + Send + Sync + Clone + Component + 'static,
|
||||
R: Send + 'static,
|
||||
Self: Send,
|
||||
{
|
||||
/// Internally, ClientBuilder is just a wrapper over SwarmBuilder since it's
|
||||
/// technically just a subset of it so we can avoid duplicating code this
|
||||
|
|
|
@ -9,6 +9,7 @@ pub mod prelude;
|
|||
use std::{
|
||||
collections::{HashMap, hash_map},
|
||||
future::Future,
|
||||
mem,
|
||||
net::SocketAddr,
|
||||
sync::{
|
||||
Arc,
|
||||
|
@ -27,7 +28,7 @@ use azalea_client::{
|
|||
use azalea_entity::LocalEntity;
|
||||
use azalea_protocol::{ServerAddress, resolver};
|
||||
use azalea_world::InstanceContainer;
|
||||
use bevy_app::{App, PluginGroup, PluginGroupBuilder, Plugins};
|
||||
use bevy_app::{App, PluginGroup, PluginGroupBuilder, Plugins, SubApp};
|
||||
use bevy_ecs::prelude::*;
|
||||
use futures::future::{BoxFuture, join_all};
|
||||
use parking_lot::{Mutex, RwLock};
|
||||
|
@ -74,8 +75,10 @@ pub struct SwarmBuilder<S, SS, R, SR>
|
|||
where
|
||||
S: Send + Sync + Clone + Component + 'static,
|
||||
SS: Default + Send + Sync + Clone + Resource + 'static,
|
||||
Self: Send,
|
||||
{
|
||||
pub(crate) app: App,
|
||||
// SubApp is used instead of App to make it Send
|
||||
pub(crate) app: SubApp,
|
||||
/// The accounts and proxies that are going to join the server.
|
||||
pub(crate) accounts: Vec<(Account, JoinOpts)>,
|
||||
/// The individual bot states. This must be the same length as `accounts`,
|
||||
|
@ -139,7 +142,10 @@ impl SwarmBuilder<NoState, NoSwarmState, (), ()> {
|
|||
SwarmBuilder {
|
||||
// we create the app here so plugins can add onto it.
|
||||
// the schedules won't run until [`Self::start`] is called.
|
||||
app: App::new(),
|
||||
|
||||
// `App::new()` is used instead of `SubApp::new()` so the necessary resources are
|
||||
// initialized
|
||||
app: mem::take(App::new().main_mut()),
|
||||
accounts: Vec::new(),
|
||||
states: Vec::new(),
|
||||
swarm_state: NoSwarmState,
|
||||
|
@ -401,7 +407,7 @@ where
|
|||
/// Do the same as [`Self::start`], but allow passing in default join
|
||||
/// options for the bots.
|
||||
pub async fn start_with_default_opts(
|
||||
self,
|
||||
mut self,
|
||||
address: impl TryInto<ServerAddress>,
|
||||
default_join_opts: JoinOpts,
|
||||
) -> Result<!, StartError> {
|
||||
|
@ -434,9 +440,9 @@ where
|
|||
|
||||
swarm_tx.send(SwarmEvent::Init).unwrap();
|
||||
|
||||
let main_schedule_label = self.app.main().update_schedule.unwrap();
|
||||
let main_schedule_label = self.app.update_schedule.unwrap();
|
||||
|
||||
let (ecs_lock, start_running_systems) = start_ecs_runner(self.app);
|
||||
let (ecs_lock, start_running_systems) = start_ecs_runner(&mut self.app);
|
||||
|
||||
let swarm = Swarm {
|
||||
ecs_lock: ecs_lock.clone(),
|
||||
|
@ -605,7 +611,7 @@ pub enum SwarmEvent {
|
|||
|
||||
pub type SwarmHandleFn<SS, Fut> = fn(Swarm, SwarmEvent, SS) -> Fut;
|
||||
pub type BoxSwarmHandleFn<SS, R> =
|
||||
Box<dyn Fn(Swarm, SwarmEvent, SS) -> BoxFuture<'static, R> + Send>;
|
||||
Box<dyn Fn(Swarm, SwarmEvent, SS) -> BoxFuture<'static, R> + Send + Sync>;
|
||||
|
||||
/// Make a bot [`Swarm`].
|
||||
///
|
||||
|
|
|
@ -42,6 +42,6 @@ At the time of writing, the following data generators are used:
|
|||
|
||||
- [Vanilla data generator](https://minecraft.wiki/w/Minecraft_Wiki:Projects/wiki.vg_merge/Data_Generators)
|
||||
- [Burger](https://github.com/mat-1/Burger)
|
||||
- [PixLyzer](https://gitlab.bixilon.de/bixilon/pixlyzer)
|
||||
- [Pumpkin Extractor](https://github.com/Pumpkin-MC/Extractor)
|
||||
|
||||
Some things can be obtained from multiple generators. You should prefer them by the order above (the vanilla generator is the most reliable).
|
||||
|
|
|
@ -8,22 +8,15 @@ import lib.extract
|
|||
import lib.utils
|
||||
|
||||
def generate(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')
|
||||
pumpkin_block_datas = lib.extract.get_pumpkin_data(version_id, 'blocks')
|
||||
burger_data = lib.extract.get_burger_data_for_version(version_id)
|
||||
|
||||
block_states_report = lib.extract.get_block_states_report(version_id)
|
||||
registries = lib.extract.get_registries_report(version_id)
|
||||
ordered_blocks = lib.code.blocks.get_ordered_blocks(registries)
|
||||
|
||||
lib.code.blocks.generate_blocks(
|
||||
block_states_report, pixlyzer_block_datas, ordered_blocks, burger_data)
|
||||
|
||||
lib.code.shapes.generate_block_shapes(
|
||||
pixlyzer_block_datas, shape_datas['shapes'], shape_datas['aabbs'], block_states_report)
|
||||
lib.code.blocks.generate_blocks(block_states_report, pumpkin_block_datas, ordered_blocks, burger_data)
|
||||
lib.code.shapes.generate_block_shapes(pumpkin_block_datas, block_states_report)
|
||||
|
||||
lib.code.utils.fmt()
|
||||
|
||||
|
|
|
@ -12,7 +12,7 @@ BLOCKS_RS_DIR = get_dir_location('../azalea-block/src/generated.rs')
|
|||
# - Block: Has properties and states.
|
||||
|
||||
|
||||
def generate_blocks(blocks_report: dict, pixlyzer_block_datas: dict, ordered_blocks: list[str], burger_data: dict):
|
||||
def generate_blocks(blocks_report: dict, pumpkin_block_datas: dict, ordered_blocks: list[str], burger_data: dict):
|
||||
with open(BLOCKS_RS_DIR, 'r') as f:
|
||||
existing_code = f.read().splitlines()
|
||||
|
||||
|
@ -21,6 +21,11 @@ def generate_blocks(blocks_report: dict, pixlyzer_block_datas: dict, ordered_blo
|
|||
|
||||
burger_block_datas = burger_data[0]['blocks']['block']
|
||||
|
||||
pumpkin_block_map = {}
|
||||
for block_data in pumpkin_block_datas['blocks']:
|
||||
block_id = block_data['name']
|
||||
pumpkin_block_map[block_id] = block_data
|
||||
|
||||
# Find properties
|
||||
properties = {}
|
||||
|
||||
|
@ -77,8 +82,8 @@ def generate_blocks(blocks_report: dict, pixlyzer_block_datas: dict, ordered_blo
|
|||
new_make_block_states_macro_code.append(' Blocks => {')
|
||||
for block_id in ordered_blocks:
|
||||
block_data_report = blocks_report['minecraft:' + block_id]
|
||||
block_data_pixlyzer = pixlyzer_block_datas.get(f'minecraft:{block_id}', {})
|
||||
block_data_burger = burger_block_datas.get(block_id, {})
|
||||
block_data_pumpkin = pumpkin_block_map[block_id]
|
||||
|
||||
default_property_variants: dict[str, str] = {}
|
||||
for state in block_data_report['states']:
|
||||
|
@ -116,11 +121,11 @@ def generate_blocks(blocks_report: dict, pixlyzer_block_datas: dict, ordered_blo
|
|||
# make the block behavior
|
||||
behavior_constructor = 'BlockBehavior::new()'
|
||||
# requires tool
|
||||
if block_data_pixlyzer.get('requires_tool'):
|
||||
if block_data_burger.get('requires_correct_tool_for_drops'):
|
||||
behavior_constructor += '.requires_correct_tool_for_drops()'
|
||||
# strength
|
||||
destroy_time = block_data_pixlyzer.get('hardness')
|
||||
explosion_resistance = block_data_pixlyzer.get('explosion_resistance')
|
||||
destroy_time = block_data_pumpkin.get('hardness')
|
||||
explosion_resistance = block_data_pumpkin.get('blast_resistance')
|
||||
if destroy_time and explosion_resistance:
|
||||
behavior_constructor += f'.strength({destroy_time}, {explosion_resistance})'
|
||||
elif destroy_time:
|
||||
|
@ -128,7 +133,7 @@ def generate_blocks(blocks_report: dict, pixlyzer_block_datas: dict, ordered_blo
|
|||
elif explosion_resistance:
|
||||
behavior_constructor += f'.explosion_resistance({explosion_resistance})'
|
||||
# friction
|
||||
friction = block_data_pixlyzer.get('friction')
|
||||
friction = block_data_burger.get('friction')
|
||||
if friction != None:
|
||||
behavior_constructor += f'.friction({friction})'
|
||||
|
||||
|
|
|
@ -5,64 +5,69 @@ 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):
|
||||
blocks, shapes = simplify_shapes(blocks_pixlyzer, shapes, aabbs)
|
||||
def generate_block_shapes(pumpkin_block_datas: dict, block_states_report):
|
||||
blocks, shapes = simplify_shapes(pumpkin_block_datas)
|
||||
|
||||
code = generate_block_shapes_code(blocks, shapes, block_states_report)
|
||||
with open(COLLISION_BLOCKS_RS_DIR, 'w') as f:
|
||||
f.write(code)
|
||||
|
||||
|
||||
def simplify_shapes(blocks: dict, shapes: dict, aabbs: dict):
|
||||
new_id_increment = 0
|
||||
|
||||
new_shapes = {}
|
||||
old_id_to_new_id = {}
|
||||
|
||||
old_id_to_new_id[None] = 0
|
||||
new_shapes[0] = ()
|
||||
new_id_increment += 1
|
||||
|
||||
used_shape_ids = set()
|
||||
# determine the used shape ids
|
||||
for _block_id, block_data in blocks.items():
|
||||
block_shapes = {state.get('collision_shape') for state in block_data['states'].values()}
|
||||
block_shapes.update({state.get('outline_shape') for state in block_data['states'].values()})
|
||||
for s in block_shapes:
|
||||
used_shape_ids.add(s)
|
||||
|
||||
for shape_id, shape in enumerate(shapes):
|
||||
if shape_id not in used_shape_ids: continue
|
||||
# pixlyzer gives us shapes as an index or list of indexes into the
|
||||
# aabbs list
|
||||
# and aabbs look like { "from": number or [x, y, z], "to": (number or vec3) }
|
||||
# convert them to [x1, y1, z1, x2, y2, z2]
|
||||
shape = [shape] if isinstance(shape, int) else shape
|
||||
shape = [aabbs[shape_aabb] for shape_aabb in shape]
|
||||
shape = tuple([(
|
||||
(tuple(part['from']) if isinstance(
|
||||
part['from'], list) else ((part['from'],)*3))
|
||||
+ (tuple(part['to']) if isinstance(part['to'], list)
|
||||
else ((part['to'],)*3))
|
||||
) for part in shape])
|
||||
|
||||
old_id_to_new_id[shape_id] = new_id_increment
|
||||
new_shapes[new_id_increment] = shape
|
||||
new_id_increment += 1
|
||||
|
||||
# now map the blocks to the new shape ids
|
||||
def simplify_shapes(blocks: dict) -> tuple[dict, dict]:
|
||||
'''
|
||||
Returns new_blocks and new_shapes,
|
||||
where new_blocks is like { grass_block: { collision: [1, 1], outline: [1, 1] } }
|
||||
and new_shapes is like { 1: [ [0, 0, 0, 1, 1, 1] ] }
|
||||
'''
|
||||
new_blocks = {}
|
||||
for block_id, block_data in blocks.items():
|
||||
block_id = block_id.split(':')[-1]
|
||||
new_shapes = {}
|
||||
|
||||
block_collision_shapes = [state.get('collision_shape') for state in block_data['states'].values()]
|
||||
block_outline_shapes = [state.get('outline_shape') for state in block_data['states'].values()]
|
||||
all_shapes_ids = {}
|
||||
|
||||
for block_data in blocks['blocks']:
|
||||
new_block_collision_shapes = []
|
||||
new_block_outline_shapes = []
|
||||
|
||||
for state in block_data['states']:
|
||||
collision_shape = []
|
||||
for box_id in state['collision_shapes']:
|
||||
box = blocks['shapes'][box_id]
|
||||
collision_shape.append(
|
||||
tuple(box['min'] + box['max'])
|
||||
)
|
||||
outline_shape = []
|
||||
for box_id in state['outline_shapes']:
|
||||
box = blocks['shapes'][box_id]
|
||||
outline_shape.append(
|
||||
tuple(box['min'] + box['max'])
|
||||
)
|
||||
|
||||
collision_shape = tuple(collision_shape)
|
||||
outline_shape = tuple(outline_shape)
|
||||
|
||||
if collision_shape in all_shapes_ids:
|
||||
collision_shape_id = all_shapes_ids[collision_shape]
|
||||
else:
|
||||
collision_shape_id = len(all_shapes_ids)
|
||||
all_shapes_ids[collision_shape] = collision_shape_id
|
||||
new_shapes[collision_shape_id] = collision_shape
|
||||
if outline_shape in all_shapes_ids:
|
||||
outline_shape_id = all_shapes_ids[outline_shape]
|
||||
else:
|
||||
outline_shape_id = len(all_shapes_ids)
|
||||
all_shapes_ids[outline_shape] = outline_shape_id
|
||||
new_shapes[outline_shape_id] = outline_shape
|
||||
|
||||
block_id = block_data['name']
|
||||
new_block_collision_shapes.append(collision_shape_id)
|
||||
new_block_outline_shapes.append(outline_shape_id)
|
||||
|
||||
new_blocks[block_id] = {
|
||||
'collision': [old_id_to_new_id[shape_id] for shape_id in block_collision_shapes],
|
||||
'outline': [old_id_to_new_id[shape_id] for shape_id in block_outline_shapes]
|
||||
'collision': new_block_collision_shapes,
|
||||
'outline': new_block_outline_shapes
|
||||
}
|
||||
|
||||
|
||||
return new_blocks, new_shapes
|
||||
|
||||
|
||||
|
|
|
@ -22,12 +22,41 @@ def get_burger():
|
|||
os.system(f'cd {get_dir_location("__cache__")}/Burger && python -m venv venv && venv/bin/pip install six jawa')
|
||||
|
||||
|
||||
def get_pixlyzer():
|
||||
if not os.path.exists(get_dir_location('__cache__/pixlyzer')):
|
||||
print('\033[92mDownloading bixilon/pixlyzer...\033[m')
|
||||
def get_pumpkin_extractor():
|
||||
if not os.path.exists(get_dir_location('__cache__/pumpkin-extractor')):
|
||||
print('\033[92mDownloading Pumpkin-MC/Extractor...\033[m')
|
||||
os.system(
|
||||
f'cd {get_dir_location("__cache__")} && git clone https://gitlab.bixilon.de/bixilon/pixlyzer.git && cd pixlyzer && git pull')
|
||||
return get_dir_location('__cache__/pixlyzer')
|
||||
f'cd {get_dir_location("__cache__")} && git clone https://github.com/Pumpkin-MC/Extractor pumpkin-extractor && cd pumpkin-extractor && git pull')
|
||||
|
||||
GIT_PATCH = '''diff --git a/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt b/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt
|
||||
index 936cd7b..9876a4b 100644
|
||||
--- a/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt
|
||||
+++ b/src/main/kotlin/de/snowii/extractor/extractors/Blocks.kt
|
||||
@@ -106,12 +106,18 @@ class Blocks : Extractor.Extractor {
|
||||
}
|
||||
|
||||
val collisionShapeIdxsJson = JsonArray()
|
||||
+ val outlineShapeIdxsJson = JsonArray()
|
||||
for (box in state.getCollisionShape(EmptyBlockView.INSTANCE, BlockPos.ORIGIN).boundingBoxes) {
|
||||
val idx = shapes.putIfAbsent(box, shapes.size)
|
||||
collisionShapeIdxsJson.add(Objects.requireNonNullElseGet(idx) { shapes.size - 1 })
|
||||
}
|
||||
+ for (box in state.getOutlineShape(EmptyBlockView.INSTANCE, BlockPos.ORIGIN).boundingBoxes) {
|
||||
+ val idx = shapes.putIfAbsent(box, shapes.size)
|
||||
+ outlineShapeIdxsJson.add(Objects.requireNonNullElseGet(idx) { shapes.size - 1 })
|
||||
+ }
|
||||
|
||||
stateJson.add("collision_shapes", collisionShapeIdxsJson)
|
||||
+ stateJson.add("outline_shapes", outlineShapeIdxsJson)
|
||||
|
||||
for (blockEntity in Registries.BLOCK_ENTITY_TYPE) {
|
||||
if (blockEntity.supports(state)) {
|
||||
'''
|
||||
os.system(
|
||||
f'cd {get_dir_location("__cache__")}/pumpkin-extractor && git apply - <<EOF\n{GIT_PATCH}\nEOF'
|
||||
)
|
||||
|
||||
return get_dir_location('__cache__/pumpkin-extractor')
|
||||
|
||||
|
||||
def get_version_manifest():
|
||||
|
@ -181,7 +210,7 @@ def clear_version_cache():
|
|||
if os.path.exists(burger_path):
|
||||
os.system(
|
||||
f'cd {burger_path} && git pull')
|
||||
pixlyzer_path = get_dir_location('__cache__/pixlyzer')
|
||||
if os.path.exists(pixlyzer_path):
|
||||
pumpkin_path = get_dir_location('__cache__/pumpkin-extractor')
|
||||
if os.path.exists(pumpkin_path):
|
||||
os.system(
|
||||
f'cd {pixlyzer_path} && git pull')
|
||||
f'cd {pumpkin_path} && git add . && git stash && git pull && git stash pop')
|
|
@ -1,7 +1,7 @@
|
|||
# Extracting data from the Minecraft jars
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
from lib.download import get_mappings_for_version, get_server_jar, get_burger, get_client_jar, get_pixlyzer, get_yarn_data, get_fabric_api_versions, get_fabric_loader_versions
|
||||
from lib.download import get_mappings_for_version, get_pumpkin_extractor, get_server_jar, get_burger, get_client_jar
|
||||
from lib.utils import get_dir_location, to_camel_case, upper_first_letter
|
||||
from zipfile import ZipFile
|
||||
import subprocess
|
||||
|
@ -106,145 +106,50 @@ def get_burger_data_for_version(version_id: str):
|
|||
return json.load(f)
|
||||
|
||||
|
||||
def get_pixlyzer_data(version_id: str, category: str):
|
||||
'''
|
||||
Gets data from Pixlyzer. Note that this requires Yarn to release updates first.
|
||||
'''
|
||||
def get_pumpkin_data(version_id: str, category: str):
|
||||
assert '/' not in version_id
|
||||
assert '\\' not in version_id
|
||||
target_parent_dir = get_dir_location(f'__cache__/pumpkin-{version_id}')
|
||||
category_dir = f'{target_parent_dir}/{category}.json'
|
||||
|
||||
target_dir = get_dir_location(f'__cache__/pixlyzer-{version_id}')
|
||||
if os.path.exists(category_dir):
|
||||
with open(category_dir, 'r') as f:
|
||||
return json.load(f)
|
||||
|
||||
# TODO: right now this False is hard-coded, it should retry with this
|
||||
# enabled if # initially getting the data fails
|
||||
if True or (os.path.exists(target_dir) and not os.path.exists(f'{target_dir}/{category}.min.json')):
|
||||
print('Downloading', category, 'from pixlyzer-data.')
|
||||
data = requests.get(f'https://gitlab.com/Bixilon/pixlyzer-data/-/raw/master/version/{version_id}/{category}.min.json?inline=false').text
|
||||
try:
|
||||
os.mkdir(target_dir)
|
||||
except:
|
||||
pass
|
||||
with open(f'{target_dir}/{category}.min.json', 'w') as f:
|
||||
f.write(data)
|
||||
return json.loads(data)
|
||||
pumpkin_dir = get_pumpkin_extractor()
|
||||
os.makedirs(f'{pumpkin_dir}/run', exist_ok=True)
|
||||
with open(f'{pumpkin_dir}/run/eula.txt', 'w') as f:
|
||||
f.write('eula=true')
|
||||
|
||||
if not os.path.exists(target_dir):
|
||||
pixlyzer_dir = get_pixlyzer()
|
||||
# run ./gradlew runServer until it logs "(pumpkin_extractor) Done"
|
||||
p = subprocess.Popen(
|
||||
f'cd {pumpkin_dir} && ./gradlew runServer',
|
||||
stderr=subprocess.PIPE,
|
||||
stdout=subprocess.PIPE,
|
||||
shell=True
|
||||
)
|
||||
|
||||
# for some reason pixlyzer doesn't work right unless the mvn clean
|
||||
# instruction looks like that
|
||||
# and pixlyzer.py doesn't do it right
|
||||
while True:
|
||||
data = p.stdout.readline().decode()
|
||||
print('>' + data, end='', flush=True)
|
||||
if '[Server thread/INFO] (pumpkin_extractor) Done' in data:
|
||||
print('Pumpkin extractor done')
|
||||
break
|
||||
if data == b'':
|
||||
break
|
||||
|
||||
# map jar + download dependencies
|
||||
run_python_command_and_download_deps(
|
||||
f'cd {pixlyzer_dir}/wrapper && {determine_python_command()} PixLyzer.py --only-version={version_id} --dont-compile --only-map'
|
||||
)
|
||||
# update the pom.xml <dependencies>
|
||||
# list directories in pixlyzer/wrapper/data/data/dependencies/libraries
|
||||
pom_xml_dependencies = '''<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-test-junit</artifactId>
|
||||
<version>1.7.21</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jetbrains.kotlin</groupId>
|
||||
<artifactId>kotlin-stdlib-jdk8</artifactId>
|
||||
<version>1.7.21</version>
|
||||
</dependency>
|
||||
p.terminate()
|
||||
|
||||
<dependency>
|
||||
<groupId>net.minecraft</groupId>
|
||||
<artifactId>client</artifactId>
|
||||
<version>${minecraft.version}</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>${project.basedir}/wrapper/data/data/${minecraft.version}_yarn/${minecraft.version}-exhibitionism.jar</systemPath>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.bixilon</groupId>
|
||||
<artifactId>mbf-kotlin</artifactId>
|
||||
<version>0.2.1</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.objenesis</groupId>
|
||||
<artifactId>objenesis</artifactId>
|
||||
<version>3.3</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-lang3</artifactId>
|
||||
<version>3.12.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.14.0</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>de.bixilon</groupId>
|
||||
<artifactId>kutil</artifactId>
|
||||
<version>1.17.1</version>
|
||||
</dependency>'''
|
||||
# walk dir f'{pixlyzer_dir}/wrapper/data/data/dependencies/libraries'
|
||||
for root, dirs, files in os.walk(f'{pixlyzer_dir}/wrapper/data/data/dependencies/libraries'):
|
||||
for file in files:
|
||||
full_path = os.path.join(
|
||||
root.replace('\\', '/').replace(
|
||||
f'{pixlyzer_dir}/wrapper/data/data/dependencies/libraries/'.replace('\\', '/'), ''),
|
||||
file
|
||||
).replace('\\', '/')
|
||||
print(full_path)
|
||||
if not full_path.endswith('.jar'):
|
||||
continue
|
||||
split_path = full_path.split('/')
|
||||
group = ''
|
||||
for group_index in range(0, len(split_path) - 3):
|
||||
group += split_path[group_index] + '.'
|
||||
if group.endswith('.'):
|
||||
group = group[:-1]
|
||||
artifact = split_path[-3]
|
||||
version = split_path[-2]
|
||||
path = '${project.basedir}/wrapper/data/data/dependencies/libraries/' + full_path
|
||||
pom_xml_dependencies += """
|
||||
<dependency>
|
||||
<groupId>""" + group + """</groupId>
|
||||
<artifactId>""" + artifact + """</artifactId>
|
||||
<version>""" + version + """</version>
|
||||
<scope>system</scope>
|
||||
<systemPath>""" + path + """</systemPath>
|
||||
</dependency>
|
||||
"""
|
||||
print('pom_xml_dependencies', pom_xml_dependencies)
|
||||
assert pom_xml_dependencies != ''
|
||||
pom_xml = open(f'{pixlyzer_dir}/pom.xml', 'r').read()
|
||||
pom_xml = re.sub(
|
||||
r'<dependencies>.*?</dependencies>', f'<dependencies>{pom_xml_dependencies}</dependencies>', pom_xml, flags=re.DOTALL)
|
||||
pom_xml = re.sub(
|
||||
r'<minecraft\.version>.*?</minecraft\.version>', f'<minecraft.version>{version_id}</minecraft.version>', pom_xml, flags=re.DOTALL)
|
||||
open(f'{pixlyzer_dir}/pom.xml', 'w').write(pom_xml)
|
||||
# move the run/pumpkin_extractor_output directory to target_parent_dir
|
||||
# delete target_parent_dir if it's empty
|
||||
if os.path.exists(target_parent_dir):
|
||||
os.rmdir(target_parent_dir)
|
||||
os.rename(f'{pumpkin_dir}/run/pumpkin_extractor_output', target_parent_dir)
|
||||
|
||||
# compile
|
||||
os.system(
|
||||
f'cd {pixlyzer_dir} && mvn clean -Dmaven.repo.local=. verify')
|
||||
# run pixlyzer.py again lol
|
||||
run_python_command_and_download_deps(
|
||||
f'cd {pixlyzer_dir}/wrapper && {determine_python_command()} PixLyzer.py --only-version={version_id} --no-compile'
|
||||
)
|
||||
|
||||
source_dir = get_dir_location(
|
||||
f'{pixlyzer_dir}/wrapper/data/version/{version_id}')
|
||||
|
||||
if not os.path.exists(source_dir):
|
||||
print('PixLyzer failed, no output!')
|
||||
exit()
|
||||
if os.path.exists(target_dir):
|
||||
os.unlink(target_dir)
|
||||
os.rename(
|
||||
source_dir,
|
||||
target_dir
|
||||
)
|
||||
|
||||
with open(f'{target_dir}/{category}.min.json', 'r') as f:
|
||||
with open(category_dir, 'r') as f:
|
||||
return json.load(f)
|
||||
|
||||
|
||||
def get_file_from_jar(version_id: str, file_dir: str):
|
||||
get_client_jar(version_id)
|
||||
with ZipFile(get_dir_location(f'__cache__/client-{version_id}.jar')) as z:
|
||||
|
|
|
@ -40,18 +40,14 @@ lib.code.version.set_version_name(new_version_id)
|
|||
print('Updated protocol!')
|
||||
|
||||
print('Generating blocks and shapes...')
|
||||
# TODO: pixlyzer is broken so we use old data
|
||||
new_shape_datas = lib.extract.get_pixlyzer_data(
|
||||
'1.20.3-pre4', 'shapes')
|
||||
new_pixlyzer_block_datas = lib.extract.get_pixlyzer_data(
|
||||
'1.20.3-pre4', 'blocks')
|
||||
new_pumpkin_block_datas = lib.extract.get_pumpkin_data(new_version_id, 'blocks')
|
||||
|
||||
new_block_states_report = lib.extract.get_block_states_report(new_version_id)
|
||||
new_registries = lib.extract.get_registries_report(new_version_id)
|
||||
new_ordered_blocks = lib.code.blocks.get_ordered_blocks(new_registries)
|
||||
lib.code.blocks.generate_blocks(
|
||||
new_block_states_report, new_pixlyzer_block_datas, new_ordered_blocks, new_burger_data)
|
||||
lib.code.shapes.generate_block_shapes(
|
||||
new_pixlyzer_block_datas, new_shape_datas['shapes'], new_shape_datas['aabbs'], new_block_states_report)
|
||||
|
||||
lib.code.blocks.generate_blocks(new_block_states_report, new_pumpkin_block_datas, new_ordered_blocks, new_burger_data)
|
||||
lib.code.shapes.generate_block_shapes(new_pumpkin_block_datas, new_block_states_report)
|
||||
|
||||
print('Getting en_us.json...')
|
||||
language = lib.extract.get_en_us_lang(new_version_id)
|
||||
|
|
Loading…
Add table
Reference in a new issue