From b7279c9bd25f51c9a97b4ffdabbbd2356df47071 Mon Sep 17 00:00:00 2001 From: Xterionix Date: Fri, 6 Dec 2024 20:28:58 +0500 Subject: [PATCH] - /schedule command delay arg --- src/lib/data/vanilla/schedule.ts | 14 ++++++++++++++ src/lib/documentation/parameter-type.ts | 3 +++ src/lib/types/command/functions.ts | 3 ++- src/lib/types/parameter-type.ts | 2 ++ 4 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/lib/data/vanilla/schedule.ts b/src/lib/data/vanilla/schedule.ts index baf0aed..9f4ecb0 100644 --- a/src/lib/data/vanilla/schedule.ts +++ b/src/lib/data/vanilla/schedule.ts @@ -103,6 +103,20 @@ export const schedule: CommandInfo[] = [ { text: "delay", type: ParameterType.keyword, required: true }, { text: "add", type: ParameterType.keyword, required: true }, { text: "function", type: ParameterType.function, required: true }, + { text: "time", type: ParameterType.timeInTicks, required: true }, + { text: "append", type: ParameterType.keyword, required: false }, + ], + }, + { + name: "schedule", + documentation: "Schedules an action to be executed once an area is loaded, or after a certain amount of time", + parameters: [ + { text: "schedule", type: ParameterType.keyword, required: true }, + { text: "delay", type: ParameterType.keyword, required: true }, + { text: "add", type: ParameterType.keyword, required: true }, + { text: "function", type: ParameterType.function, required: true }, + { text: "time", type: ParameterType.timeInTicks, required: true }, + { text: "replace", type: ParameterType.keyword, required: false }, ], }, ]; \ No newline at end of file diff --git a/src/lib/documentation/parameter-type.ts b/src/lib/documentation/parameter-type.ts index 4407801..cc7818b 100644 --- a/src/lib/documentation/parameter-type.ts +++ b/src/lib/documentation/parameter-type.ts @@ -221,6 +221,9 @@ The identifier of a ticking area.`, [ParameterType.time]: `## Time A value representing the time of the game.`, + [ParameterType.timeInTicks]: `## Time in ticks +A value representing the time of the game (20D, 3S, 15T, 4).`, + //[ParameterType.unknown]:``, [ParameterType.xp]: `## XP diff --git a/src/lib/types/command/functions.ts b/src/lib/types/command/functions.ts index 30f1f8a..4fe16dc 100644 --- a/src/lib/types/command/functions.ts +++ b/src/lib/types/command/functions.ts @@ -127,7 +127,8 @@ const Matches: Partial boolean>> = { [ParameterType.structureAnimationMode]: (item) => Modes.StructureAnimation.isValue(item), [ParameterType.teleportRules]: (item) => Modes.TeleportRules.isValue(item), [ParameterType.time]: (item) => Modes.Time.isValue(item), - [ParameterType.xp]: (item) => Minecraft.XP.is(item), + [ParameterType.timeInTicks]: (item) => Modes.Time.isValue(item), + [ParameterType.xp]: (item) => Minecraft.timeInTicks.is(item), }; export function checkRequiredParameterLength(command: Command, data: CommandInfo): boolean { diff --git a/src/lib/types/parameter-type.ts b/src/lib/types/parameter-type.ts index 042edd4..ef7c64f 100644 --- a/src/lib/types/parameter-type.ts +++ b/src/lib/types/parameter-type.ts @@ -116,6 +116,8 @@ export enum ParameterType { tickingarea, /** Time mode */ time, + /** Time in ticks */ + timeInTicks, /** Unknown */ unknown, /** XP */