Skip to content

Commit

Permalink
Changes from 24w37a and 24w38a
Browse files Browse the repository at this point in the history
  • Loading branch information
misode committed Sep 18, 2024
1 parent 3e54166 commit c87fd9b
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 7 deletions.
2 changes: 1 addition & 1 deletion java/1.21.2/package.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
6 changes: 6 additions & 0 deletions java/1.21.2/src/Collections.ts
Original file line number Diff line number Diff line change
Expand Up @@ -655,4 +655,10 @@ export function initCollections(collections: CollectionRegistry) {
'toot_horn',
'brush',
])

collections.register('salmon_variant', [
'small',
'medium',
'large',
])
}
6 changes: 3 additions & 3 deletions java/1.21.2/src/LootContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const LootTableTypes = new Map<string, LootContextRegistration>([
['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: [] }],
Expand All @@ -36,8 +36,8 @@ export const LootTableTypes = new Map<string, LootContextRegistration>([
['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] }]
])

/**
Expand Down
3 changes: 2 additions & 1 deletion java/1.21.2/src/schemas/Advancement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
))
Expand Down
10 changes: 9 additions & 1 deletion java/1.21.2/src/schemas/Components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 })),
Expand Down Expand Up @@ -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'),
)),
Expand Down
3 changes: 3 additions & 0 deletions java/1.21.2/src/schemas/Predicates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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' })),
Expand Down
6 changes: 6 additions & 0 deletions java/1.21.2/src/schemas/Recipe.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'),
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 c87fd9b

Please sign in to comment.