Skip to content

Commit

Permalink
1.20.5-pre1
Browse files Browse the repository at this point in the history
  • Loading branch information
misode committed Apr 15, 2024
1 parent 7cb1c03 commit 8cb5d2f
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
2 changes: 1 addition & 1 deletion java/1.20.5/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@mcschema/java-1.20.5",
"version": "0.0.24",
"version": "0.0.25",
"description": "Schemas for Java Edition 1.20.5",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
17 changes: 11 additions & 6 deletions java/1.20.5/src/schemas/Common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,11 @@ export function initCommonSchemas(schemas: SchemaRegistry, collections: Collecti
})),
})

const ListOperation = ({ node, maxLength }: { node: INode, maxLength: number }) => ObjectNode({
values: node,
...ListOperationFields({ maxLength })
}, { context: 'list_operation'})

ConditionCases = (entitySourceNode: INode<any> = StringNode({ enum: 'entity_source' })) => ({
'minecraft:all_of': {
terms: ListNode(
Expand Down Expand Up @@ -580,7 +585,8 @@ export function initCommonSchemas(schemas: SchemaRegistry, collections: Collecti
'minecraft:table_bonus': {
enchantment: StringNode({ validator: 'resource', params: { pool: 'enchantment' } }),
chances: ListNode(
NumberNode({ min: 0, max: 1 })
NumberNode({ min: 0, max: 1 }),
{ minLength: 1 },
)
},
'minecraft:time_check': {
Expand Down Expand Up @@ -732,11 +738,10 @@ export function initCommonSchemas(schemas: SchemaRegistry, collections: Collecti
add: Opt(BooleanNode())
},
'minecraft:set_fireworks': {
explosions: Opt(ListNode(
Reference('firework_explosion'),
{ maxLength: 256 },
)),
...ListOperationFields({ maxLength: 256 }),
explosions: Opt(ListOperation({
node: Reference('firework_explosion'),
maxLength: 256,
})),
flight_duration: Opt(NumberNode({ integer: true, min: 0, max: 255 })),
},
'minecraft:set_firework_explosion': {
Expand Down
2 changes: 1 addition & 1 deletion java/1.20.5/src/schemas/assets/Font.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export function initFontSchemas(schemas: SchemaRegistry, collections: Collection
size: Opt(NumberNode()),
oversample: Opt(NumberNode()),
shift: Opt(ListNode(
NumberNode(),
NumberNode({ min: -100, max: 100 }),
{ minLength: 2, maxLength: 2 }
)),
skip: Opt(StringOrList(
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 8cb5d2f

Please sign in to comment.