From 52c00a68f6b2ae04a966685400e21cbf4ff9e03b Mon Sep 17 00:00:00 2001 From: Misode Date: Fri, 27 Sep 2024 23:39:56 +0200 Subject: [PATCH 1/4] Add packtest commands.json configuration --- commands.json | 1362 +++++++++++++++++++++++++++++++++++++++++++++++++ spyglass.json | 14 +- 2 files changed, 1373 insertions(+), 3 deletions(-) create mode 100644 commands.json diff --git a/commands.json b/commands.json new file mode 100644 index 0000000000..3832ccb272 --- /dev/null +++ b/commands.json @@ -0,0 +1,1362 @@ +{ + "type": "root", + "children": { + "assert": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "pos": { + "type": "argument", + "parser": "minecraft:block_pos", + "children": { + "block": { + "type": "argument", + "parser": "minecraft:block_predicate", + "executable": true + } + } + } + } + }, + "chat": { + "type": "literal", + "children": { + "pattern": { + "type": "argument", + "parser": "brigadier:string", + "properties": { + "type": "phrase" + }, + "executable": true, + "children": { + "receivers": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "players", + "amount": "multiple" + }, + "executable": true + } + } + } + } + }, + "data": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "sourcePos": { + "type": "argument", + "parser": "minecraft:block_pos", + "children": { + "path": { + "type": "argument", + "parser": "minecraft:nbt_path", + "executable": true + } + } + } + } + }, + "entity": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "single" + }, + "children": { + "path": { + "type": "argument", + "parser": "minecraft:nbt_path", + "executable": true + } + } + } + } + }, + "storage": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:resource_location", + "children": { + "path": { + "type": "argument", + "parser": "minecraft:nbt_path", + "executable": true + } + } + } + } + } + } + }, + "entity": { + "type": "literal", + "children": { + "entities": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "multiple" + }, + "executable": true, + "children": { + "inside": { + "type": "literal", + "executable": true + } + } + } + } + }, + "items": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "pos": { + "type": "argument", + "parser": "minecraft:block_pos", + "children": { + "slots": { + "type": "argument", + "parser": "minecraft:item_slots", + "children": { + "item_predicate": { + "type": "argument", + "parser": "minecraft:item_predicate", + "executable": true + } + } + } + } + } + } + }, + "entity": { + "type": "literal", + "children": { + "entities": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "multiple" + }, + "children": { + "slots": { + "type": "argument", + "parser": "minecraft:item_slots", + "children": { + "item_predicate": { + "type": "argument", + "parser": "minecraft:item_predicate", + "executable": true + } + } + } + } + } + } + } + } + }, + "not": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "pos": { + "type": "argument", + "parser": "minecraft:block_pos", + "children": { + "block": { + "type": "argument", + "parser": "minecraft:block_predicate", + "executable": true + } + } + } + } + }, + "chat": { + "type": "literal", + "children": { + "pattern": { + "type": "argument", + "parser": "brigadier:string", + "properties": { + "type": "phrase" + }, + "executable": true, + "children": { + "receivers": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "players", + "amount": "multiple" + }, + "executable": true + } + } + } + } + }, + "data": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "sourcePos": { + "type": "argument", + "parser": "minecraft:block_pos", + "children": { + "path": { + "type": "argument", + "parser": "minecraft:nbt_path", + "executable": true + } + } + } + } + }, + "entity": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "single" + }, + "children": { + "path": { + "type": "argument", + "parser": "minecraft:nbt_path", + "executable": true + } + } + } + } + }, + "storage": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:resource_location", + "children": { + "path": { + "type": "argument", + "parser": "minecraft:nbt_path", + "executable": true + } + } + } + } + } + } + }, + "entity": { + "type": "literal", + "children": { + "entities": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "multiple" + }, + "executable": true, + "children": { + "inside": { + "type": "literal", + "executable": true + } + } + } + } + }, + "items": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "pos": { + "type": "argument", + "parser": "minecraft:block_pos", + "children": { + "slots": { + "type": "argument", + "parser": "minecraft:item_slots", + "children": { + "item_predicate": { + "type": "argument", + "parser": "minecraft:item_predicate", + "executable": true + } + } + } + } + } + } + }, + "entity": { + "type": "literal", + "children": { + "entities": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "multiple" + }, + "children": { + "slots": { + "type": "argument", + "parser": "minecraft:item_slots", + "children": { + "item_predicate": { + "type": "argument", + "parser": "minecraft:item_predicate", + "executable": true + } + } + } + } + } + } + } + } + }, + "predicate": { + "type": "literal", + "children": { + "predicate": { + "type": "argument", + "parser": "minecraft:loot_predicate", + "executable": true + } + } + }, + "score": { + "type": "literal", + "children": { + "target": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "targetObjective": { + "type": "argument", + "parser": "minecraft:objective", + "children": { + "<": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + "<=": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + "=": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + ">": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + "matches": { + "type": "literal", + "children": { + "range": { + "type": "argument", + "parser": "minecraft:int_range", + "executable": true + } + } + } + } + } + } + } + } + } + } + }, + "predicate": { + "type": "literal", + "children": { + "predicate": { + "type": "argument", + "parser": "minecraft:loot_predicate", + "executable": true + } + } + }, + "score": { + "type": "literal", + "children": { + "target": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "targetObjective": { + "type": "argument", + "parser": "minecraft:objective", + "children": { + "<": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + "<=": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + "=": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + ">": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + "matches": { + "type": "literal", + "children": { + "range": { + "type": "argument", + "parser": "minecraft:int_range", + "executable": true + } + } + } + } + } + } + } + } + } + } + }, + "await": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "pos": { + "type": "argument", + "parser": "minecraft:block_pos", + "children": { + "block": { + "type": "argument", + "parser": "minecraft:block_predicate", + "executable": true + } + } + } + } + }, + "chat": { + "type": "literal", + "children": { + "pattern": { + "type": "argument", + "parser": "brigadier:string", + "properties": { + "type": "phrase" + }, + "executable": true, + "children": { + "receivers": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "players", + "amount": "multiple" + }, + "executable": true + } + } + } + } + }, + "data": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "sourcePos": { + "type": "argument", + "parser": "minecraft:block_pos", + "children": { + "path": { + "type": "argument", + "parser": "minecraft:nbt_path", + "executable": true + } + } + } + } + }, + "entity": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "single" + }, + "children": { + "path": { + "type": "argument", + "parser": "minecraft:nbt_path", + "executable": true + } + } + } + } + }, + "storage": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:resource_location", + "children": { + "path": { + "type": "argument", + "parser": "minecraft:nbt_path", + "executable": true + } + } + } + } + } + } + }, + "delay": { + "type": "literal", + "children": { + "time": { + "type": "argument", + "parser": "minecraft:time", + "properties": { + "min": 0 + }, + "executable": true + } + } + }, + "entity": { + "type": "literal", + "children": { + "entities": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "multiple" + }, + "executable": true, + "children": { + "inside": { + "type": "literal", + "executable": true + } + } + } + } + }, + "items": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "pos": { + "type": "argument", + "parser": "minecraft:block_pos", + "children": { + "slots": { + "type": "argument", + "parser": "minecraft:item_slots", + "children": { + "item_predicate": { + "type": "argument", + "parser": "minecraft:item_predicate", + "executable": true + } + } + } + } + } + } + }, + "entity": { + "type": "literal", + "children": { + "entities": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "multiple" + }, + "children": { + "slots": { + "type": "argument", + "parser": "minecraft:item_slots", + "children": { + "item_predicate": { + "type": "argument", + "parser": "minecraft:item_predicate", + "executable": true + } + } + } + } + } + } + } + } + }, + "not": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "pos": { + "type": "argument", + "parser": "minecraft:block_pos", + "children": { + "block": { + "type": "argument", + "parser": "minecraft:block_predicate", + "executable": true + } + } + } + } + }, + "chat": { + "type": "literal", + "children": { + "pattern": { + "type": "argument", + "parser": "brigadier:string", + "properties": { + "type": "phrase" + }, + "executable": true, + "children": { + "receivers": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "players", + "amount": "multiple" + }, + "executable": true + } + } + } + } + }, + "data": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "sourcePos": { + "type": "argument", + "parser": "minecraft:block_pos", + "children": { + "path": { + "type": "argument", + "parser": "minecraft:nbt_path", + "executable": true + } + } + } + } + }, + "entity": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "single" + }, + "children": { + "path": { + "type": "argument", + "parser": "minecraft:nbt_path", + "executable": true + } + } + } + } + }, + "storage": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:resource_location", + "children": { + "path": { + "type": "argument", + "parser": "minecraft:nbt_path", + "executable": true + } + } + } + } + } + } + }, + "delay": { + "type": "literal", + "children": { + "time": { + "type": "argument", + "parser": "minecraft:time", + "properties": { + "min": 0 + }, + "executable": true + } + } + }, + "entity": { + "type": "literal", + "children": { + "entities": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "multiple" + }, + "executable": true, + "children": { + "inside": { + "type": "literal", + "executable": true + } + } + } + } + }, + "items": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "pos": { + "type": "argument", + "parser": "minecraft:block_pos", + "children": { + "slots": { + "type": "argument", + "parser": "minecraft:item_slots", + "children": { + "item_predicate": { + "type": "argument", + "parser": "minecraft:item_predicate", + "executable": true + } + } + } + } + } + } + }, + "entity": { + "type": "literal", + "children": { + "entities": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "multiple" + }, + "children": { + "slots": { + "type": "argument", + "parser": "minecraft:item_slots", + "children": { + "item_predicate": { + "type": "argument", + "parser": "minecraft:item_predicate", + "executable": true + } + } + } + } + } + } + } + } + }, + "predicate": { + "type": "literal", + "children": { + "predicate": { + "type": "argument", + "parser": "minecraft:loot_predicate", + "executable": true + } + } + }, + "score": { + "type": "literal", + "children": { + "target": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "targetObjective": { + "type": "argument", + "parser": "minecraft:objective", + "children": { + "<": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + "<=": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + "=": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + ">": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + "matches": { + "type": "literal", + "children": { + "range": { + "type": "argument", + "parser": "minecraft:int_range", + "executable": true + } + } + } + } + } + } + } + } + } + } + }, + "predicate": { + "type": "literal", + "children": { + "predicate": { + "type": "argument", + "parser": "minecraft:loot_predicate", + "executable": true + } + } + }, + "score": { + "type": "literal", + "children": { + "target": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "targetObjective": { + "type": "argument", + "parser": "minecraft:objective", + "children": { + "<": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + "<=": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + "=": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + ">": { + "type": "literal", + "children": { + "source": { + "type": "argument", + "parser": "minecraft:score_holder", + "properties": { + "amount": "single" + }, + "children": { + "sourceObjective": { + "type": "argument", + "parser": "minecraft:objective", + "executable": true + } + } + } + } + }, + "matches": { + "type": "literal", + "children": { + "range": { + "type": "argument", + "parser": "minecraft:int_range", + "executable": true + } + } + } + } + } + } + } + } + } + } + }, + "dummy": { + "type": "literal", + "children": { + "dummy": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "single" + }, + "children": { + "attack": { + "type": "literal", + "children": { + "entity": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "single" + }, + "executable": true + } + } + }, + "drop": { + "type": "literal", + "executable": true, + "children": { + "all": { + "type": "literal", + "executable": true + } + } + }, + "jump": { + "type": "literal", + "executable": true + }, + "leave": { + "type": "literal", + "executable": true + }, + "mine": { + "type": "literal", + "children": { + "pos": { + "type": "argument", + "parser": "minecraft:block_pos", + "executable": true + } + } + }, + "respawn": { + "type": "literal", + "executable": true + }, + "selectslot": { + "type": "literal", + "children": { + "slot": { + "type": "argument", + "parser": "brigadier:integer", + "properties": { + "max": 9, + "min": 1 + }, + "executable": true + } + } + }, + "sneak": { + "type": "literal", + "children": { + "active": { + "type": "argument", + "parser": "brigadier:bool", + "executable": true + } + } + }, + "spawn": { + "type": "literal", + "executable": true + }, + "sprint": { + "type": "literal", + "children": { + "active": { + "type": "argument", + "parser": "brigadier:bool", + "executable": true + } + } + }, + "swap": { + "type": "literal", + "executable": true + }, + "use": { + "type": "literal", + "children": { + "block": { + "type": "literal", + "children": { + "pos": { + "type": "argument", + "parser": "minecraft:vec3", + "executable": true, + "children": { + "direction": { + "type": "argument", + "parser": "brigadier:string", + "properties": { + "type": "word" + }, + "executable": true + } + } + } + } + }, + "entity": { + "type": "literal", + "children": { + "entity": { + "type": "argument", + "parser": "minecraft:entity", + "properties": { + "type": "entities", + "amount": "single" + }, + "executable": true, + "children": { + "pos": { + "type": "argument", + "parser": "minecraft:vec3", + "executable": true + } + } + } + } + }, + "item": { + "type": "literal", + "executable": true + } + } + } + } + } + } + }, + "fail": { + "type": "literal", + "children": { + "message": { + "type": "argument", + "parser": "minecraft:component", + "executable": true + } + } + }, + "succeed": { + "type": "literal", + "executable": true + } + } +} diff --git a/spyglass.json b/spyglass.json index 697fb06bb3..a8cb197d1c 100644 --- a/spyglass.json +++ b/spyglass.json @@ -2,10 +2,18 @@ "env": { "gameVersion": "1.21", "exclude": [ - "@gitignore", + ".beet_cache/", ".vscode/", ".github/", - "test/" - ] + "docs/", + "out/", + "release/" + ], + "mcmetaSummaryOverrides": { + "commands": { + "path": "./commands.json", + "replace": false + } + } } } From da315b7dc2951391c59dbdf954f51e28029f3d32 Mon Sep 17 00:00:00 2001 From: Misode Date: Fri, 11 Oct 2024 17:32:02 +0200 Subject: [PATCH 2/4] Add base mcdoc types for gm4:log storage --- base/mod.mcdoc | 55 +++++++++++++++++++++++++++++++++++++++++ docs/making-a-module.md | 2 +- 2 files changed, 56 insertions(+), 1 deletion(-) create mode 100644 base/mod.mcdoc diff --git a/base/mod.mcdoc b/base/mod.mcdoc new file mode 100644 index 0000000000..efd5027d9a --- /dev/null +++ b/base/mod.mcdoc @@ -0,0 +1,55 @@ +dispatch minecraft:storage[gm4:log] to struct Gm4Log { + versions?: [LogVersion], + traverse_versions?: [LogVersion], + log?: struct { + require_id?: string + }, + outdated_list?: [LogEntry], + queue?: [LogEntry], + temp?: #[text_component] string, +} + +struct LogVersion { + id: string, + module: string, + version: string, + from?: string, +} + +struct LogEntry { + type: ("text" | "install" | "outdated" | "missing" | "version_conflict"), + ...gm4:log_entry[[type]], +} + +dispatch gm4:log_entry[text] to struct { + /// The text component message to display. + message: #[text_component] string, +} + +dispatch gm4:log_entry[install] to struct { + /// The name of the module that was just installed. + module: string, +} + +dispatch gm4:log_entry[outdated] to struct { + module: string, + download: #[url] string, + render: #[text_component] string, +} + +dispatch gm4:log_entry[missing] to struct MissingLog { + /// The name of the module. + module: string, + /// The ID of the module. + id: string, + /// The name of the dependency. + require: string, + /// The ID of the dependency. + require_id: string, +} + +dispatch gm4:log_entry[version_conflict] to struct { + ...MissingLog, + /// The required version of the dependency. + require_ver: string, +} diff --git a/docs/making-a-module.md b/docs/making-a-module.md index 81d481f82f..4e5ef06453 100644 --- a/docs/making-a-module.md +++ b/docs/making-a-module.md @@ -109,7 +109,7 @@ If all required dependencies are present, Lantern Load will call `init.mcfunctio #### Logging Messages can be logged during the load process. This can be done by appending to the `queue` field in the `gm4:log` storage. Here are a few examples: ```mcfunction -data modify storage gm4:log queue append value {type:"text",message:"We've been attempting to contant you about your cars extended warranty"} +data modify storage gm4:log queue append value {type:"text",message:'{"text":"We've been attempting to contact you about your car's extended warranty"}'} data modify storage gm4:log queue append value {type:"install",module:"Bat Grenades"} ``` From 1ef25bbf4b0976e38fbc8f2b99f13ce35efeceb4 Mon Sep 17 00:00:00 2001 From: Misode Date: Fri, 11 Oct 2024 17:42:15 +0200 Subject: [PATCH 3/4] Add mcdoc for metallurgy custom_data --- gm4_metallurgy/mod.mcdoc | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 gm4_metallurgy/mod.mcdoc diff --git a/gm4_metallurgy/mod.mcdoc b/gm4_metallurgy/mod.mcdoc new file mode 100644 index 0000000000..6d1664f32d --- /dev/null +++ b/gm4_metallurgy/mod.mcdoc @@ -0,0 +1,18 @@ +dispatch mcdoc:custom_data[gm4_metallurgy] to struct CustomData { + has_shamir?: 1b, + ore_in_animation?: 1b, + active_shamir?: string, + stored_shamir?: string, + ore_type?: MetalType, + custom_model_data?: int, + item?: ItemType, + metal?: struct { + type: MetalType, + amount?: [short], + castable?: 1b, + }, +} + +type ItemType = ("ore" | "obsidian_cast") + +type MetalType = ("aluminium" | "barimium" | "barium" | "bismuth" | "copper" | "curies_bismium" | "thorium_brass" | "thorium") From 25756199be90806b392f1a6f65330b35a6a94a63 Mon Sep 17 00:00:00 2001 From: Misode Date: Fri, 11 Oct 2024 19:20:03 +0200 Subject: [PATCH 4/4] Add guidebook custom resource --- gm4_guidebook/mod.mcdoc | 47 +++++++++++++++++++++++++++++++++++++++++ spyglass.json | 5 +++++ 2 files changed, 52 insertions(+) create mode 100644 gm4_guidebook/mod.mcdoc diff --git a/gm4_guidebook/mod.mcdoc b/gm4_guidebook/mod.mcdoc new file mode 100644 index 0000000000..0a404dcfe8 --- /dev/null +++ b/gm4_guidebook/mod.mcdoc @@ -0,0 +1,47 @@ +use ::java::server::world::item::SingleItem +use ::java::data::advancement::AdvancementCriterion +use ::java::server::util::text::Text + +dispatch minecraft:resource[gm4_guidebook] to struct Book { + id: string, + name: string, + module_type: ("expansion" | "base" | "module"), + load_check?: string, + base_module?: string, + icon: SingleItem, + criteria: struct AdvancementCriteriaMap { + [string]: AdvancementCriterion, + }, + sections: [Section], + description?: string, + wiki_link?: string, +} + +struct Section { + name: string, + pages: [GuidebookText], + enable: [struct {[string]: (int | string)}], + requirements: [[string]], + prerequisites?: [string], + grants?: [string], +} + +type GuidebookText = ( + string | + [GuidebookTextObject] | + GuidebookTextObject | +) + +type GuidebookTextObject = ( + GuidebookInsert | + Text | +) + +struct GuidebookInsert { + insert: ("title" | "locked_text" | "locked_text_title" | "recipe"), + ...gm4_guidebook:insert[[insert]], +} + +dispatch gm4_guidebook:insert[recipe] to struct RecipeInsert { + recipe: string, +} diff --git a/spyglass.json b/spyglass.json index a8cb197d1c..0646ec55f0 100644 --- a/spyglass.json +++ b/spyglass.json @@ -14,6 +14,11 @@ "path": "./commands.json", "replace": false } + }, + "customResources": { + "guidebook": { + "category": "gm4_guidebook" + } } } }