From 389704a39caff5310f8b4cfb2a928c5129860d0c Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Sun, 23 Oct 2022 21:11:25 -0300 Subject: [PATCH] fix java validate --- src/java.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/java.ts b/src/java.ts index 962e0667..a4a28946 100644 --- a/src/java.ts +++ b/src/java.ts @@ -140,7 +140,7 @@ export async function serverConfig(platformOptions: bdsPlatformOptions = {id: "d return manegerConfigProprieties({ configPath: fileProperties, configManipulate: { - Gamemode: (fileConfig, value) => { + Gamemode: (fileConfig, value: string) => { if (!(["survival", "creative", "hardcore"]).includes(value)) throw new Error("Invalid gameode"); if (value === "hardcore") fileConfig = fileConfig.replace(/gamemode=(survival|creative)/, `gamemode=survial`).replace(/hardcore=(false|true)/, `hardcore=true`); else { @@ -150,7 +150,7 @@ export async function serverConfig(platformOptions: bdsPlatformOptions = {id: "d return fileConfig; }, Difficulty: { - validate: (value) => (["peaceful", "easy", "normal", "hard"]).includes(value), + validate: (value: string) => (["peaceful", "easy", "normal", "hard"]).includes(value), regexReplace: /difficulty=(peaceful|easy|normal|hard)/, valueFormat: "difficulty=%s" },