Skip to content
This repository has been archived by the owner on Dec 4, 2023. It is now read-only.

Commit

Permalink
fix java validate
Browse files Browse the repository at this point in the history
  • Loading branch information
Sirherobrine23 authored Oct 24, 2022
1 parent 2992633 commit 389704a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/java.ts
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ export async function serverConfig(platformOptions: bdsPlatformOptions = {id: "d
return manegerConfigProprieties<editConfig>({
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 {
Expand All @@ -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"
},
Expand Down

0 comments on commit 389704a

Please sign in to comment.