Skip to content

Commit

Permalink
Handful of fixes (#57)
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

* Fix liquid settings being required

* Fix random_group pool alias binding

* Fix random_spread in 1.20.3

* Fix inlined exclusion zones

* Remove StructureSet field
  • Loading branch information
Apollounknowndev committed Sep 4, 2024
1 parent 6208bfa commit adb33d1
Show file tree
Hide file tree
Showing 12 changed files with 22 additions and 102 deletions.
13 changes: 1 addition & 12 deletions java/1.19.3/src/schemas/worldgen/StructureSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
const StringNode = RawStringNode.bind(undefined, collections)
const Reference = RawReference.bind(undefined, schemas)

const StructureSet = ChoiceNode([
{
type: 'string',
node: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } })
},
{
type: 'object',
node: Reference('structure_set')
}
], { choiceContext: 'structure_set' })

schemas.register('structure_set', ObjectNode({
structures: ListNode(
ObjectNode({
Expand All @@ -49,7 +38,7 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
frequency_reduction_method: Opt(StringNode({ enum: ['default', 'legacy_type_1', 'legacy_type_2', 'legacy_type_3'] })),
frequency: Opt(NumberNode({ min: 0, max: 1 })),
exclusion_zone: Opt(ObjectNode({
other_set: StructureSet,
other_set: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } }),
chunk_count: NumberNode({ integer: true, min: 1, max: 16 })
})),
locate_offset: Opt(ListNode(
Expand Down
13 changes: 1 addition & 12 deletions java/1.19.4/src/schemas/worldgen/StructureSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
const StringNode = RawStringNode.bind(undefined, collections)
const Reference = RawReference.bind(undefined, schemas)

const StructureSet = ChoiceNode([
{
type: 'string',
node: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } })
},
{
type: 'object',
node: Reference('structure_set')
}
], { choiceContext: 'structure_set' })

schemas.register('structure_set', ObjectNode({
structures: ListNode(
ObjectNode({
Expand All @@ -49,7 +38,7 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
frequency_reduction_method: Opt(StringNode({ enum: ['default', 'legacy_type_1', 'legacy_type_2', 'legacy_type_3'] })),
frequency: Opt(NumberNode({ min: 0, max: 1 })),
exclusion_zone: Opt(ObjectNode({
other_set: StructureSet,
other_set: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } }),
chunk_count: NumberNode({ integer: true, min: 1, max: 16 })
})),
locate_offset: Opt(ListNode(
Expand Down
13 changes: 1 addition & 12 deletions java/1.19/src/schemas/worldgen/StructureSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
const StringNode = RawStringNode.bind(undefined, collections)
const Reference = RawReference.bind(undefined, schemas)

const StructureSet = ChoiceNode([
{
type: 'string',
node: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } })
},
{
type: 'object',
node: Reference('structure_set')
}
], { choiceContext: 'structure_set' })

schemas.register('structure_set', ObjectNode({
structures: ListNode(
ObjectNode({
Expand All @@ -49,7 +38,7 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
frequency_reduction_method: Opt(StringNode({ enum: ['default', 'legacy_type_1', 'legacy_type_2', 'legacy_type_3'] })),
frequency: Opt(NumberNode({ min: 0, max: 1 })),
exclusion_zone: Opt(ObjectNode({
other_set: StructureSet,
other_set: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } }),
chunk_count: NumberNode({ integer: true, min: 1, max: 16 })
})),
locate_offset: Opt(ListNode(
Expand Down
13 changes: 1 addition & 12 deletions java/1.20.2/src/schemas/worldgen/StructureSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
const StringNode = RawStringNode.bind(undefined, collections)
const Reference = RawReference.bind(undefined, schemas)

const StructureSet = ChoiceNode([
{
type: 'string',
node: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } })
},
{
type: 'object',
node: Reference('structure_set')
}
], { choiceContext: 'structure_set' })

schemas.register('structure_set', ObjectNode({
structures: ListNode(
ObjectNode({
Expand All @@ -49,7 +38,7 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
frequency_reduction_method: Opt(StringNode({ enum: ['default', 'legacy_type_1', 'legacy_type_2', 'legacy_type_3'] })),
frequency: Opt(NumberNode({ min: 0, max: 1 })),
exclusion_zone: Opt(ObjectNode({
other_set: StructureSet,
other_set: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } }),
chunk_count: NumberNode({ integer: true, min: 1, max: 16 })
})),
locate_offset: Opt(ListNode(
Expand Down
5 changes: 4 additions & 1 deletion java/1.20.3/src/schemas/worldgen/Structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,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: ListNode(Reference('pool_alias_binding')),
}))
}
}
}, { context: 'pool_alias_binding' }), {
Expand Down
13 changes: 1 addition & 12 deletions java/1.20.3/src/schemas/worldgen/StructureSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
const StringNode = RawStringNode.bind(undefined, collections)
const Reference = RawReference.bind(undefined, schemas)

const StructureSet = ChoiceNode([
{
type: 'string',
node: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } })
},
{
type: 'object',
node: Reference('structure_set')
}
], { choiceContext: 'structure_set' })

schemas.register('structure_set', ObjectNode({
structures: ListNode(
ObjectNode({
Expand All @@ -49,7 +38,7 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
frequency_reduction_method: Opt(StringNode({ enum: ['default', 'legacy_type_1', 'legacy_type_2', 'legacy_type_3'] })),
frequency: Opt(NumberNode({ min: 0, max: 1 })),
exclusion_zone: Opt(ObjectNode({
other_set: StructureSet,
other_set: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } }),
chunk_count: NumberNode({ integer: true, min: 1, max: 16 })
})),
locate_offset: Opt(ListNode(
Expand Down
5 changes: 4 additions & 1 deletion java/1.20.5/src/schemas/worldgen/Structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,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: ListNode(Reference('pool_alias_binding')),
}))
}
}
}, { context: 'pool_alias_binding' }), {
Expand Down
13 changes: 1 addition & 12 deletions java/1.20.5/src/schemas/worldgen/StructureSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
const StringNode = RawStringNode.bind(undefined, collections)
const Reference = RawReference.bind(undefined, schemas)

const StructureSet = ChoiceNode([
{
type: 'string',
node: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } })
},
{
type: 'object',
node: Reference('structure_set')
}
], { choiceContext: 'structure_set' })

