From c87fd9bba3b127a2a26bd64d5265b8b77ef73525 Mon Sep 17 00:00:00 2001 From: Misode Date: Wed, 18 Sep 2024 16:53:17 +0200 Subject: [PATCH] Changes from 24w37a and 24w38a --- java/1.21.2/package.json | 2 +- java/1.21.2/src/Collections.ts | 6 ++++++ java/1.21.2/src/LootContext.ts | 6 +++--- java/1.21.2/src/schemas/Advancement.ts | 3 ++- java/1.21.2/src/schemas/Components.ts | 10 +++++++++- java/1.21.2/src/schemas/Predicates.ts | 3 +++ java/1.21.2/src/schemas/Recipe.ts | 6 ++++++ package-lock.json | 2 +- 8 files changed, 31 insertions(+), 7 deletions(-) diff --git a/java/1.21.2/package.json b/java/1.21.2/package.json index 510a876..9b96634 100644 --- a/java/1.21.2/package.json +++ b/java/1.21.2/package.json @@ -1,6 +1,6 @@ { "name": "@mcschema/java-1.21.2", - "version": "0.0.8", + "version": "0.0.9", "description": "Schemas for Java Edition 1.21.2", "main": "lib/index.js", "types": "lib/index.d.ts", diff --git a/java/1.21.2/src/Collections.ts b/java/1.21.2/src/Collections.ts index ff3e6b8..c75f9bb 100644 --- a/java/1.21.2/src/Collections.ts +++ b/java/1.21.2/src/Collections.ts @@ -655,4 +655,10 @@ export function initCollections(collections: CollectionRegistry) { 'toot_horn', 'brush', ]) + + collections.register('salmon_variant', [ + 'small', + 'medium', + 'large', + ]) } diff --git a/java/1.21.2/src/LootContext.ts b/java/1.21.2/src/LootContext.ts index 1fea0c7..67bcdf2 100644 --- a/java/1.21.2/src/LootContext.ts +++ b/java/1.21.2/src/LootContext.ts @@ -19,7 +19,7 @@ export const LootTableTypes = new Map([ ['minecraft:advancement_entity', { requires: [LootContext.Origin, LootContext.ThisEntity], allows: [] }], ['minecraft:advancement_location', { requires: [LootContext.Origin, LootContext.ThisEntity, LootContext.Tool, LootContext.BlockState], allows: [] }], ['minecraft:advancement_reward', { requires: [LootContext.Origin, LootContext.ThisEntity], allows: [] }], - ['minecraft:archaeology', { requires: [LootContext.Origin], allows: [LootContext.ThisEntity] }], + ['minecraft:archaeology', { requires: [LootContext.Origin, LootContext.ThisEntity, LootContext.Tool], allows: [] }], ['minecraft:barter', { requires: [LootContext.ThisEntity], allows: [] }], ['minecraft:block', { requires: [LootContext.BlockState, LootContext.Origin, LootContext.Tool], allows: [LootContext.BlockEntity, LootContext.ExplosionRadius, LootContext.ThisEntity] }], ['minecraft:block_use', { requires: [LootContext.ThisEntity, LootContext.Origin, LootContext.BlockState], allows: [] }], @@ -36,8 +36,8 @@ export const LootTableTypes = new Map([ ['minecraft:generic', { requires: [LootContext.DamageSource, LootContext.BlockEntity, LootContext.BlockState, LootContext.DirectAttackingEntity, LootContext.ExplosionRadius, LootContext.AttackingEntity, LootContext.LastDamagePlayer, LootContext.Origin, LootContext.ThisEntity, LootContext.Tool], allows: [] }], ['minecraft:gift', { requires: [LootContext.Origin, LootContext.ThisEntity], allows: [] }], ['minecraft:selector', { requires: [LootContext.Origin], allows: [LootContext.ThisEntity] }], - ['minecraft:shearing', { requires: [LootContext.Origin], allows: [LootContext.ThisEntity] }], - ['minecraft:vault', { requires: [LootContext.Origin], allows: [LootContext.ThisEntity] }] + ['minecraft:shearing', { requires: [LootContext.Origin, LootContext.ThisEntity, LootContext.Tool], allows: [] }], + ['minecraft:vault', { requires: [LootContext.Origin], allows: [LootContext.ThisEntity, LootContext.Tool] }] ]) /** diff --git a/java/1.21.2/src/schemas/Advancement.ts b/java/1.21.2/src/schemas/Advancement.ts index 6f74b23..7cb6ff0 100644 --- a/java/1.21.2/src/schemas/Advancement.ts +++ b/java/1.21.2/src/schemas/Advancement.ts @@ -205,8 +205,9 @@ export function initAdvancementSchemas(schemas: SchemaRegistry, collections: Col entity: EntityPredicate, killing_blow: Opt(Reference('damage_source_predicate')) }, - 'minecraft:killed_by_crossbow': { + 'minecraft:killed_by_arrow': { unique_entity_types: Opt(Reference('int_bounds')), + fired_from_weapon: Opt(Reference('item_predicate')), victims: Opt(ListNode( EntityPredicate )) diff --git a/java/1.21.2/src/schemas/Components.ts b/java/1.21.2/src/schemas/Components.ts index ce7901b..a19281d 100644 --- a/java/1.21.2/src/schemas/Components.ts +++ b/java/1.21.2/src/schemas/Components.ts @@ -254,6 +254,12 @@ export function initComponentsSchemas(schemas: SchemaRegistry, collections: Coll 'minecraft:custom_model_data': NumberNode({ integer: true }), 'minecraft:custom_name': StringNode(), // text component 'minecraft:damage': NumberNode({ integer: true, min: 0 }), + 'minecraft:damage_resistant': ObjectNode({ + types: StringNode({ validator: 'resource', params: { pool: '$damage_type', requireTag: true } }) + }), + 'minecraft:death_protection': ObjectNode({ + death_effects: Opt(ListNode(Reference('consume_effect'))), + }), 'minecraft:debug_stick_state': MapNode( StringNode({ validator: 'resource', params: { pool: 'block' } }), StringNode(), // TODO: block state key validation @@ -289,8 +295,9 @@ export function initComponentsSchemas(schemas: SchemaRegistry, collections: Coll model: Opt(StringNode()), allowed_entities: Opt(Tag({ resource: 'entity_type' })), dispensable: Opt(BooleanNode()), + swappable: Opt(BooleanNode()), + damage_on_hurt: Opt(BooleanNode()), }), - 'minecraft:fire_resistant': ObjectNode({}), 'minecraft:firework_explosion': Reference('firework_explosion'), 'minecraft:fireworks': ObjectNode({ flight_duration: Opt(NumberNode({ integer: true, min: 0, max: 255 })), @@ -376,6 +383,7 @@ export function initComponentsSchemas(schemas: SchemaRegistry, collections: Coll node: ObjectNode({ potion: Opt(StringNode({ validator: 'resource', params: { pool: 'potion' } })), custom_color: Opt(NumberNode({ color: true })), + custom_name: Opt(StringNode()), custom_effects: Opt(ListNode( Reference('mob_effect_instance'), )), diff --git a/java/1.21.2/src/schemas/Predicates.ts b/java/1.21.2/src/schemas/Predicates.ts index 7cf5fb9..3fa822e 100644 --- a/java/1.21.2/src/schemas/Predicates.ts +++ b/java/1.21.2/src/schemas/Predicates.ts @@ -322,6 +322,9 @@ export function initPredicatesSchemas(schemas: SchemaRegistry, collections: Coll has_raid: Opt(BooleanNode()), is_captain: Opt(BooleanNode()), }, + 'minecraft:salmon': { + variant: Opt(StringNode({ enum: 'salmon_variant' })), + }, 'minecraft:sheep': { sheared: Opt(BooleanNode()), color: Opt(StringNode({ enum: 'dye_color' })), diff --git a/java/1.21.2/src/schemas/Recipe.ts b/java/1.21.2/src/schemas/Recipe.ts index e07018d..761d3a3 100644 --- a/java/1.21.2/src/schemas/Recipe.ts +++ b/java/1.21.2/src/schemas/Recipe.ts @@ -40,6 +40,12 @@ export function initRecipeSchemas(schemas: SchemaRegistry, collections: Collecti ingredients: ListNode(Reference('recipe_ingredient')), result: Reference('item_stack') }, + 'minecraft:crafting_transmute': { + group: Opt(StringNode()), + input: ListNode(Reference('recipe_ingredient')), + material: ListNode(Reference('recipe_ingredient')), + result: StringNode({ validator: 'resource', params: { pool: 'item' } }) + }, 'minecraft:smelting': { group: Opt(StringNode()), ingredient: Reference('recipe_ingredient'), diff --git a/package-lock.json b/package-lock.json index c3ab605..301a5e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -131,7 +131,7 @@ }, "java/1.21.2": { "name": "@mcschema/java-1.21.2", - "version": "0.0.8", + "version": "0.0.9", "license": "MIT", "dependencies": { "@mcschema/core": "^0.13.0"