|
| 1 | +use ::java::server::util::direction::Direction |
| 2 | +use ::java::server::util::block_state::BlockState |
| 3 | +use ::java::data::worldgen::biome::Precipitation |
| 4 | +use ::java::data::worldgen::processor_list::BlockMatch |
| 5 | +use ::java::data::worldgen::processor_list::BlockStateMatch |
| 6 | +use ::java::data::worldgen::processor_list::RandomBlockMatch |
| 7 | +use ::java::data::worldgen::processor_list::RandomBlockStateMatch |
| 8 | +use ::java::data::worldgen::processor_list::TagMatch |
| 9 | + |
| 10 | +dispatch minecraft:resource[immersive_weathering:block_growth] to struct BlockGrowth { |
| 11 | + area_condition: AreaCondition, |
| 12 | + position_predicates?: [PositionTest], |
| 13 | + growth_chance: float @ 0..1, |
| 14 | + growth_for_face: [GrowthFace], |
| 15 | + owners: [#[id="block"] string], |
| 16 | + replacing_target: RuleTest, |
| 17 | + target_self?: boolean, |
| 18 | + destroy_target?: boolean, |
| 19 | +} |
| 20 | + |
| 21 | +struct GrowthFace { |
| 22 | + direction?: Direction, |
| 23 | + weight?: int, |
| 24 | + growth: [struct { |
| 25 | + weight: int, |
| 26 | + data: BlockPair, |
| 27 | + }], |
| 28 | +} |
| 29 | + |
| 30 | +struct BlockPair { |
| 31 | + block: BlockState, |
| 32 | + above_block?: BlockState, |
| 33 | +} |
| 34 | + |
| 35 | +struct AreaCondition { |
| 36 | + type: ("generate_if_not_too_many" | "neighbor_based_generation"), |
| 37 | + ...immersive_weathering:area_condition[[type]], |
| 38 | +} |
| 39 | + |
| 40 | +dispatch immersive_weathering:area_condition[generate_if_not_too_many] to struct GenerateIfNotTooMany { |
| 41 | + radiusX: int, |
| 42 | + radiusY: int, |
| 43 | + radiusZ: int, |
| 44 | + requiredAmount: int, |
| 45 | + yOffset?: int, |
| 46 | + must_have?: RuleTest, |
| 47 | + must_not_have?: RuleTest, |
| 48 | + includes?: (#[id(registry="block",tags="allowed")] string | [#[id="block"] string]), |
| 49 | +} |
| 50 | + |
| 51 | +dispatch immersive_weathering:area_condition[neighbor_based_generation] to struct NeighborBasedGeneration { |
| 52 | + must_have: RuleTest, |
| 53 | + must_not_have?: RuleTest, |
| 54 | + required_amount?: int, |
| 55 | + directions: [Direction], |
| 56 | +} |
| 57 | + |
| 58 | +struct PositionTest { |
| 59 | + type: ("biome_match" | "day_test" | "nand" | "precipitation_test" | "temperature_range"), |
| 60 | + ...immersive_weathering:position_test[[type]], |
| 61 | +} |
| 62 | + |
| 63 | +dispatch immersive_weathering:position_test[biome_match] to struct BiomeMatch { |
| 64 | + biomes: (#[id(registry="worldgen/biome",tags="allowed")] string | [#[id="worldgen/biome"] string]), |
| 65 | +} |
| 66 | + |
| 67 | +dispatch immersive_weathering:position_test[day_test] to struct DayTest { |
| 68 | + day: boolean, |
| 69 | +} |
| 70 | + |
| 71 | +dispatch immersive_weathering:position_test[nand] to struct Nand { |
| 72 | + predicates: [PositionTest], |
| 73 | +} |
| 74 | + |
| 75 | +dispatch immersive_weathering:position_test[precipitation_test] to struct PrecipitationTest { |
| 76 | + precipitation: Precipitation, |
| 77 | +} |
| 78 | + |
| 79 | +dispatch immersive_weathering:position_test[temperature_range] to struct TemperatureRange { |
| 80 | + min: float, |
| 81 | + max: float, |
| 82 | + use_local_pos?: boolean, |
| 83 | +} |
| 84 | + |
| 85 | +struct RuleTest { |
| 86 | + predicate_type: #[id] RuleTestType, |
| 87 | + ...immersive_weathering:rule_test[[predicate_type]], |
| 88 | +} |
| 89 | + |
| 90 | +enum(string) RuleTestType { |
| 91 | + #[starred] BlockSetMatch = "immersive_weathering:block_set_match", |
| 92 | + #[starred] FluidMatch = "immersive_weathering:fluid_match", |
| 93 | + #[starred] TreeLog = "immersive_weathering:tree_log", |
| 94 | + BlockMatch = "block_match", |
| 95 | + BlockStateMatch = "blockstate_match", |
| 96 | + RandomBlockMatch = "random_block_match", |
| 97 | + RandomBlockStateMatch = "random_blockstate_match", |
| 98 | + TagMatch = "tag_match", |
| 99 | +} |
| 100 | + |
| 101 | +dispatch immersive_weathering:rule_test[block_match] to BlockMatch |
| 102 | +dispatch immersive_weathering:rule_test[blockstate_match] to BlockStateMatch |
| 103 | +dispatch immersive_weathering:rule_test[random_block_match] to RandomBlockMatch |
| 104 | +dispatch immersive_weathering:rule_test[random_blockstate_match] to RandomBlockStateMatch |
| 105 | +dispatch immersive_weathering:rule_test[tag_match] to TagMatch |
| 106 | + |
| 107 | +dispatch immersive_weathering:rule_test[immersive_weathering:block_set_match] to struct BlockSetMatch { |
| 108 | + blocks: (#[id(registry="block",tags="allowed")] string | [#[id="block"] string]), |
| 109 | + probability?: float @ 0..1, |
| 110 | +} |
| 111 | + |
| 112 | +dispatch immersive_weathering:rule_test[immersive_weathering:fluid_match] to struct FluidMatch { |
| 113 | + fluids: #[id="fluid"] string, |
| 114 | +} |
| 115 | + |
| 116 | +dispatch immersive_weathering:rule_test[immersive_weathering:tree_log] to struct {} |
0 commit comments