Skip to content

Commit

Permalink
1.21 pre1-3 (#54)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Apollounknowndev committed Jun 14, 2024
1 parent db1cfcb commit 112a8bb
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 3 deletions.
7 changes: 6 additions & 1 deletion java/1.21/src/schemas/Common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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' } })
Expand Down
2 changes: 1 addition & 1 deletion java/1.21/src/schemas/Enchantment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
Expand Down
7 changes: 7 additions & 0 deletions java/1.21/src/schemas/worldgen/Decorator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
SchemaRegistry,
CollectionRegistry,
Opt,
ListNode,
} from '@mcschema/core'
import { IntProvider } from '../Common'

Expand Down Expand Up @@ -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 })),
Expand Down
6 changes: 5 additions & 1 deletion java/1.21/src/schemas/worldgen/Structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand Down Expand Up @@ -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' }), {
Expand Down
2 changes: 2 additions & 0 deletions java/1.21/src/schemas/worldgen/TemplatePool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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': {
Expand All @@ -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
}
}
Expand Down

0 comments on commit 112a8bb

Please sign in to comment.