From 112a8bb5631c930812e54f01dc90a2cf14aa52a4 Mon Sep 17 00:00:00 2001 From: Apollo <102649729+Apollounknowndev@users.noreply.github.com> Date: Thu, 13 Jun 2024 20:51:43 -0400 Subject: [PATCH] 1.21 pre1-3 (#54) * Add enchantment tags * Fix random group pool alias binding * Add liquid settings * Add looked level based value * Fix predicate with that one really verbose name * Add fixed placement modifier * disc -> disk --- java/1.21/src/schemas/Common.ts | 7 ++++++- java/1.21/src/schemas/Enchantment.ts | 2 +- java/1.21/src/schemas/worldgen/Decorator.ts | 7 +++++++ java/1.21/src/schemas/worldgen/Structure.ts | 6 +++++- java/1.21/src/schemas/worldgen/TemplatePool.ts | 2 ++ 5 files changed, 21 insertions(+), 3 deletions(-) diff --git a/java/1.21/src/schemas/Common.ts b/java/1.21/src/schemas/Common.ts index 36d9773a..7ed25d72 100644 --- a/java/1.21/src/schemas/Common.ts +++ b/java/1.21/src/schemas/Common.ts @@ -453,6 +453,10 @@ export function initCommonSchemas(schemas: SchemaRegistry, collections: Collecti base: NumberNode(), per_level_above_first: NumberNode(), }, + 'minecraft:lookup': { + values: ListNode(NumberNode()), + fallback: Reference('level_based_value') + } })) FloatProvider = (config?: MinMaxConfig) => ObjectWithType( @@ -732,7 +736,8 @@ export function initCommonSchemas(schemas: SchemaRegistry, collections: Collecti }, 'minecraft:random_chance_with_enchanted_bonus': { enchantment: StringNode({ validator: 'resource', params: { pool: 'enchantment' } }), - chance: Reference('level_based_value'), + unenchanted_chance: NumberNode({ min: 0, max: 1}), + enchanted_chance: Reference('level_based_value'), }, 'minecraft:reference': { name: StringNode({ validator: 'resource', params: { pool: '$predicate' } }) diff --git a/java/1.21/src/schemas/Enchantment.ts b/java/1.21/src/schemas/Enchantment.ts index 4d2de02f..378feb0e 100644 --- a/java/1.21/src/schemas/Enchantment.ts +++ b/java/1.21/src/schemas/Enchantment.ts @@ -113,7 +113,7 @@ export function initEnchantmentSchemas(schemas: SchemaRegistry, collections: Col offset: Opt(Reference('block_pos')), trigger_game_event: Opt(StringNode({ validator: 'resource', params: { pool: 'game_event' } })), }, - 'minecraft:replace_disc': { + 'minecraft:replace_disk': { block_state: Reference('block_state_provider'), predicate: Opt(Reference('block_predicate_worldgen')), radius: Reference('level_based_value'), diff --git a/java/1.21/src/schemas/worldgen/Decorator.ts b/java/1.21/src/schemas/worldgen/Decorator.ts index 8078d5b4..9b1ecf66 100644 --- a/java/1.21/src/schemas/worldgen/Decorator.ts +++ b/java/1.21/src/schemas/worldgen/Decorator.ts @@ -8,6 +8,7 @@ import { SchemaRegistry, CollectionRegistry, Opt, + ListNode, } from '@mcschema/core' import { IntProvider } from '../Common' @@ -60,6 +61,12 @@ export function initDecoratorSchemas(schemas: SchemaRegistry, collections: Colle xz_spread: IntProvider({ min: -16, max: 16 }), y_spread: IntProvider({ min: -16, max: 16 }), }, + 'minecraft:fixed_placement': { + positions: ListNode(ListNode( + NumberNode({ integer: true }), + { minLength: 3, maxLength: 3 } + )) + }, 'minecraft:surface_relative_threshold_filter': { heightmap: StringNode({ enum: 'heightmap_type' }), min_inclusive: Opt(NumberNode({ integer: true })), diff --git a/java/1.21/src/schemas/worldgen/Structure.ts b/java/1.21/src/schemas/worldgen/Structure.ts index eb91a4ca..819905da 100644 --- a/java/1.21/src/schemas/worldgen/Structure.ts +++ b/java/1.21/src/schemas/worldgen/Structure.ts @@ -45,6 +45,7 @@ export function initStructureSchemas(schemas: SchemaRegistry, collections: Colle max_distance_from_center: Mod(NumberNode({ integer: true, min: 1, max: 128 }), { default: () => 80 }), use_expansion_hack: BooleanNode(), dimension_padding: Opt(Reference('dimension_padding')), + liquid_settings: StringNode({ enum: ['apply_waterlogging', 'ignore_waterlogging'] }), pool_aliases: Opt(ListNode(Reference('pool_alias_binding'))) }, 'minecraft:mineshaft': { @@ -123,7 +124,10 @@ export function initStructureSchemas(schemas: SchemaRegistry, collections: Colle ) }, 'minecraft:random_group': { - groups: ListNode(Reference('pool_alias_binding')) + groups: ListNode(ObjectNode({ + weight: NumberNode({ integer: true }), + data: Reference('pool_alias_binding'), + })) } } }, { context: 'pool_alias_binding' }), { diff --git a/java/1.21/src/schemas/worldgen/TemplatePool.ts b/java/1.21/src/schemas/worldgen/TemplatePool.ts index 36a57f78..c69b46c9 100644 --- a/java/1.21/src/schemas/worldgen/TemplatePool.ts +++ b/java/1.21/src/schemas/worldgen/TemplatePool.ts @@ -64,6 +64,7 @@ export function initTemplatePoolSchemas(schemas: SchemaRegistry, collections: Co 'minecraft:legacy_single_pool_element': { projection: StringNode({ enum: ['rigid', 'terrain_matching'] }), location: StringNode({ validator: 'resource', params: { pool: '$structure' }}), + override_liquid_settings: StringNode({ enum: ['apply_waterlogging', 'ignore_waterlogging'] }), processors: Processors }, 'minecraft:list_pool_element': { @@ -75,6 +76,7 @@ export function initTemplatePoolSchemas(schemas: SchemaRegistry, collections: Co 'minecraft:single_pool_element': { projection: StringNode({ enum: ['rigid', 'terrain_matching'] }), location: StringNode({ validator: 'resource', params: { pool: '$structure' }}), + override_liquid_settings: StringNode({ enum: ['apply_waterlogging', 'ignore_waterlogging'] }), processors: Processors } }