From 90de455dc3603dde75bb01c746ac81f1ed2dd4ef Mon Sep 17 00:00:00 2001 From: Misode Date: Thu, 28 Mar 2024 15:30:16 +0100 Subject: [PATCH] 24w13a --- java/1.20.5/package.json | 2 +- java/1.20.5/src/LootContext.ts | 1 + java/1.20.5/src/schemas/Common.ts | 65 ++++++++++++--------------- java/1.20.5/src/schemas/Components.ts | 2 + java/1.20.5/src/schemas/Predicates.ts | 4 ++ package-lock.json | 2 +- 6 files changed, 38 insertions(+), 38 deletions(-) diff --git a/java/1.20.5/package.json b/java/1.20.5/package.json index db7550d..0e5e9e2 100644 --- a/java/1.20.5/package.json +++ b/java/1.20.5/package.json @@ -1,6 +1,6 @@ { "name": "@mcschema/java-1.20.5", - "version": "0.0.14", + "version": "0.0.15", "description": "Schemas for Java Edition 1.20.5", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/java/1.20.5/src/LootContext.ts b/java/1.20.5/src/LootContext.ts index 057d858..839b879 100644 --- a/java/1.20.5/src/LootContext.ts +++ b/java/1.20.5/src/LootContext.ts @@ -25,6 +25,7 @@ export const LootTableTypes = new Map([ ['minecraft:command', { requires: [LootContext.Origin], allows: [LootContext.ThisEntity] }], ['minecraft:empty', { requires: [], allows: [] }], ['minecraft:entity', { requires: [LootContext.DamageSource, LootContext.Origin, LootContext.ThisEntity], allows: [LootContext.DirectKillerEntity, LootContext.KillerEntity, LootContext.LastDamagePlayer] }], + ['minecraft:equipment', { requires: [LootContext.Origin, LootContext.ThisEntity], allows: [] } ], ['minecraft:fishing', { requires: [LootContext.Origin, LootContext.Tool], allows: [LootContext.ThisEntity] }], ['minecraft:generic', { requires: [LootContext.DamageSource, LootContext.BlockEntity, LootContext.BlockState, LootContext.DirectKillerEntity, LootContext.ExplosionRadius, LootContext.KillerEntity, LootContext.LastDamagePlayer, LootContext.Origin, LootContext.ThisEntity, LootContext.Tool], allows: [] }], ['minecraft:gift', { requires: [LootContext.Origin, LootContext.ThisEntity], allows: [] }], diff --git a/java/1.20.5/src/schemas/Common.ts b/java/1.20.5/src/schemas/Common.ts index ffeec94..ca748e7 100644 --- a/java/1.20.5/src/schemas/Common.ts +++ b/java/1.20.5/src/schemas/Common.ts @@ -315,25 +315,19 @@ export function initCommonSchemas(schemas: SchemaRegistry, collections: Collecti value: NumberNode(config) }, 'minecraft:uniform': { - value: ObjectNode({ - min_inclusive: NumberNode(config), - max_exclusive: NumberNode(config) - }) + min_inclusive: NumberNode(config), + max_exclusive: NumberNode(config) }, 'minecraft:clamped_normal': { - value: ObjectNode({ - min: NumberNode(), - max: NumberNode(), - mean: NumberNode(), - deviation: NumberNode() - }) + min: NumberNode(), + max: NumberNode(), + mean: NumberNode(), + deviation: NumberNode() }, 'minecraft:trapezoid': { - value: ObjectNode({ - min: NumberNode(), - max: NumberNode(), - plateau: NumberNode() - }) + min: NumberNode(), + max: NumberNode(), + plateau: NumberNode() } } ) @@ -350,31 +344,23 @@ export function initCommonSchemas(schemas: SchemaRegistry, collections: Collecti value: NumberNode({ integer: true, ...config }) }, 'minecraft:uniform': { - value: ObjectNode({ - min_inclusive: NumberNode({ integer: true, ...config }), - max_inclusive: NumberNode({ integer: true, ...config }) - }) + min_inclusive: NumberNode({ integer: true, ...config }), + max_inclusive: NumberNode({ integer: true, ...config }) }, 'minecraft:biased_to_bottom': { - value: ObjectNode({ - min_inclusive: NumberNode({ integer: true, ...config }), - max_inclusive: NumberNode({ integer: true, ...config }) - }) + min_inclusive: NumberNode({ integer: true, ...config }), + max_inclusive: NumberNode({ integer: true, ...config }) }, 'minecraft:clamped': { - value: ObjectNode({ - min_inclusive: NumberNode({ integer: true, ...config }), - max_inclusive: NumberNode({ integer: true, ...config }), - source: Reference('int_provider') - }) + min_inclusive: NumberNode({ integer: true, ...config }), + max_inclusive: NumberNode({ integer: true, ...config }), + source: Reference('int_provider') }, 'minecraft:clamped_normal': { - value: ObjectNode({ - min_inclusive: NumberNode({ integer: true, ...config }), - max_inclusive: NumberNode({ integer: true, ...config }), - mean: NumberNode(), - deviation: NumberNode() - }) + min_inclusive: NumberNode({ integer: true, ...config }), + max_inclusive: NumberNode({ integer: true, ...config }), + mean: NumberNode(), + deviation: NumberNode() }, 'minecraft:weighted_list': { distribution: ListNode( @@ -636,9 +622,12 @@ export function initCommonSchemas(schemas: SchemaRegistry, collections: Collecti }, 'minecraft:copy_components': { source: StringNode({ enum: ['block_entity'] }), - components: ListNode( + include: Opt(ListNode( StringNode({ validator: 'resource', params: { pool: 'data_component_type' } }), - ), + )), + exclude: Opt(ListNode( + StringNode({ validator: 'resource', params: { pool: 'data_component_type' } }), + )), }, 'minecraft:copy_custom_data': { source: Reference('nbt_provider'), @@ -771,11 +760,15 @@ export function initCommonSchemas(schemas: SchemaRegistry, collections: Collecti }, 'minecraft:set_name': { entity: Opt(entitySourceNode), + target: Opt(StringNode({ enum: ['custom_name', 'item_name'] })), name: Opt(Reference('text_component')) }, 'minecraft:set_potion': { id: StringNode({ validator: 'resource', params: { pool: 'potion' } }) }, + 'minecraft:ominous_bottle_amplifier': { + amplifier: Reference('number_provider') + }, 'minecraft:set_stew_effect': { effects: Opt(ListNode( ObjectNode({ diff --git a/java/1.20.5/src/schemas/Components.ts b/java/1.20.5/src/schemas/Components.ts index 8d3a8aa..9132b1a 100644 --- a/java/1.20.5/src/schemas/Components.ts +++ b/java/1.20.5/src/schemas/Components.ts @@ -155,6 +155,7 @@ export function initComponentsSchemas(schemas: SchemaRegistry, collections: Coll show_in_tooltip: Opt(BooleanNode()) }, { context: 'data_component.unbreakable' }), 'minecraft:custom_name': StringNode(), // text component + 'minecraft:item_name': StringNode(), // text component 'minecraft:lore': ListNode( StringNode(), // text component { context: 'data_component.lore', maxLength: 256 }, @@ -321,6 +322,7 @@ export function initComponentsSchemas(schemas: SchemaRegistry, collections: Coll // TODO: any unsafe data }, { context: 'data_component.block_entity_data' }), 'minecraft:instrument': StringNode({ validator: 'resource', params: { pool: 'instrument' } }), + 'minecraft:ominous_bottle_amplifier': NumberNode({ integer: true, min: 0, max: 4 }), 'minecraft:recipes': ListNode( StringNode({ validator: 'resource', params: { pool: '$recipe' } }), { context: 'data_component.recipes' }, diff --git a/java/1.20.5/src/schemas/Predicates.ts b/java/1.20.5/src/schemas/Predicates.ts index 9a7da33..a8bbeeb 100644 --- a/java/1.20.5/src/schemas/Predicates.ts +++ b/java/1.20.5/src/schemas/Predicates.ts @@ -232,6 +232,10 @@ export function initPredicatesSchemas(schemas: SchemaRegistry, collections: Coll 'minecraft:rabbit': { variant: Opt(StringNode({ enum: 'rabbit_variant' })) }, + 'minecraft:raider': { + has_raid: Opt(BooleanNode()), + is_captain: Opt(BooleanNode()), + }, 'minecraft:slime': { size: Reference('int_bounds') }, diff --git a/package-lock.json b/package-lock.json index b1e5cb0..eb949f4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -115,7 +115,7 @@ }, "java/1.20.5": { "name": "@mcschema/java-1.20.5", - "version": "0.0.14", + "version": "0.0.15", "license": "MIT", "dependencies": { "@mcschema/core": "^0.13.0"