schemas.register('structure_set', ObjectNode({
structures: ListNode(
ObjectNode({
Expand All @@ -49,7 +38,7 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
frequency_reduction_method: Opt(StringNode({ enum: ['default', 'legacy_type_1', 'legacy_type_2', 'legacy_type_3'] })),
frequency: Opt(NumberNode({ min: 0, max: 1 })),
exclusion_zone: Opt(ObjectNode({
other_set: StructureSet,
other_set: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } }),
chunk_count: NumberNode({ integer: true, min: 1, max: 16 })
})),
locate_offset: Opt(ListNode(
Expand Down
13 changes: 1 addition & 12 deletions java/1.20/src/schemas/worldgen/StructureSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
const StringNode = RawStringNode.bind(undefined, collections)
const Reference = RawReference.bind(undefined, schemas)

const StructureSet = ChoiceNode([
{
type: 'string',
node: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } })
},
{
type: 'object',
node: Reference('structure_set')
}
], { choiceContext: 'structure_set' })

schemas.register('structure_set', ObjectNode({
structures: ListNode(
ObjectNode({
Expand All @@ -49,7 +38,7 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
frequency_reduction_method: Opt(StringNode({ enum: ['default', 'legacy_type_1', 'legacy_type_2', 'legacy_type_3'] })),
frequency: Opt(NumberNode({ min: 0, max: 1 })),
exclusion_zone: Opt(ObjectNode({
other_set: StructureSet,
other_set: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } }),
chunk_count: NumberNode({ integer: true, min: 1, max: 16 })
})),
locate_offset: Opt(ListNode(
Expand Down
4 changes: 2 additions & 2 deletions java/1.21/src/schemas/worldgen/Structure.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +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'] }),
liquid_settings: Opt(StringNode({ enum: ['apply_waterlogging', 'ignore_waterlogging'] })),
pool_aliases: Opt(ListNode(Reference('pool_alias_binding')))
},
'minecraft:mineshaft': {
Expand Down Expand Up @@ -126,7 +126,7 @@ export function initStructureSchemas(schemas: SchemaRegistry, collections: Colle
'minecraft:random_group': {
groups: ListNode(ObjectNode({
weight: NumberNode({ integer: true }),
data: Reference('pool_alias_binding'),
data: ListNode(Reference('pool_alias_binding')),
}))
}
}
Expand Down
13 changes: 1 addition & 12 deletions java/1.21/src/schemas/worldgen/StructureSet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,17 +22,6 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
const StringNode = RawStringNode.bind(undefined, collections)
const Reference = RawReference.bind(undefined, schemas)

const StructureSet = ChoiceNode([
{
type: 'string',
node: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } })
},
{
type: 'object',
node: Reference('structure_set')
}
], { choiceContext: 'structure_set' })

schemas.register('structure_set', ObjectNode({
structures: ListNode(
ObjectNode({
Expand All @@ -49,7 +38,7 @@ export function initStructureSetSchemas(schemas: SchemaRegistry, collections: Co
frequency_reduction_method: Opt(StringNode({ enum: ['default', 'legacy_type_1', 'legacy_type_2', 'legacy_type_3'] })),
frequency: Opt(NumberNode({ min: 0, max: 1 })),
exclusion_zone: Opt(ObjectNode({
other_set: StructureSet,
other_set: StringNode({ validator: 'resource', params: { pool: '$worldgen/structure_set' } }),
chunk_count: NumberNode({ integer: true, min: 1, max: 16 })
})),
locate_offset: Opt(ListNode(
Expand Down
6 changes: 4 additions & 2 deletions java/1.21/src/schemas/worldgen/TemplatePool.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
Mod,
NumberNode,
ObjectNode,
Opt,
Reference as RawReference,
Switch,
SchemaRegistry,
Expand Down Expand Up @@ -64,7 +65,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'] }),
override_liquid_settings: Opt(StringNode({ enum: ['apply_waterlogging', 'ignore_waterlogging'] })),
processors: Processors
},
'minecraft:list_pool_element': {
Expand All @@ -76,7 +77,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'] }),
override_liquid_settings: Opt(StringNode({ enum: ['apply_waterlogging', 'ignore_waterlogging'] })),
processors: Processors
}
}
Expand All @@ -88,3 +89,4 @@ export function initTemplatePoolSchemas(schemas: SchemaRegistry, collections: Co
})
}))
}

0 comments on commit adb33d1

Please sign in to comment.