mirror of
https://github.com/Pumpkin-MC/Pumpkin.git
synced 2026-08-31 08:22:33 +00:00
fix: end portal crash and island setup (#1945)
* fix: use noise_sampler * fix: end portal teleportation and generation * feature: dragon fight start (improved main end island)
This commit is contained in:
@@ -1233,7 +1233,21 @@ fn value_to_placement_modifier_cf(v: &Value) -> TokenStream {
|
||||
match type_str {
|
||||
"minecraft:biome" => quote! { PlacementModifier::Biome(BiomePlacementModifier) },
|
||||
"minecraft:in_square" => quote! { PlacementModifier::InSquare(SquarePlacementModifier) },
|
||||
"minecraft:fixed_placement" => quote! { PlacementModifier::FixedPlacement },
|
||||
"minecraft:fixed_placement" => {
|
||||
let positions = v["positions"]
|
||||
.as_array()
|
||||
.map(|arr| {
|
||||
arr.iter().map(|p| {
|
||||
let coords = p.as_array().unwrap();
|
||||
let x = coords[0].as_i64().unwrap_or(0) as i32;
|
||||
let y = coords[1].as_i64().unwrap_or(0) as i32;
|
||||
let z = coords[2].as_i64().unwrap_or(0) as i32;
|
||||
quote! { BlockPos::new(#x, #y, #z) }
|
||||
}).collect::<Vec<_>>()
|
||||
})
|
||||
.unwrap_or_default();
|
||||
quote! { PlacementModifier::FixedPlacement(vec![#(#positions),*]) }
|
||||
},
|
||||
"minecraft:heightmap" => {
|
||||
let hm = crate::placed_feature::value_to_height_map(
|
||||
v["heightmap"].as_str().unwrap_or("MOTION_BLOCKING"),
|
||||
|
||||
@@ -108,7 +108,21 @@ fn value_to_placement_modifier(v: &Value) -> TokenStream {
|
||||
match type_str {
|
||||
"minecraft:biome" => quote! { PlacementModifier::Biome(BiomePlacementModifier) },
|
||||
"minecraft:in_square" => quote! { PlacementModifier::InSquare(SquarePlacementModifier) },
|
||||
"minecraft:fixed_placement" => quote! { PlacementModifier::FixedPlacement },
|
||||
"minecraft:fixed_placement" => {
|
||||
let positions = v["positions"]
|
||||
.as_array()
|
||||
.map(|arr| {
|
||||
arr.iter().map(|p| {
|
||||
let coords = p.as_array().unwrap();
|
||||
let x = coords[0].as_i64().unwrap_or(0) as i32;
|
||||
let y = coords[1].as_i64().unwrap_or(0) as i32;
|
||||
let z = coords[2].as_i64().unwrap_or(0) as i32;
|
||||
quote! { BlockPos::new(#x, #y, #z) }
|
||||
}).collect::<Vec<_>>()
|
||||
})
|
||||
.unwrap_or_default();
|
||||
quote! { PlacementModifier::FixedPlacement(vec![#(#positions),*]) }
|
||||
},
|
||||
"minecraft:heightmap" => {
|
||||
let heightmap =
|
||||
value_to_height_map(v["heightmap"].as_str().unwrap_or("MOTION_BLOCKING"));
|
||||
|
||||
Reference in New Issue
Block a user