Skip to content

Commit

Permalink
24w13a
Browse files Browse the repository at this point in the history
  • Loading branch information
misode committed Mar 28, 2024
1 parent 48cccf9 commit 90de455
Show file tree
Hide file tree
Showing 6 changed files with 38 additions and 38 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.14",
"version": "0.0.15",
"description": "Schemas for Java Edition 1.20.5",
"main": "lib/index.js",
"types": "lib/index.d.ts",
Expand Down
1 change: 1 addition & 0 deletions java/1.20.5/src/LootContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ export const LootTableTypes = new Map<string, LootContextRegistration>([
['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: [] }],
Expand Down
65 changes: 29 additions & 36 deletions java/1.20.5/src/schemas/Common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
}
}
)
Expand All @@ -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(
Expand Down Expand Up @@ -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'),
Expand Down Expand Up @@ -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({
Expand Down
2 changes: 2 additions & 0 deletions java/1.20.5/src/schemas/Components.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
Expand Down Expand Up @@ -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' },
Expand Down
4 changes: 4 additions & 0 deletions java/1.20.5/src/schemas/Predicates.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
},
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 90de455

Please sign in to comment.