diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..1dcef2d --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +node_modules +.env \ No newline at end of file diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..a263413 --- /dev/null +++ b/.npmignore @@ -0,0 +1,8 @@ +*/__tests__/ +docs/ +src/ +metadata/ +.vscode/ +.github/ +.env +tsconfig.json \ No newline at end of file diff --git a/README.md b/README.md index e4e1778..bf1d982 100644 --- a/README.md +++ b/README.md @@ -1 +1,123 @@ -# ForgeMinecraft \ No newline at end of file +
+ +ForgeMinecraft + +# ForgeMinecraft + +ForgeMinecraft is an extension that provides real-time Minecraft server management via the management server protocol, alongside various functions for retrieving status and metadata from Java and Bedrock servers. + +@tryforge/forge.minecraft +@tryforge/forgescript +Discord + +
+ +--- + +## Contents + +1. [Installation](#installation) +2. [Management Server](#management-server) +3. [Java & Bedrock Servers](#java--bedrock-servers) +4. [Documentation](https://docs.botforge.org/p/ForgeMinecraft/) + +

Installation


+ +1. Run the following command to install the required `npm` packages: + + ```bash + npm i @tryforge/forge.minecraft + ``` + +2. Here’s an example of how your main file should look: + + ```js + const { ForgeClient } = require("@tryforge/forgescript") + const { ForgeMinecraft } = require("@tryforge/forge.minecraft") + + const minecraft = new ForgeMinecraft({ + java: { + host: "0.0.0.0", // Default Java Server + port: 25565 + }, + bedrock: { + host: "0.0.0.0" // Default Bedrock Server + } + }) + + const client = new ForgeClient({ + ...options, // The options you currently have + extensions: [ + minecraft + ] + }) + + client.commands.load("commands") + + client.login("YourToken") + ``` + + > 💡 **Tip**\ + > View all available client options [**here**](https://tryforge.github.io/ForgeMinecraft/interfaces/IForgeMinecraftOptions.html). + +

Management Server


+ +Minecraft’s management server protocol, introduced in **1.21.9**, enables remote management and monitoring of your Minecraft server. It allows this extension to connect to the server, execute administrative actions, and receive real-time events such as player activity, server status changes, and configuration updates, making automation and server control easier. + +#### Setting up the Minecraft Server + +To enable the management server protocol, set up `management-server-enabled`, `management-server-port` and `management-server-host` in the **server.properties** file of your Minecraft server: + +```properties +management-server-enabled=true +management-server-port=25585 +management-server-host=0.0.0.0 +management-server-secret= +``` + +You can either set `management-server-secret` to a random 40 character long alphanumeric string or leave it empty and let the Minecraft server generate a random token on startup. You will need this token to connect to the server. + +If you want to establish connections from a web browser, you need to set the allowed origins: + +```properties +management-server-allowed-origins=http\://localhost\:63315 +``` + +#### TLS + +By default, TLS is enabled, but the server will crash if you don't provide a certificate. If the management server protocol is not exposed to the internet, or you are using a reverse proxy, the easiest option would be to disable TLS: + +```properties +management-server-tls-enabled=false +``` + +#### Setting up Client Configurations + +Next, configure the **ForgeMinecraft** client. This is where you specify which server `events` you want to listen to and provide the management server connection details, such as `host`, `port`, and authentication `token` (secret). These options determine how ForgeMinecraft connects to your server and which real-time events the extension receives. + +```js +const minecraft = new ForgeMinecraft({ + events: [ + "playerJoined", + "serverStarted" + ], + server: { + host: "0.0.0.0", + port: 3000, + token: "YourAuthToken", + } +}) + +// ... + +minecraft.commands.load("minecraft") // Load your server events folder + +// ... +``` + +> 💡 **Tip**\ +> View all available server options [**here**](https://tryforge.github.io/ForgeMinecraft/interfaces/IManagementServerOptions.html). + +

Java & Bedrock Servers


+ +Desired Java and Bedrock functions let you fetch status and metadata from Minecraft servers on demand. You can call these functions with custom `host` and `port` arguments, or define [default Java and Bedrock server settings in the client configuration](#installation) to avoid passing arguments each time. The responses include various details such as server status, version, players, and more. Note that availability depends on the server, as not all servers allow full information to be queried. \ No newline at end of file diff --git a/assets/ForgeMinecraft.png b/assets/ForgeMinecraft.png new file mode 100644 index 0000000..ec69ed9 Binary files /dev/null and b/assets/ForgeMinecraft.png differ diff --git a/dist/commit.d.ts b/dist/commit.d.ts new file mode 100644 index 0000000..475178d --- /dev/null +++ b/dist/commit.d.ts @@ -0,0 +1,2 @@ +export declare function prompt(q: string): Promise; +//# sourceMappingURL=commit.d.ts.map \ No newline at end of file diff --git a/dist/commit.d.ts.map b/dist/commit.d.ts.map new file mode 100644 index 0000000..f569db8 --- /dev/null +++ b/dist/commit.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"commit.d.ts","sourceRoot":"","sources":["../src/commit.ts"],"names":[],"mappings":"AAYA,wBAAsB,MAAM,CAAC,CAAC,EAAE,MAAM,mBAQrC"} \ No newline at end of file diff --git a/dist/commit.js b/dist/commit.js new file mode 100644 index 0000000..cd67532 --- /dev/null +++ b/dist/commit.js @@ -0,0 +1,60 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.prompt = prompt; +const child_process_1 = require("child_process"); +const fs_1 = require("fs"); +const process_1 = require("process"); +const readline_1 = require("readline"); +const path_1 = require("path"); +const os_1 = require("os"); +const path = "./metadata"; +if (!(0, fs_1.existsSync)(path)) + (0, fs_1.mkdirSync)(path); +const version = require("../package.json").version; +async function prompt(q) { + const itf = (0, readline_1.createInterface)(process_1.stdin, process_1.stdout); + return new Promise(r => { + itf.question(q, input => { + itf.close(); + r(input); + }); + }); +} +async function main() { + let skip = false; + const msg = (await prompt("Please write the commit message: ")).replace(/(--?(\w+))/gim, (match) => { + const name = /(\w+)/.exec(match)[1].toLowerCase(); + switch (name) { + case "hide": { + skip = true; + break; + } + default: { + throw new Error(`--${name} is not a valid flag.`); + } + } + return ""; + }).trim(); + const fileName = (0, path_1.join)(path, "changelogs.json"); + const json = (0, fs_1.existsSync)(fileName) ? JSON.parse((0, fs_1.readFileSync)(fileName, "utf-8")) : {}; + json[version] ??= []; + const author = (0, child_process_1.execSync)("git config user.name").toString().trim(); + if (!skip) { + json[version].unshift({ + message: msg, + timestamp: new Date(), + author + }); + (0, fs_1.writeFileSync)(fileName, JSON.stringify(json), "utf-8"); + } + const branch = await prompt("Write the branch name to push to (defaults to dev): ") || "dev"; + let escapedMsg = msg; + if ((0, os_1.platform)() === "darwin") + escapedMsg = escapedMsg.replace(/\$/g, "\\$"); + (0, child_process_1.execSync)("git branch -M " + branch + " && git add . && git commit -m \"" + escapedMsg + "\" && git push -u origin " + branch, { + stdio: "inherit" + }); +} +// Nothing +main(); +//# sourceMappingURL=commit.js.map \ No newline at end of file diff --git a/dist/commit.js.map b/dist/commit.js.map new file mode 100644 index 0000000..fce6415 --- /dev/null +++ b/dist/commit.js.map @@ -0,0 +1 @@ +{"version":3,"file":"commit.js","sourceRoot":"","sources":["../src/commit.ts"],"names":[],"mappings":";;AAYA,wBAQC;AApBD,iDAAwC;AACxC,2BAAuE;AACvE,qCAAuC;AACvC,uCAA0C;AAC1C,+BAA2B;AAC3B,2BAA6B;AAE7B,MAAM,IAAI,GAAG,YAAY,CAAA;AACzB,IAAI,CAAC,IAAA,eAAU,EAAC,IAAI,CAAC;IAAE,IAAA,cAAS,EAAC,IAAI,CAAC,CAAA;AAEtC,MAAM,OAAO,GAAG,OAAO,CAAC,iBAAiB,CAAC,CAAC,OAAO,CAAA;AAE3C,KAAK,UAAU,MAAM,CAAC,CAAS;IAClC,MAAM,GAAG,GAAG,IAAA,0BAAe,EAAC,eAAK,EAAE,gBAAM,CAAC,CAAA;IAC1C,OAAO,IAAI,OAAO,CAAS,CAAC,CAAC,EAAE;QAC3B,GAAG,CAAC,QAAQ,CAAC,CAAC,EAAE,KAAK,CAAC,EAAE;YACpB,GAAG,CAAC,KAAK,EAAE,CAAA;YACX,CAAC,CAAC,KAAK,CAAC,CAAA;QACZ,CAAC,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;AACN,CAAC;AAED,KAAK,UAAU,IAAI;IACf,IAAI,IAAI,GAAG,KAAK,CAAA;IAEhB,MAAM,GAAG,GAAG,CAAC,MAAM,MAAM,CAAC,mCAAmC,CAAC,CAAC,CAAC,OAAO,CACnE,eAAe,EAAE,CAAC,KAAK,EAAE,EAAE;QACvB,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC,KAAK,CAAE,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,CAAA;QAElD,QAAQ,IAAI,EAAE,CAAC;YACX,KAAK,MAAM,CAAC,CAAC,CAAC;gBACV,IAAI,GAAG,IAAI,CAAA;gBACX,MAAK;YACT,CAAC;YAED,OAAO,CAAC,CAAC,CAAC;gBACN,MAAM,IAAI,KAAK,CAAC,KAAK,IAAI,uBAAuB,CAAC,CAAA;YACrD,CAAC;QACL,CAAC;QAED,OAAO,EAAE,CAAA;IACb,CAAC,CACJ,CAAC,IAAI,EAAE,CAAA;IAER,MAAM,QAAQ,GAAG,IAAA,WAAI,EAAC,IAAI,EAAE,iBAAiB,CAAC,CAAA;IAC9C,MAAM,IAAI,GAA6B,IAAA,eAAU,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,IAAA,iBAAY,EAAC,QAAQ,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAA;IAC9G,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAA;IACpB,MAAM,MAAM,GAAG,IAAA,wBAAQ,EAAC,sBAAsB,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAA;IACjE,IAAI,CAAC,IAAI,EAAE,CAAC;QACR,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;YAClB,OAAO,EAAE,GAAG;YACZ,SAAS,EAAE,IAAI,IAAI,EAAE;YACrB,MAAM;SACT,CAAC,CAAA;QACF,IAAA,kBAAa,EAAC,QAAQ,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,OAAO,CAAC,CAAA;IAC1D,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC,sDAAsD,CAAC,IAAI,KAAK,CAAA;IAC5F,IAAI,UAAU,GAAG,GAAG,CAAA;IACpB,IAAI,IAAA,aAAQ,GAAE,KAAK,QAAQ;QAAE,UAAU,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,CAAA;IAE1E,IAAA,wBAAQ,EAAC,gBAAgB,GAAG,MAAM,GAAG,mCAAmC,GAAG,UAAU,GAAG,2BAA2B,GAAG,MAAM,EAAE;QAC1H,KAAK,EAAE,SAAS;KACnB,CAAC,CAAA;AACN,CAAC;AAED,UAAU;AACV,IAAI,EAAE,CAAA"} \ No newline at end of file diff --git a/dist/constants.d.ts b/dist/constants.d.ts new file mode 100644 index 0000000..2d0e987 --- /dev/null +++ b/dist/constants.d.ts @@ -0,0 +1,2 @@ +export declare const ForgeMinecraftEventHandlerName = "ForgeMinecraftEvents"; +//# sourceMappingURL=constants.d.ts.map \ No newline at end of file diff --git a/dist/constants.d.ts.map b/dist/constants.d.ts.map new file mode 100644 index 0000000..99cc7bf --- /dev/null +++ b/dist/constants.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,8BAA8B,yBAAyB,CAAA"} \ No newline at end of file diff --git a/dist/constants.js b/dist/constants.js new file mode 100644 index 0000000..8f466aa --- /dev/null +++ b/dist/constants.js @@ -0,0 +1,5 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ForgeMinecraftEventHandlerName = void 0; +exports.ForgeMinecraftEventHandlerName = "ForgeMinecraftEvents"; +//# sourceMappingURL=constants.js.map \ No newline at end of file diff --git a/dist/constants.js.map b/dist/constants.js.map new file mode 100644 index 0000000..483a35c --- /dev/null +++ b/dist/constants.js.map @@ -0,0 +1 @@ +{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,8BAA8B,GAAG,sBAAsB,CAAA"} \ No newline at end of file diff --git a/dist/docgen.d.ts b/dist/docgen.d.ts new file mode 100644 index 0000000..1728a83 --- /dev/null +++ b/dist/docgen.d.ts @@ -0,0 +1,2 @@ +export {}; +//# sourceMappingURL=docgen.d.ts.map \ No newline at end of file diff --git a/dist/docgen.d.ts.map b/dist/docgen.d.ts.map new file mode 100644 index 0000000..5468df5 --- /dev/null +++ b/dist/docgen.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"docgen.d.ts","sourceRoot":"","sources":["../src/docgen.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/docgen.js b/dist/docgen.js new file mode 100644 index 0000000..25f6283 --- /dev/null +++ b/dist/docgen.js @@ -0,0 +1,6 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const constants_1 = require("./constants"); +(0, forgescript_1.generateMetadata)(`${__dirname}/native`, "native", constants_1.ForgeMinecraftEventHandlerName, undefined, undefined, `${__dirname}/events`); +//# sourceMappingURL=docgen.js.map \ No newline at end of file diff --git a/dist/docgen.js.map b/dist/docgen.js.map new file mode 100644 index 0000000..b7f9b0b --- /dev/null +++ b/dist/docgen.js.map @@ -0,0 +1 @@ +{"version":3,"file":"docgen.js","sourceRoot":"","sources":["../src/docgen.ts"],"names":[],"mappings":";;AAAA,uDAAwD;AACxD,2CAA4D;AAE5D,IAAA,8BAAgB,EACZ,GAAG,SAAS,SAAS,EACrB,QAAQ,EACR,0CAA8B,EAC9B,SAAS,EACT,SAAS,EACT,GAAG,SAAS,SAAS,CACxB,CAAA"} \ No newline at end of file diff --git a/dist/events/allowListAdded.d.ts b/dist/events/allowListAdded.d.ts new file mode 100644 index 0000000..608ded4 --- /dev/null +++ b/dist/events/allowListAdded.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"allowListAdded">; +export default _default; +//# sourceMappingURL=allowListAdded.d.ts.map \ No newline at end of file diff --git a/dist/events/allowListAdded.d.ts.map b/dist/events/allowListAdded.d.ts.map new file mode 100644 index 0000000..4d9654e --- /dev/null +++ b/dist/events/allowListAdded.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"allowListAdded.d.ts","sourceRoot":"","sources":["../../src/events/allowListAdded.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/allowListAdded.js b/dist/events/allowListAdded.js new file mode 100644 index 0000000..e6520af --- /dev/null +++ b/dist/events/allowListAdded.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "allowListAdded", + version: "1.0.0", + description: "This event is fired when a player was added to the allow list", + listener: async function (obj) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("allowListAdded"); + for (const command of commands) { + const ctx = new __1.Context({ + obj, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=allowListAdded.js.map \ No newline at end of file diff --git a/dist/events/allowListAdded.js.map b/dist/events/allowListAdded.js.map new file mode 100644 index 0000000..62d42e5 --- /dev/null +++ b/dist/events/allowListAdded.js.map @@ -0,0 +1 @@ +{"version":3,"file":"allowListAdded.js","sourceRoot":"","sources":["../../src/events/allowListAdded.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,+DAA+D;IAC5E,QAAQ,EAAE,KAAK,WAAU,GAAG;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;QAEvF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG;gBACH,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/allowListRemoved.d.ts b/dist/events/allowListRemoved.d.ts new file mode 100644 index 0000000..d7ed346 --- /dev/null +++ b/dist/events/allowListRemoved.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"allowListRemoved">; +export default _default; +//# sourceMappingURL=allowListRemoved.d.ts.map \ No newline at end of file diff --git a/dist/events/allowListRemoved.d.ts.map b/dist/events/allowListRemoved.d.ts.map new file mode 100644 index 0000000..ff6470a --- /dev/null +++ b/dist/events/allowListRemoved.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"allowListRemoved.d.ts","sourceRoot":"","sources":["../../src/events/allowListRemoved.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/allowListRemoved.js b/dist/events/allowListRemoved.js new file mode 100644 index 0000000..a81b701 --- /dev/null +++ b/dist/events/allowListRemoved.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "allowListRemoved", + version: "1.0.0", + description: "This event is fired when a player was removed from the allow list", + listener: async function (obj) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("allowListRemoved"); + for (const command of commands) { + const ctx = new __1.Context({ + obj, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=allowListRemoved.js.map \ No newline at end of file diff --git a/dist/events/allowListRemoved.js.map b/dist/events/allowListRemoved.js.map new file mode 100644 index 0000000..9230e7a --- /dev/null +++ b/dist/events/allowListRemoved.js.map @@ -0,0 +1 @@ +{"version":3,"file":"allowListRemoved.js","sourceRoot":"","sources":["../../src/events/allowListRemoved.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,mEAAmE;IAChF,QAAQ,EAAE,KAAK,WAAU,GAAG;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAA;QAEzF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG;gBACH,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/banAdded.d.ts b/dist/events/banAdded.d.ts new file mode 100644 index 0000000..8fe13ac --- /dev/null +++ b/dist/events/banAdded.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"banAdded">; +export default _default; +//# sourceMappingURL=banAdded.d.ts.map \ No newline at end of file diff --git a/dist/events/banAdded.d.ts.map b/dist/events/banAdded.d.ts.map new file mode 100644 index 0000000..63ba5e9 --- /dev/null +++ b/dist/events/banAdded.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"banAdded.d.ts","sourceRoot":"","sources":["../../src/events/banAdded.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/banAdded.js b/dist/events/banAdded.js new file mode 100644 index 0000000..27aa157 --- /dev/null +++ b/dist/events/banAdded.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "banAdded", + version: "1.0.0", + description: "This event is fired when a player was banned", + listener: async function (obj) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("banAdded"); + for (const command of commands) { + const ctx = new __1.Context({ + obj, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=banAdded.js.map \ No newline at end of file diff --git a/dist/events/banAdded.js.map b/dist/events/banAdded.js.map new file mode 100644 index 0000000..d9df793 --- /dev/null +++ b/dist/events/banAdded.js.map @@ -0,0 +1 @@ +{"version":3,"file":"banAdded.js","sourceRoot":"","sources":["../../src/events/banAdded.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,8CAA8C;IAC3D,QAAQ,EAAE,KAAK,WAAU,GAAG;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,UAAU,CAAC,CAAA;QAEjF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG;gBACH,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/banRemoved.d.ts b/dist/events/banRemoved.d.ts new file mode 100644 index 0000000..29aedcd --- /dev/null +++ b/dist/events/banRemoved.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"banRemoved">; +export default _default; +//# sourceMappingURL=banRemoved.d.ts.map \ No newline at end of file diff --git a/dist/events/banRemoved.d.ts.map b/dist/events/banRemoved.d.ts.map new file mode 100644 index 0000000..a278a13 --- /dev/null +++ b/dist/events/banRemoved.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"banRemoved.d.ts","sourceRoot":"","sources":["../../src/events/banRemoved.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/banRemoved.js b/dist/events/banRemoved.js new file mode 100644 index 0000000..1fb71ca --- /dev/null +++ b/dist/events/banRemoved.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "banRemoved", + version: "1.0.0", + description: "This event is fired when a player was unbanned", + listener: async function (obj) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("banRemoved"); + for (const command of commands) { + const ctx = new __1.Context({ + obj, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=banRemoved.js.map \ No newline at end of file diff --git a/dist/events/banRemoved.js.map b/dist/events/banRemoved.js.map new file mode 100644 index 0000000..aeb8829 --- /dev/null +++ b/dist/events/banRemoved.js.map @@ -0,0 +1 @@ +{"version":3,"file":"banRemoved.js","sourceRoot":"","sources":["../../src/events/banRemoved.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gDAAgD;IAC7D,QAAQ,EAAE,KAAK,WAAU,GAAG;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QAEnF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG;gBACH,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/connected.d.ts b/dist/events/connected.d.ts new file mode 100644 index 0000000..79d62ae --- /dev/null +++ b/dist/events/connected.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"connected">; +export default _default; +//# sourceMappingURL=connected.d.ts.map \ No newline at end of file diff --git a/dist/events/connected.d.ts.map b/dist/events/connected.d.ts.map new file mode 100644 index 0000000..ed30260 --- /dev/null +++ b/dist/events/connected.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"connected.d.ts","sourceRoot":"","sources":["../../src/events/connected.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/connected.js b/dist/events/connected.js new file mode 100644 index 0000000..7b426b2 --- /dev/null +++ b/dist/events/connected.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "connected", + version: "1.0.0", + description: "This event is fired when the management server has connected", + listener: async function () { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("connected"); + for (const command of commands) { + const ctx = new __1.Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=connected.js.map \ No newline at end of file diff --git a/dist/events/connected.js.map b/dist/events/connected.js.map new file mode 100644 index 0000000..c022f9d --- /dev/null +++ b/dist/events/connected.js.map @@ -0,0 +1 @@ +{"version":3,"file":"connected.js","sourceRoot":"","sources":["../../src/events/connected.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,8DAA8D;IAC3E,QAAQ,EAAE,KAAK;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,WAAW,CAAC,CAAA;QAElF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG,EAAE,EAAE;gBACP,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/disconnected.d.ts b/dist/events/disconnected.d.ts new file mode 100644 index 0000000..867278f --- /dev/null +++ b/dist/events/disconnected.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"disconnected">; +export default _default; +//# sourceMappingURL=disconnected.d.ts.map \ No newline at end of file diff --git a/dist/events/disconnected.d.ts.map b/dist/events/disconnected.d.ts.map new file mode 100644 index 0000000..0ed88f3 --- /dev/null +++ b/dist/events/disconnected.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"disconnected.d.ts","sourceRoot":"","sources":["../../src/events/disconnected.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/disconnected.js b/dist/events/disconnected.js new file mode 100644 index 0000000..5056604 --- /dev/null +++ b/dist/events/disconnected.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "disconnected", + version: "1.0.0", + description: "This event is fired when the management server has disconnected", + listener: async function () { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("disconnected"); + for (const command of commands) { + const ctx = new __1.Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=disconnected.js.map \ No newline at end of file diff --git a/dist/events/disconnected.js.map b/dist/events/disconnected.js.map new file mode 100644 index 0000000..d59561f --- /dev/null +++ b/dist/events/disconnected.js.map @@ -0,0 +1 @@ +{"version":3,"file":"disconnected.js","sourceRoot":"","sources":["../../src/events/disconnected.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,iEAAiE;IAC9E,QAAQ,EAAE,KAAK;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;QAErF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG,EAAE,EAAE;gBACP,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/error.d.ts b/dist/events/error.d.ts new file mode 100644 index 0000000..7c303d7 --- /dev/null +++ b/dist/events/error.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"error">; +export default _default; +//# sourceMappingURL=error.d.ts.map \ No newline at end of file diff --git a/dist/events/error.d.ts.map b/dist/events/error.d.ts.map new file mode 100644 index 0000000..5938f42 --- /dev/null +++ b/dist/events/error.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"error.d.ts","sourceRoot":"","sources":["../../src/events/error.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAmBE"} \ No newline at end of file diff --git a/dist/events/error.js b/dist/events/error.js new file mode 100644 index 0000000..e33a2c4 --- /dev/null +++ b/dist/events/error.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "error", + version: "1.0.0", + description: "This event is fired when an error occurred", + listener: async function (err) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("error"); + for (const command of commands) { + const ctx = new __1.Context({ + obj: {}, + command, + client: this, + extras: err.message, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=error.js.map \ No newline at end of file diff --git a/dist/events/error.js.map b/dist/events/error.js.map new file mode 100644 index 0000000..3a020f4 --- /dev/null +++ b/dist/events/error.js.map @@ -0,0 +1 @@ +{"version":3,"file":"error.js","sourceRoot":"","sources":["../../src/events/error.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,OAAO;IACb,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,4CAA4C;IACzD,QAAQ,EAAE,KAAK,WAAU,GAAG;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,OAAO,CAAC,CAAA;QAE9E,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG,EAAE,EAAE;gBACP,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,MAAM,EAAE,GAAG,CAAC,OAAO;gBACnB,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/gameRuleUpdated.d.ts b/dist/events/gameRuleUpdated.d.ts new file mode 100644 index 0000000..d3fd121 --- /dev/null +++ b/dist/events/gameRuleUpdated.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"gameRuleUpdated">; +export default _default; +//# sourceMappingURL=gameRuleUpdated.d.ts.map \ No newline at end of file diff --git a/dist/events/gameRuleUpdated.d.ts.map b/dist/events/gameRuleUpdated.d.ts.map new file mode 100644 index 0000000..1fda482 --- /dev/null +++ b/dist/events/gameRuleUpdated.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gameRuleUpdated.d.ts","sourceRoot":"","sources":["../../src/events/gameRuleUpdated.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/gameRuleUpdated.js b/dist/events/gameRuleUpdated.js new file mode 100644 index 0000000..81c0781 --- /dev/null +++ b/dist/events/gameRuleUpdated.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "gameRuleUpdated", + version: "1.0.0", + description: "This event is fired when a game rule was updated", + listener: async function (obj) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("gameRuleUpdated"); + for (const command of commands) { + const ctx = new __1.Context({ + obj, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=gameRuleUpdated.js.map \ No newline at end of file diff --git a/dist/events/gameRuleUpdated.js.map b/dist/events/gameRuleUpdated.js.map new file mode 100644 index 0000000..f301bd3 --- /dev/null +++ b/dist/events/gameRuleUpdated.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gameRuleUpdated.js","sourceRoot":"","sources":["../../src/events/gameRuleUpdated.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,kDAAkD;IAC/D,QAAQ,EAAE,KAAK,WAAU,GAAG;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;QAExF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG;gBACH,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/ipBanAdded.d.ts b/dist/events/ipBanAdded.d.ts new file mode 100644 index 0000000..085df86 --- /dev/null +++ b/dist/events/ipBanAdded.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"ipBanAdded">; +export default _default; +//# sourceMappingURL=ipBanAdded.d.ts.map \ No newline at end of file diff --git a/dist/events/ipBanAdded.d.ts.map b/dist/events/ipBanAdded.d.ts.map new file mode 100644 index 0000000..861123c --- /dev/null +++ b/dist/events/ipBanAdded.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ipBanAdded.d.ts","sourceRoot":"","sources":["../../src/events/ipBanAdded.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/ipBanAdded.js b/dist/events/ipBanAdded.js new file mode 100644 index 0000000..1c57909 --- /dev/null +++ b/dist/events/ipBanAdded.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "ipBanAdded", + version: "1.0.0", + description: "This event is fired when an IP was banned", + listener: async function (obj) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("ipBanAdded"); + for (const command of commands) { + const ctx = new __1.Context({ + obj, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=ipBanAdded.js.map \ No newline at end of file diff --git a/dist/events/ipBanAdded.js.map b/dist/events/ipBanAdded.js.map new file mode 100644 index 0000000..4847db5 --- /dev/null +++ b/dist/events/ipBanAdded.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ipBanAdded.js","sourceRoot":"","sources":["../../src/events/ipBanAdded.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,2CAA2C;IACxD,QAAQ,EAAE,KAAK,WAAU,GAAG;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QAEnF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG;gBACH,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/ipBanRemoved.d.ts b/dist/events/ipBanRemoved.d.ts new file mode 100644 index 0000000..64f5383 --- /dev/null +++ b/dist/events/ipBanRemoved.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"ipBanRemoved">; +export default _default; +//# sourceMappingURL=ipBanRemoved.d.ts.map \ No newline at end of file diff --git a/dist/events/ipBanRemoved.d.ts.map b/dist/events/ipBanRemoved.d.ts.map new file mode 100644 index 0000000..f0ac44e --- /dev/null +++ b/dist/events/ipBanRemoved.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ipBanRemoved.d.ts","sourceRoot":"","sources":["../../src/events/ipBanRemoved.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAInD,wBAmBE"} \ No newline at end of file diff --git a/dist/events/ipBanRemoved.js b/dist/events/ipBanRemoved.js new file mode 100644 index 0000000..bb85d39 --- /dev/null +++ b/dist/events/ipBanRemoved.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +const mc_server_management_1 = require("mc-server-management"); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "ipBanRemoved", + version: "1.0.0", + description: "This event is fired when an IP was unbanned", + listener: async function (ip) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("ipBanRemoved"); + const ban = new mc_server_management_1.IPBan(ip); + for (const command of commands) { + const ctx = new __1.Context({ + obj: ban, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=ipBanRemoved.js.map \ No newline at end of file diff --git a/dist/events/ipBanRemoved.js.map b/dist/events/ipBanRemoved.js.map new file mode 100644 index 0000000..589678a --- /dev/null +++ b/dist/events/ipBanRemoved.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ipBanRemoved.js","sourceRoot":"","sources":["../../src/events/ipBanRemoved.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAC5C,+DAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,6CAA6C;IAC1D,QAAQ,EAAE,KAAK,WAAU,EAAE;QACvB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;QACrF,MAAM,GAAG,GAAG,IAAI,4BAAK,CAAC,EAAE,CAAC,CAAA;QAEzB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG,EAAE,GAAG;gBACR,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/operatorAdded.d.ts b/dist/events/operatorAdded.d.ts new file mode 100644 index 0000000..c900e2f --- /dev/null +++ b/dist/events/operatorAdded.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"operatorAdded">; +export default _default; +//# sourceMappingURL=operatorAdded.d.ts.map \ No newline at end of file diff --git a/dist/events/operatorAdded.d.ts.map b/dist/events/operatorAdded.d.ts.map new file mode 100644 index 0000000..baaaee4 --- /dev/null +++ b/dist/events/operatorAdded.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"operatorAdded.d.ts","sourceRoot":"","sources":["../../src/events/operatorAdded.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/operatorAdded.js b/dist/events/operatorAdded.js new file mode 100644 index 0000000..f6aafa3 --- /dev/null +++ b/dist/events/operatorAdded.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "operatorAdded", + version: "1.0.0", + description: "This event is fired when an operator was added", + listener: async function (obj) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("operatorAdded"); + for (const command of commands) { + const ctx = new __1.Context({ + obj, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=operatorAdded.js.map \ No newline at end of file diff --git a/dist/events/operatorAdded.js.map b/dist/events/operatorAdded.js.map new file mode 100644 index 0000000..940aaf7 --- /dev/null +++ b/dist/events/operatorAdded.js.map @@ -0,0 +1 @@ +{"version":3,"file":"operatorAdded.js","sourceRoot":"","sources":["../../src/events/operatorAdded.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gDAAgD;IAC7D,QAAQ,EAAE,KAAK,WAAU,GAAG;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;QAEtF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG;gBACH,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/operatorRemoved.d.ts b/dist/events/operatorRemoved.d.ts new file mode 100644 index 0000000..012b08c --- /dev/null +++ b/dist/events/operatorRemoved.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"operatorRemoved">; +export default _default; +//# sourceMappingURL=operatorRemoved.d.ts.map \ No newline at end of file diff --git a/dist/events/operatorRemoved.d.ts.map b/dist/events/operatorRemoved.d.ts.map new file mode 100644 index 0000000..dbcde36 --- /dev/null +++ b/dist/events/operatorRemoved.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"operatorRemoved.d.ts","sourceRoot":"","sources":["../../src/events/operatorRemoved.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/operatorRemoved.js b/dist/events/operatorRemoved.js new file mode 100644 index 0000000..87c82e7 --- /dev/null +++ b/dist/events/operatorRemoved.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "operatorRemoved", + version: "1.0.0", + description: "This event is fired when an operator was removed", + listener: async function (obj) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("operatorRemoved"); + for (const command of commands) { + const ctx = new __1.Context({ + obj, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=operatorRemoved.js.map \ No newline at end of file diff --git a/dist/events/operatorRemoved.js.map b/dist/events/operatorRemoved.js.map new file mode 100644 index 0000000..c3323e1 --- /dev/null +++ b/dist/events/operatorRemoved.js.map @@ -0,0 +1 @@ +{"version":3,"file":"operatorRemoved.js","sourceRoot":"","sources":["../../src/events/operatorRemoved.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,kDAAkD;IAC/D,QAAQ,EAAE,KAAK,WAAU,GAAG;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;QAExF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG;gBACH,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/playerJoined.d.ts b/dist/events/playerJoined.d.ts new file mode 100644 index 0000000..1bc866f --- /dev/null +++ b/dist/events/playerJoined.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"playerJoined">; +export default _default; +//# sourceMappingURL=playerJoined.d.ts.map \ No newline at end of file diff --git a/dist/events/playerJoined.d.ts.map b/dist/events/playerJoined.d.ts.map new file mode 100644 index 0000000..191684f --- /dev/null +++ b/dist/events/playerJoined.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"playerJoined.d.ts","sourceRoot":"","sources":["../../src/events/playerJoined.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/playerJoined.js b/dist/events/playerJoined.js new file mode 100644 index 0000000..b8795c6 --- /dev/null +++ b/dist/events/playerJoined.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "playerJoined", + version: "1.0.0", + description: "This event is fired when a player has joined the server", + listener: async function (obj) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("playerJoined"); + for (const command of commands) { + const ctx = new __1.Context({ + obj, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=playerJoined.js.map \ No newline at end of file diff --git a/dist/events/playerJoined.js.map b/dist/events/playerJoined.js.map new file mode 100644 index 0000000..52adef1 --- /dev/null +++ b/dist/events/playerJoined.js.map @@ -0,0 +1 @@ +{"version":3,"file":"playerJoined.js","sourceRoot":"","sources":["../../src/events/playerJoined.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,yDAAyD;IACtE,QAAQ,EAAE,KAAK,WAAU,GAAG;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;QAErF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG;gBACH,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/playerLeft.d.ts b/dist/events/playerLeft.d.ts new file mode 100644 index 0000000..51f3ee7 --- /dev/null +++ b/dist/events/playerLeft.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"playerLeft">; +export default _default; +//# sourceMappingURL=playerLeft.d.ts.map \ No newline at end of file diff --git a/dist/events/playerLeft.d.ts.map b/dist/events/playerLeft.d.ts.map new file mode 100644 index 0000000..4688656 --- /dev/null +++ b/dist/events/playerLeft.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"playerLeft.d.ts","sourceRoot":"","sources":["../../src/events/playerLeft.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/playerLeft.js b/dist/events/playerLeft.js new file mode 100644 index 0000000..4dd80d4 --- /dev/null +++ b/dist/events/playerLeft.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "playerLeft", + version: "1.0.0", + description: "This event is fired when a player has left the server", + listener: async function (obj) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("playerLeft"); + for (const command of commands) { + const ctx = new __1.Context({ + obj, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=playerLeft.js.map \ No newline at end of file diff --git a/dist/events/playerLeft.js.map b/dist/events/playerLeft.js.map new file mode 100644 index 0000000..947bc55 --- /dev/null +++ b/dist/events/playerLeft.js.map @@ -0,0 +1 @@ +{"version":3,"file":"playerLeft.js","sourceRoot":"","sources":["../../src/events/playerLeft.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,uDAAuD;IACpE,QAAQ,EAAE,KAAK,WAAU,GAAG;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,YAAY,CAAC,CAAA;QAEnF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG;gBACH,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/reconnecting.d.ts b/dist/events/reconnecting.d.ts new file mode 100644 index 0000000..d92c68e --- /dev/null +++ b/dist/events/reconnecting.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"reconnecting">; +export default _default; +//# sourceMappingURL=reconnecting.d.ts.map \ No newline at end of file diff --git a/dist/events/reconnecting.d.ts.map b/dist/events/reconnecting.d.ts.map new file mode 100644 index 0000000..f1475c5 --- /dev/null +++ b/dist/events/reconnecting.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"reconnecting.d.ts","sourceRoot":"","sources":["../../src/events/reconnecting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/reconnecting.js b/dist/events/reconnecting.js new file mode 100644 index 0000000..20cb930 --- /dev/null +++ b/dist/events/reconnecting.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "reconnecting", + version: "1.0.0", + description: "This event is fired when the management server is reconnecting", + listener: async function () { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("reconnecting"); + for (const command of commands) { + const ctx = new __1.Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=reconnecting.js.map \ No newline at end of file diff --git a/dist/events/reconnecting.js.map b/dist/events/reconnecting.js.map new file mode 100644 index 0000000..636bb93 --- /dev/null +++ b/dist/events/reconnecting.js.map @@ -0,0 +1 @@ +{"version":3,"file":"reconnecting.js","sourceRoot":"","sources":["../../src/events/reconnecting.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gEAAgE;IAC7E,QAAQ,EAAE,KAAK;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;QAErF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG,EAAE,EAAE;gBACP,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/serverActivity.d.ts b/dist/events/serverActivity.d.ts new file mode 100644 index 0000000..c48f928 --- /dev/null +++ b/dist/events/serverActivity.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"serverActivity">; +export default _default; +//# sourceMappingURL=serverActivity.d.ts.map \ No newline at end of file diff --git a/dist/events/serverActivity.d.ts.map b/dist/events/serverActivity.d.ts.map new file mode 100644 index 0000000..31ac10c --- /dev/null +++ b/dist/events/serverActivity.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverActivity.d.ts","sourceRoot":"","sources":["../../src/events/serverActivity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/serverActivity.js b/dist/events/serverActivity.js new file mode 100644 index 0000000..c559725 --- /dev/null +++ b/dist/events/serverActivity.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "serverActivity", + version: "1.0.0", + description: "This event is fired when a network connection to the server has been initiated", + listener: async function () { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("serverActivity"); + for (const command of commands) { + const ctx = new __1.Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=serverActivity.js.map \ No newline at end of file diff --git a/dist/events/serverActivity.js.map b/dist/events/serverActivity.js.map new file mode 100644 index 0000000..fb9cee1 --- /dev/null +++ b/dist/events/serverActivity.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverActivity.js","sourceRoot":"","sources":["../../src/events/serverActivity.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gFAAgF;IAC7F,QAAQ,EAAE,KAAK;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;QAEvF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG,EAAE,EAAE;gBACP,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/serverSaved.d.ts b/dist/events/serverSaved.d.ts new file mode 100644 index 0000000..584429c --- /dev/null +++ b/dist/events/serverSaved.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"serverSaved">; +export default _default; +//# sourceMappingURL=serverSaved.d.ts.map \ No newline at end of file diff --git a/dist/events/serverSaved.d.ts.map b/dist/events/serverSaved.d.ts.map new file mode 100644 index 0000000..27acba7 --- /dev/null +++ b/dist/events/serverSaved.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverSaved.d.ts","sourceRoot":"","sources":["../../src/events/serverSaved.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/serverSaved.js b/dist/events/serverSaved.js new file mode 100644 index 0000000..373e739 --- /dev/null +++ b/dist/events/serverSaved.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "serverSaved", + version: "1.0.0", + description: "This event is fired when the server was saved", + listener: async function () { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("serverSaved"); + for (const command of commands) { + const ctx = new __1.Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=serverSaved.js.map \ No newline at end of file diff --git a/dist/events/serverSaved.js.map b/dist/events/serverSaved.js.map new file mode 100644 index 0000000..abb6467 --- /dev/null +++ b/dist/events/serverSaved.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverSaved.js","sourceRoot":"","sources":["../../src/events/serverSaved.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,+CAA+C;IAC5D,QAAQ,EAAE,KAAK;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,aAAa,CAAC,CAAA;QAEpF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG,EAAE,EAAE;gBACP,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/serverSaving.d.ts b/dist/events/serverSaving.d.ts new file mode 100644 index 0000000..a16def0 --- /dev/null +++ b/dist/events/serverSaving.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"serverSaving">; +export default _default; +//# sourceMappingURL=serverSaving.d.ts.map \ No newline at end of file diff --git a/dist/events/serverSaving.d.ts.map b/dist/events/serverSaving.d.ts.map new file mode 100644 index 0000000..1a04afa --- /dev/null +++ b/dist/events/serverSaving.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverSaving.d.ts","sourceRoot":"","sources":["../../src/events/serverSaving.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/serverSaving.js b/dist/events/serverSaving.js new file mode 100644 index 0000000..6b8d2e4 --- /dev/null +++ b/dist/events/serverSaving.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "serverSaving", + version: "1.0.0", + description: "This event is fired when the server is saving", + listener: async function () { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("serverSaving"); + for (const command of commands) { + const ctx = new __1.Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=serverSaving.js.map \ No newline at end of file diff --git a/dist/events/serverSaving.js.map b/dist/events/serverSaving.js.map new file mode 100644 index 0000000..49bf84c --- /dev/null +++ b/dist/events/serverSaving.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverSaving.js","sourceRoot":"","sources":["../../src/events/serverSaving.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,+CAA+C;IAC5D,QAAQ,EAAE,KAAK;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;QAErF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG,EAAE,EAAE;gBACP,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/serverStarted.d.ts b/dist/events/serverStarted.d.ts new file mode 100644 index 0000000..dcf6fd7 --- /dev/null +++ b/dist/events/serverStarted.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"serverStarted">; +export default _default; +//# sourceMappingURL=serverStarted.d.ts.map \ No newline at end of file diff --git a/dist/events/serverStarted.d.ts.map b/dist/events/serverStarted.d.ts.map new file mode 100644 index 0000000..e14c064 --- /dev/null +++ b/dist/events/serverStarted.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverStarted.d.ts","sourceRoot":"","sources":["../../src/events/serverStarted.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/serverStarted.js b/dist/events/serverStarted.js new file mode 100644 index 0000000..56a171a --- /dev/null +++ b/dist/events/serverStarted.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "serverStarted", + version: "1.0.0", + description: "This event is fired when the server has started", + listener: async function () { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("serverStarted"); + for (const command of commands) { + const ctx = new __1.Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=serverStarted.js.map \ No newline at end of file diff --git a/dist/events/serverStarted.js.map b/dist/events/serverStarted.js.map new file mode 100644 index 0000000..fdfd372 --- /dev/null +++ b/dist/events/serverStarted.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverStarted.js","sourceRoot":"","sources":["../../src/events/serverStarted.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,iDAAiD;IAC9D,QAAQ,EAAE,KAAK;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,eAAe,CAAC,CAAA;QAEtF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG,EAAE,EAAE;gBACP,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/serverStatus.d.ts b/dist/events/serverStatus.d.ts new file mode 100644 index 0000000..2cdefa3 --- /dev/null +++ b/dist/events/serverStatus.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"serverStatus">; +export default _default; +//# sourceMappingURL=serverStatus.d.ts.map \ No newline at end of file diff --git a/dist/events/serverStatus.d.ts.map b/dist/events/serverStatus.d.ts.map new file mode 100644 index 0000000..f2d946b --- /dev/null +++ b/dist/events/serverStatus.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverStatus.d.ts","sourceRoot":"","sources":["../../src/events/serverStatus.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/serverStatus.js b/dist/events/serverStatus.js new file mode 100644 index 0000000..a6da7b6 --- /dev/null +++ b/dist/events/serverStatus.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "serverStatus", + version: "1.0.0", + description: "This event is fired when the server status was received", + listener: async function (obj) { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("serverStatus"); + for (const command of commands) { + const ctx = new __1.Context({ + obj, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=serverStatus.js.map \ No newline at end of file diff --git a/dist/events/serverStatus.js.map b/dist/events/serverStatus.js.map new file mode 100644 index 0000000..32487b0 --- /dev/null +++ b/dist/events/serverStatus.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverStatus.js","sourceRoot":"","sources":["../../src/events/serverStatus.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,yDAAyD;IACtE,QAAQ,EAAE,KAAK,WAAU,GAAG;QACxB,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;QAErF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG;gBACH,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/events/serverStopping.d.ts b/dist/events/serverStopping.d.ts new file mode 100644 index 0000000..c5b0e3d --- /dev/null +++ b/dist/events/serverStopping.d.ts @@ -0,0 +1,4 @@ +import { MinecraftEventHandler } from "../handlers"; +declare const _default: MinecraftEventHandler<"serverStopping">; +export default _default; +//# sourceMappingURL=serverStopping.d.ts.map \ No newline at end of file diff --git a/dist/events/serverStopping.d.ts.map b/dist/events/serverStopping.d.ts.map new file mode 100644 index 0000000..18d2977 --- /dev/null +++ b/dist/events/serverStopping.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverStopping.d.ts","sourceRoot":"","sources":["../../src/events/serverStopping.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,qBAAqB,EAAE,MAAM,aAAa,CAAA;;AAGnD,wBAkBE"} \ No newline at end of file diff --git a/dist/events/serverStopping.js b/dist/events/serverStopping.js new file mode 100644 index 0000000..3ffc5d8 --- /dev/null +++ b/dist/events/serverStopping.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const handlers_1 = require("../handlers"); +const __1 = require(".."); +exports.default = new handlers_1.MinecraftEventHandler({ + name: "serverStopping", + version: "1.0.0", + description: "This event is fired when the server is stopping", + listener: async function () { + const commands = this.getExtension(__1.ForgeMinecraft, true).commands.get("serverStopping"); + for (const command of commands) { + const ctx = new __1.Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }); + forgescript_1.Interpreter.run(ctx); + } + }, +}); +//# sourceMappingURL=serverStopping.js.map \ No newline at end of file diff --git a/dist/events/serverStopping.js.map b/dist/events/serverStopping.js.map new file mode 100644 index 0000000..df7f305 --- /dev/null +++ b/dist/events/serverStopping.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverStopping.js","sourceRoot":"","sources":["../../src/events/serverStopping.ts"],"names":[],"mappings":";;AAAA,uDAAmD;AACnD,0CAAmD;AACnD,0BAA4C;AAE5C,kBAAe,IAAI,gCAAqB,CAAC;IACrC,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,iDAAiD;IAC9D,QAAQ,EAAE,KAAK;QACX,MAAM,QAAQ,GAAG,IAAI,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAA;QAEvF,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;YAC7B,MAAM,GAAG,GAAG,IAAI,WAAO,CAAC;gBACpB,GAAG,EAAE,EAAE;gBACP,OAAO;gBACP,MAAM,EAAE,IAAI;gBACZ,IAAI,EAAE,OAAO,CAAC,QAAQ,CAAC,IAAI;aAC9B,CAAC,CAAA;YAEF,yBAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;QACxB,CAAC;IACL,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/functions/array.d.ts b/dist/functions/array.d.ts new file mode 100644 index 0000000..4e2b5d1 --- /dev/null +++ b/dist/functions/array.d.ts @@ -0,0 +1,3 @@ +import { ArgType } from "@tryforge/forgescript"; +export default function (value?: any): any; +//# sourceMappingURL=array.d.ts.map \ No newline at end of file diff --git a/dist/functions/array.d.ts.map b/dist/functions/array.d.ts.map new file mode 100644 index 0000000..2b13133 --- /dev/null +++ b/dist/functions/array.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../src/functions/array.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAA;AAE/C,MAAM,CAAC,OAAO,WAAU,CAAC,SAAS,OAAO,EAAE,KAAK,CAAC,EAAE,GAAG,OAErD"} \ No newline at end of file diff --git a/dist/functions/array.js b/dist/functions/array.js new file mode 100644 index 0000000..bffcbdf --- /dev/null +++ b/dist/functions/array.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = default_1; +function default_1(value) { + return value ?? null; +} +//# sourceMappingURL=array.js.map \ No newline at end of file diff --git a/dist/functions/array.js.map b/dist/functions/array.js.map new file mode 100644 index 0000000..14037ee --- /dev/null +++ b/dist/functions/array.js.map @@ -0,0 +1 @@ +{"version":3,"file":"array.js","sourceRoot":"","sources":["../../src/functions/array.ts"],"names":[],"mappings":";;AAEA,4BAEC;AAFD,mBAA2C,KAAW;IAClD,OAAO,KAAK,IAAI,IAAI,CAAA;AACxB,CAAC"} \ No newline at end of file diff --git a/dist/functions/contextNoop.d.ts b/dist/functions/contextNoop.d.ts new file mode 100644 index 0000000..f96c56f --- /dev/null +++ b/dist/functions/contextNoop.d.ts @@ -0,0 +1,3 @@ +import { Context } from "@tryforge/forgescript"; +export default function (this: Context, ...args: any[]): void; +//# sourceMappingURL=contextNoop.d.ts.map \ No newline at end of file diff --git a/dist/functions/contextNoop.d.ts.map b/dist/functions/contextNoop.d.ts.map new file mode 100644 index 0000000..09f9631 --- /dev/null +++ b/dist/functions/contextNoop.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"contextNoop.d.ts","sourceRoot":"","sources":["../../src/functions/contextNoop.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,uBAAuB,CAAA;AAEvD,MAAM,CAAC,OAAO,WAAU,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,EAAE,GAAG,EAAE,QAMpD"} \ No newline at end of file diff --git a/dist/functions/contextNoop.js b/dist/functions/contextNoop.js new file mode 100644 index 0000000..9864c56 --- /dev/null +++ b/dist/functions/contextNoop.js @@ -0,0 +1,11 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = default_1; +const forgescript_1 = require("@tryforge/forgescript"); +function default_1(...args) { + if (this.hasDisabledConsoleErrors()) { + return; + } + forgescript_1.Logger.error("[ForgeMinecraft]", ...args); +} +//# sourceMappingURL=contextNoop.js.map \ No newline at end of file diff --git a/dist/functions/contextNoop.js.map b/dist/functions/contextNoop.js.map new file mode 100644 index 0000000..f49e085 --- /dev/null +++ b/dist/functions/contextNoop.js.map @@ -0,0 +1 @@ +{"version":3,"file":"contextNoop.js","sourceRoot":"","sources":["../../src/functions/contextNoop.ts"],"names":[],"mappings":";;AAEA,4BAMC;AARD,uDAAuD;AAEvD,mBAAuC,GAAG,IAAW;IACjD,IAAI,IAAI,CAAC,wBAAwB,EAAE,EAAE,CAAC;QAClC,OAAM;IACV,CAAC;IAED,oBAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,GAAG,IAAI,CAAC,CAAA;AAC7C,CAAC"} \ No newline at end of file diff --git a/dist/functions/convertEnum.d.ts b/dist/functions/convertEnum.d.ts new file mode 100644 index 0000000..25b8da8 --- /dev/null +++ b/dist/functions/convertEnum.d.ts @@ -0,0 +1,9 @@ +import { EnumLike } from "@tryforge/forgescript"; +/** + * Converts an enum string value into an enum key. + * @param en The enum to convert the value into. + * @param value The value to convert. + * @returns + */ +export default function (en: Enum, value: string): keyof Enum | undefined; +//# sourceMappingURL=convertEnum.d.ts.map \ No newline at end of file diff --git a/dist/functions/convertEnum.d.ts.map b/dist/functions/convertEnum.d.ts.map new file mode 100644 index 0000000..b05634a --- /dev/null +++ b/dist/functions/convertEnum.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"convertEnum.d.ts","sourceRoot":"","sources":["../../src/functions/convertEnum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,WAAU,IAAI,SAAS,QAAQ,EAAE,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,0BAErE"} \ No newline at end of file diff --git a/dist/functions/convertEnum.js b/dist/functions/convertEnum.js new file mode 100644 index 0000000..dfdf7d7 --- /dev/null +++ b/dist/functions/convertEnum.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = default_1; +/** + * Converts an enum string value into an enum key. + * @param en The enum to convert the value into. + * @param value The value to convert. + * @returns + */ +function default_1(en, value) { + return Object.keys(en).find((key) => en[key] === value); +} +//# sourceMappingURL=convertEnum.js.map \ No newline at end of file diff --git a/dist/functions/convertEnum.js.map b/dist/functions/convertEnum.js.map new file mode 100644 index 0000000..4a2df24 --- /dev/null +++ b/dist/functions/convertEnum.js.map @@ -0,0 +1 @@ +{"version":3,"file":"convertEnum.js","sourceRoot":"","sources":["../../src/functions/convertEnum.ts"],"names":[],"mappings":";;AAQA,4BAEC;AARD;;;;;GAKG;AACH,mBAA+C,EAAQ,EAAE,KAAa;IAClE,OAAQ,MAAM,CAAC,IAAI,CAAC,EAAE,CAAoB,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,EAAE,CAAC,GAAG,CAAC,KAAK,KAAK,CAAC,CAAA;AAC/E,CAAC"} \ No newline at end of file diff --git a/dist/functions/defineProperties.d.ts b/dist/functions/defineProperties.d.ts new file mode 100644 index 0000000..3c450ea --- /dev/null +++ b/dist/functions/defineProperties.d.ts @@ -0,0 +1,6 @@ +import { EnumLike } from "@tryforge/forgescript"; +export type Properties = { + [P in keyof Enum]: (v?: Type | null, sep?: string | null, index?: number | null) => null | undefined | string | number | boolean; +}; +export default function defineProperties(props: Properties): Properties; +//# sourceMappingURL=defineProperties.d.ts.map \ No newline at end of file diff --git a/dist/functions/defineProperties.d.ts.map b/dist/functions/defineProperties.d.ts.map new file mode 100644 index 0000000..9510ade --- /dev/null +++ b/dist/functions/defineProperties.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"defineProperties.d.ts","sourceRoot":"","sources":["../../src/functions/defineProperties.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD,MAAM,MAAM,UAAU,CAAC,IAAI,SAAS,QAAQ,EAAE,IAAI,IAAI;KACjD,CAAC,IAAI,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,EAAE,IAAI,GAAG,IAAI,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO;CACnI,CAAA;AAED,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,IAAI,SAAS,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,CAAC,IAAI,EAAE,IAAI,CAAC,0BAElG"} \ No newline at end of file diff --git a/dist/functions/defineProperties.js b/dist/functions/defineProperties.js new file mode 100644 index 0000000..d8d4b94 --- /dev/null +++ b/dist/functions/defineProperties.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = defineProperties; +function defineProperties(props) { + return props; +} +//# sourceMappingURL=defineProperties.js.map \ No newline at end of file diff --git a/dist/functions/defineProperties.js.map b/dist/functions/defineProperties.js.map new file mode 100644 index 0000000..1e59798 --- /dev/null +++ b/dist/functions/defineProperties.js.map @@ -0,0 +1 @@ +{"version":3,"file":"defineProperties.js","sourceRoot":"","sources":["../../src/functions/defineProperties.ts"],"names":[],"mappings":";;AAMA,mCAEC;AAFD,SAAwB,gBAAgB,CAA8B,KAA6B;IAC/F,OAAO,KAAK,CAAA;AAChB,CAAC"} \ No newline at end of file diff --git a/dist/functions/isUUID.d.ts b/dist/functions/isUUID.d.ts new file mode 100644 index 0000000..cec8477 --- /dev/null +++ b/dist/functions/isUUID.d.ts @@ -0,0 +1,9 @@ +export declare const UUIDRegex: RegExp; +export declare const UUIDRegexNoDashes: RegExp; +/** + * Returns whether the given value is a valid UUID. + * @param value The value to check. + * @returns + */ +export default function (value: string): boolean; +//# sourceMappingURL=isUUID.d.ts.map \ No newline at end of file diff --git a/dist/functions/isUUID.d.ts.map b/dist/functions/isUUID.d.ts.map new file mode 100644 index 0000000..3f62328 --- /dev/null +++ b/dist/functions/isUUID.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"isUUID.d.ts","sourceRoot":"","sources":["../../src/functions/isUUID.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,QAA2E,CAAA;AACjG,eAAO,MAAM,iBAAiB,QAAoB,CAAA;AAElD;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAU,KAAK,EAAE,MAAM,WAEpC"} \ No newline at end of file diff --git a/dist/functions/isUUID.js b/dist/functions/isUUID.js new file mode 100644 index 0000000..c337142 --- /dev/null +++ b/dist/functions/isUUID.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.UUIDRegexNoDashes = exports.UUIDRegex = void 0; +exports.default = default_1; +exports.UUIDRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i; +exports.UUIDRegexNoDashes = /^[0-9a-f]{32}$/i; +/** + * Returns whether the given value is a valid UUID. + * @param value The value to check. + * @returns + */ +function default_1(value) { + return exports.UUIDRegex.test(value) || exports.UUIDRegexNoDashes.test(value); +} +//# sourceMappingURL=isUUID.js.map \ No newline at end of file diff --git a/dist/functions/isUUID.js.map b/dist/functions/isUUID.js.map new file mode 100644 index 0000000..befa967 --- /dev/null +++ b/dist/functions/isUUID.js.map @@ -0,0 +1 @@ +{"version":3,"file":"isUUID.js","sourceRoot":"","sources":["../../src/functions/isUUID.ts"],"names":[],"mappings":";;;AAQA,4BAEC;AAVY,QAAA,SAAS,GAAG,wEAAwE,CAAA;AACpF,QAAA,iBAAiB,GAAG,iBAAiB,CAAA;AAElD;;;;GAIG;AACH,mBAAwB,KAAa;IACjC,OAAO,iBAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,yBAAiB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AACjE,CAAC"} \ No newline at end of file diff --git a/dist/functions/noop.d.ts b/dist/functions/noop.d.ts new file mode 100644 index 0000000..3cbb35f --- /dev/null +++ b/dist/functions/noop.d.ts @@ -0,0 +1,3 @@ +declare const _default: (...args: any[]) => void; +export default _default; +//# sourceMappingURL=noop.d.ts.map \ No newline at end of file diff --git a/dist/functions/noop.d.ts.map b/dist/functions/noop.d.ts.map new file mode 100644 index 0000000..f713e3e --- /dev/null +++ b/dist/functions/noop.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"noop.d.ts","sourceRoot":"","sources":["../../src/functions/noop.ts"],"names":[],"mappings":"kCAEyB,GAAG,EAAE;AAA9B,wBAEC"} \ No newline at end of file diff --git a/dist/functions/noop.js b/dist/functions/noop.js new file mode 100644 index 0000000..96ae032 --- /dev/null +++ b/dist/functions/noop.js @@ -0,0 +1,7 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = (...args) => { + forgescript_1.Logger.error("[ForgeMinecraft]", ...args); +}; +//# sourceMappingURL=noop.js.map \ No newline at end of file diff --git a/dist/functions/noop.js.map b/dist/functions/noop.js.map new file mode 100644 index 0000000..be551c4 --- /dev/null +++ b/dist/functions/noop.js.map @@ -0,0 +1 @@ +{"version":3,"file":"noop.js","sourceRoot":"","sources":["../../src/functions/noop.ts"],"names":[],"mappings":";;AAAA,uDAA8C;AAE9C,kBAAe,CAAC,GAAG,IAAW,EAAE,EAAE;IAC9B,oBAAM,CAAC,KAAK,CAAC,kBAAkB,EAAE,GAAG,IAAI,CAAC,CAAA;AAC7C,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/functions/parsePlayer.d.ts b/dist/functions/parsePlayer.d.ts new file mode 100644 index 0000000..0fead4e --- /dev/null +++ b/dist/functions/parsePlayer.d.ts @@ -0,0 +1,8 @@ +import { Player } from "mc-server-management"; +/** + * Parses a player input into a Player instance. + * @param value The value to parse. + * @returns + */ +export default function (value: string): Player; +//# sourceMappingURL=parsePlayer.d.ts.map \ No newline at end of file diff --git a/dist/functions/parsePlayer.d.ts.map b/dist/functions/parsePlayer.d.ts.map new file mode 100644 index 0000000..af37a18 --- /dev/null +++ b/dist/functions/parsePlayer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"parsePlayer.d.ts","sourceRoot":"","sources":["../../src/functions/parsePlayer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAG7C;;;;GAIG;AACH,MAAM,CAAC,OAAO,WAAU,KAAK,EAAE,MAAM,UAEpC"} \ No newline at end of file diff --git a/dist/functions/parsePlayer.js b/dist/functions/parsePlayer.js new file mode 100644 index 0000000..1a8dbdf --- /dev/null +++ b/dist/functions/parsePlayer.js @@ -0,0 +1,17 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = default_1; +const mc_server_management_1 = require("mc-server-management"); +const isUUID_1 = __importDefault(require("./isUUID")); +/** + * Parses a player input into a Player instance. + * @param value The value to parse. + * @returns + */ +function default_1(value) { + return ((0, isUUID_1.default)(value) ? mc_server_management_1.Player.withId(value) : mc_server_management_1.Player.withName(value)); +} +//# sourceMappingURL=parsePlayer.js.map \ No newline at end of file diff --git a/dist/functions/parsePlayer.js.map b/dist/functions/parsePlayer.js.map new file mode 100644 index 0000000..c065ede --- /dev/null +++ b/dist/functions/parsePlayer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"parsePlayer.js","sourceRoot":"","sources":["../../src/functions/parsePlayer.ts"],"names":[],"mappings":";;;;;AAQA,4BAEC;AAVD,+DAA6C;AAC7C,sDAA6B;AAE7B;;;;GAIG;AACH,mBAAwB,KAAa;IACjC,OAAO,CAAC,IAAA,gBAAM,EAAC,KAAK,CAAC,CAAC,CAAC,CAAC,6BAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,6BAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;AAC1E,CAAC"} \ No newline at end of file diff --git a/dist/functions/resolveStatus.d.ts b/dist/functions/resolveStatus.d.ts new file mode 100644 index 0000000..fa2ac5e --- /dev/null +++ b/dist/functions/resolveStatus.d.ts @@ -0,0 +1,13 @@ +/** + * Resolves to a status response from a Minecraft server. + * @param resolver The resolver function. + * @param defaults The default server options. + * @param host The host domain of the server. + * @param port The port for the host domain. + * @returns + */ +export default function (resolver: (host: string, port?: number) => Promise, defaults: { + host?: string; + port?: number; +} | undefined, host?: string | null, port?: number): Promise; +//# sourceMappingURL=resolveStatus.d.ts.map \ No newline at end of file diff --git a/dist/functions/resolveStatus.d.ts.map b/dist/functions/resolveStatus.d.ts.map new file mode 100644 index 0000000..74f924d --- /dev/null +++ b/dist/functions/resolveStatus.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"resolveStatus.d.ts","sourceRoot":"","sources":["../../src/functions/resolveStatus.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,yBAA8B,CAAC,EAC3B,QAAQ,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,EACrD,QAAQ,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,EACtD,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,EACpB,IAAI,CAAC,EAAE,MAAM,qBAOhB"} \ No newline at end of file diff --git a/dist/functions/resolveStatus.js b/dist/functions/resolveStatus.js new file mode 100644 index 0000000..5c232f4 --- /dev/null +++ b/dist/functions/resolveStatus.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = default_1; +/** + * Resolves to a status response from a Minecraft server. + * @param resolver The resolver function. + * @param defaults The default server options. + * @param host The host domain of the server. + * @param port The port for the host domain. + * @returns + */ +async function default_1(resolver, defaults, host, port) { + host ||= defaults?.host; + port ??= defaults?.port; + if (!host) + return null; + return resolver(host, port); +} +//# sourceMappingURL=resolveStatus.js.map \ No newline at end of file diff --git a/dist/functions/resolveStatus.js.map b/dist/functions/resolveStatus.js.map new file mode 100644 index 0000000..bec69fe --- /dev/null +++ b/dist/functions/resolveStatus.js.map @@ -0,0 +1 @@ +{"version":3,"file":"resolveStatus.js","sourceRoot":"","sources":["../../src/functions/resolveStatus.ts"],"names":[],"mappings":";;AAQA,4BAWC;AAnBD;;;;;;;GAOG;AACY,KAAK,oBAChB,QAAqD,EACrD,QAAsD,EACtD,IAAoB,EACpB,IAAa;IAEb,IAAI,KAAK,QAAQ,EAAE,IAAI,CAAA;IACvB,IAAI,KAAK,QAAQ,EAAE,IAAI,CAAA;IAEvB,IAAI,CAAC,IAAI;QAAE,OAAO,IAAI,CAAA;IACtB,OAAO,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;AAC/B,CAAC"} \ No newline at end of file diff --git a/dist/functions/transformEnum.d.ts b/dist/functions/transformEnum.d.ts new file mode 100644 index 0000000..19b41fc --- /dev/null +++ b/dist/functions/transformEnum.d.ts @@ -0,0 +1,9 @@ +import { EnumLike } from "@tryforge/forgescript"; +/** + * Transforms an enum value from one enum to another. + * @param fromValue The value to transform. + * @param toEnum The enum to transform the value into. + * @returns + */ +export default function (fromValue: From[keyof From], toEnum: To): To[keyof To]; +//# sourceMappingURL=transformEnum.d.ts.map \ No newline at end of file diff --git a/dist/functions/transformEnum.d.ts.map b/dist/functions/transformEnum.d.ts.map new file mode 100644 index 0000000..84bee26 --- /dev/null +++ b/dist/functions/transformEnum.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"transformEnum.d.ts","sourceRoot":"","sources":["../../src/functions/transformEnum.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAEhD;;;;;GAKG;AACH,MAAM,CAAC,OAAO,WAAU,IAAI,SAAS,QAAQ,EAAE,EAAE,SAAS,QAAQ,EAC9D,SAAS,EAAE,IAAI,CAAC,MAAM,IAAI,CAAC,EAC3B,MAAM,EAAE,EAAE,GACX,EAAE,CAAC,MAAM,EAAE,CAAC,CAEd"} \ No newline at end of file diff --git a/dist/functions/transformEnum.js b/dist/functions/transformEnum.js new file mode 100644 index 0000000..86ef7c7 --- /dev/null +++ b/dist/functions/transformEnum.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = default_1; +/** + * Transforms an enum value from one enum to another. + * @param fromValue The value to transform. + * @param toEnum The enum to transform the value into. + * @returns + */ +function default_1(fromValue, toEnum) { + return Object.values(toEnum).find((v) => v === fromValue); +} +//# sourceMappingURL=transformEnum.js.map \ No newline at end of file diff --git a/dist/functions/transformEnum.js.map b/dist/functions/transformEnum.js.map new file mode 100644 index 0000000..0a9de62 --- /dev/null +++ b/dist/functions/transformEnum.js.map @@ -0,0 +1 @@ +{"version":3,"file":"transformEnum.js","sourceRoot":"","sources":["../../src/functions/transformEnum.ts"],"names":[],"mappings":";;AAQA,4BAKC;AAXD;;;;;GAKG;AACH,mBACI,SAA2B,EAC3B,MAAU;IAEV,OAAO,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,KAAK,SAAS,CAAC,CAAA;AAC7D,CAAC"} \ No newline at end of file diff --git a/dist/handlers/MinecraftEventHandler.d.ts b/dist/handlers/MinecraftEventHandler.d.ts new file mode 100644 index 0000000..30f7dea --- /dev/null +++ b/dist/handlers/MinecraftEventHandler.d.ts @@ -0,0 +1,29 @@ +import { GameRuleType, IPBan, Operator, Player, ServerState, TypedGameRule, UserBan } from "mc-server-management"; +import { BaseEventHandler, ForgeClient } from "@tryforge/forgescript"; +export interface IMinecraftEvents { + error: [Error]; + connected: []; + reconnecting: []; + disconnected: []; + serverStarted: []; + serverStopping: []; + serverSaving: []; + serverSaved: []; + serverActivity: []; + serverStatus: [ServerState]; + playerJoined: [Player]; + playerLeft: [Player]; + operatorAdded: [Operator]; + operatorRemoved: [Operator]; + allowListAdded: [Player]; + allowListRemoved: [Player]; + banAdded: [UserBan]; + banRemoved: [Player]; + ipBanAdded: [IPBan]; + ipBanRemoved: [string]; + gameRuleUpdated: [TypedGameRule]; +} +export declare class MinecraftEventHandler extends BaseEventHandler { + register(client: ForgeClient): void; +} +//# sourceMappingURL=MinecraftEventHandler.d.ts.map \ No newline at end of file diff --git a/dist/handlers/MinecraftEventHandler.d.ts.map b/dist/handlers/MinecraftEventHandler.d.ts.map new file mode 100644 index 0000000..09cd836 --- /dev/null +++ b/dist/handlers/MinecraftEventHandler.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MinecraftEventHandler.d.ts","sourceRoot":"","sources":["../../src/handlers/MinecraftEventHandler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACjH,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAGrE,MAAM,WAAW,gBAAgB;IAC7B,KAAK,EAAE,CAAC,KAAK,CAAC,CAAA;IACd,SAAS,EAAE,EAAE,CAAA;IACb,YAAY,EAAE,EAAE,CAAA;IAChB,YAAY,EAAE,EAAE,CAAA;IAChB,aAAa,EAAE,EAAE,CAAA;IACjB,cAAc,EAAE,EAAE,CAAA;IAClB,YAAY,EAAE,EAAE,CAAA;IAChB,WAAW,EAAE,EAAE,CAAA;IACf,cAAc,EAAE,EAAE,CAAA;IAClB,YAAY,EAAE,CAAC,WAAW,CAAC,CAAC;IAC5B,YAAY,EAAE,CAAC,MAAM,CAAC,CAAA;IACtB,UAAU,EAAE,CAAC,MAAM,CAAC,CAAA;IACpB,aAAa,EAAE,CAAC,QAAQ,CAAC,CAAA;IACzB,eAAe,EAAE,CAAC,QAAQ,CAAC,CAAA;IAC3B,cAAc,EAAE,CAAC,MAAM,CAAC,CAAA;IACxB,gBAAgB,EAAE,CAAC,MAAM,CAAC,CAAA;IAC1B,QAAQ,EAAE,CAAC,OAAO,CAAC,CAAA;IACnB,UAAU,EAAE,CAAC,MAAM,CAAC,CAAA;IACpB,UAAU,EAAE,CAAC,KAAK,CAAC,CAAA;IACnB,YAAY,EAAE,CAAC,MAAM,CAAC,CAAA;IACtB,eAAe,EAAE,CAAC,aAAa,CAAC,YAAY,CAAC,CAAC,CAAA;CACjD;AAED,qBAAa,qBAAqB,CAAC,CAAC,SAAS,MAAM,gBAAgB,CAAE,SAAQ,gBAAgB,CAAC,gBAAgB,EAAE,CAAC,CAAC;IAC9G,QAAQ,CAAC,MAAM,EAAE,WAAW;CAI/B"} \ No newline at end of file diff --git a/dist/handlers/MinecraftEventHandler.js b/dist/handlers/MinecraftEventHandler.js new file mode 100644 index 0000000..a367f58 --- /dev/null +++ b/dist/handlers/MinecraftEventHandler.js @@ -0,0 +1,13 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MinecraftEventHandler = void 0; +const forgescript_1 = require("@tryforge/forgescript"); +const __1 = require(".."); +class MinecraftEventHandler extends forgescript_1.BaseEventHandler { + register(client) { + // @ts-ignore + client.getExtension(__1.ForgeMinecraft, true).emitter.on(this.name, this.listener.bind(client)); + } +} +exports.MinecraftEventHandler = MinecraftEventHandler; +//# sourceMappingURL=MinecraftEventHandler.js.map \ No newline at end of file diff --git a/dist/handlers/MinecraftEventHandler.js.map b/dist/handlers/MinecraftEventHandler.js.map new file mode 100644 index 0000000..45903ca --- /dev/null +++ b/dist/handlers/MinecraftEventHandler.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MinecraftEventHandler.js","sourceRoot":"","sources":["../../src/handlers/MinecraftEventHandler.ts"],"names":[],"mappings":";;;AACA,uDAAqE;AACrE,0BAAmC;AA0BnC,MAAa,qBAAwD,SAAQ,8BAAqC;IAC9G,QAAQ,CAAC,MAAmB;QACxB,aAAa;QACb,MAAM,CAAC,YAAY,CAAC,kBAAc,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,IAAI,EAAE,IAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IAC/F,CAAC;CACJ;AALD,sDAKC"} \ No newline at end of file diff --git a/dist/handlers/index.d.ts b/dist/handlers/index.d.ts new file mode 100644 index 0000000..fd686b2 --- /dev/null +++ b/dist/handlers/index.d.ts @@ -0,0 +1,2 @@ +export * from "./MinecraftEventHandler"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/handlers/index.d.ts.map b/dist/handlers/index.d.ts.map new file mode 100644 index 0000000..f329294 --- /dev/null +++ b/dist/handlers/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/handlers/index.ts"],"names":[],"mappings":"AAAA,cAAc,yBAAyB,CAAA"} \ No newline at end of file diff --git a/dist/handlers/index.js b/dist/handlers/index.js new file mode 100644 index 0000000..2b69ec7 --- /dev/null +++ b/dist/handlers/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./MinecraftEventHandler"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/handlers/index.js.map b/dist/handlers/index.js.map new file mode 100644 index 0000000..5f678d6 --- /dev/null +++ b/dist/handlers/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/handlers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,0DAAuC"} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..55613cb --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,108 @@ +import { ForgeClient, ForgeExtension } from "@tryforge/forgescript"; +import { MinecraftServer } from "mc-server-management"; +import { MinecraftCommandManager } from "./managers"; +import { IMinecraftEvents } from "./handlers"; +export interface IManagementServerOptions { + /** + * The host domain of the server. + */ + host: string; + /** + * The port for the host connection. + */ + port: number; + /** + * The token needed to connect to the server. + */ + token: string; + /** + * Whether to automatically reconnect to the server if the connection is lost. + * @default true + */ + reconnect?: boolean; + /** + * The interval in ms used to reconnect to the server. + * @default 1000 + */ + reconnectInterval?: number; + /** + * The maximum number of times to attempt to reconnect to the server. Set to `0` for infinite attempts. + * @default 5 + */ + maxReconnectAttempts?: number; +} +export interface IJavaServerOptions { + /** + * The host domain of the server. + */ + host: string; + /** + * The port for the host domain. + * @default 25565 + */ + port?: number; +} +export interface IBedrockServerOptions { + /** + * The host domain of the server. + */ + host: string; + /** + * The port for the host domain. + * @default 19132 + */ + port?: number; +} +export interface IForgeMinecraftOptions { + /** + * The events to receive from the management server. + */ + events?: Array; + /** + * The management server options used to establish a connection. + */ + server?: IManagementServerOptions; + /** + * The default Java server options to use for java functions. + */ + java?: IJavaServerOptions; + /** + * The default Bedrock server options to use for bedrock functions. + */ + bedrock?: IBedrockServerOptions; +} +export type TransformEvents = { + [P in keyof T]: T[P] extends any[] ? (...args: T[P]) => any : never; +}; +export declare class ForgeMinecraft extends ForgeExtension { + readonly options: IForgeMinecraftOptions; + name: string; + description: string; + version: string; + server?: MinecraftServer; + commands: MinecraftCommandManager; + private manager?; + private emitter; + constructor(options?: IForgeMinecraftOptions); + /** + * Gets the status response of a Java Minecraft server. Uses the `java` client options if no parameters are provided. + * @param host The host domain of the server. + * @param port The port for the host domain. + * @returns + */ + getJavaStatus(host?: string | null, port?: number): Promise; + /** + * Gets the status response of a Bedrock Minecraft server. Uses the `bedrock` client options if no parameters are provided. + * @param host The host domain of the server. + * @param port The port for the host domain. + * @returns + */ + getBedrockStatus(host?: string | null, port?: number): Promise; + init(client: ForgeClient): Promise; +} +export * from "./handlers"; +export * from "./managers"; +export * from "./structures"; +export * from "./constants"; +export * from "./types"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/index.d.ts.map b/dist/index.d.ts.map new file mode 100644 index 0000000..b3accd3 --- /dev/null +++ b/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,WAAW,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AACjF,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAItD,OAAO,EAAE,uBAAuB,EAA8B,MAAM,YAAY,CAAA;AAEhF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAA;AAG7C,MAAM,WAAW,wBAAwB;IACrC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;OAEG;IACH,KAAK,EAAE,MAAM,CAAA;IAEb;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAA;IAEnB;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAE1B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAA;CAChC;AAED,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,qBAAqB;IAClC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAA;IAEZ;;;OAGG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,MAAM,CAAC,EAAE,KAAK,CAAC,MAAM,gBAAgB,CAAC,CAAA;IAEtC;;OAEG;IACH,MAAM,CAAC,EAAE,wBAAwB,CAAA;IAEjC;;OAEG;IACH,IAAI,CAAC,EAAE,kBAAkB,CAAA;IAEzB;;OAEG;IACH,OAAO,CAAC,EAAE,qBAAqB,CAAA;CAClC;AAED,MAAM,MAAM,eAAe,CAAC,CAAC,IAAI;KAC5B,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,SAAS,GAAG,EAAE,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,KAAK,GAAG,GAAG,KAAK;CACtE,CAAA;AAED,qBAAa,cAAe,SAAQ,cAAc;aAWX,OAAO,EAAE,sBAAsB;IAVlE,IAAI,SAAoB;IACxB,WAAW,SAAc;IACzB,OAAO,SAAU;IAEV,MAAM,CAAC,EAAE,eAAe,CAAA;IACxB,QAAQ,EAAG,uBAAuB,CAAA;IAEzC,OAAO,CAAC,OAAO,CAAC,CAA4B;IAC5C,OAAO,CAAC,OAAO,CAAwD;gBAEpC,OAAO,GAAE,sBAA2B;IAIvE;;;;;OAKG;IACU,aAAa,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM;IAI9D;;;;;OAKG;IACU,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,EAAE,IAAI,CAAC,EAAE,MAAM;IAIpD,IAAI,CAAC,MAAM,EAAE,WAAW;CAqBxC;AAED,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,cAAc,CAAA;AAC5B,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..9df934a --- /dev/null +++ b/dist/index.js @@ -0,0 +1,82 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ForgeMinecraft = void 0; +const forgescript_1 = require("@tryforge/forgescript"); +const node_mcstatus_1 = require("node-mcstatus"); +const tiny_typed_emitter_1 = require("tiny-typed-emitter"); +const package_json_1 = require("../package.json"); +const managers_1 = require("./managers"); +const constants_1 = require("./constants"); +const resolveStatus_1 = __importDefault(require("./functions/resolveStatus")); +class ForgeMinecraft extends forgescript_1.ForgeExtension { + options; + name = "forge.minecraft"; + description = package_json_1.description; + version = package_json_1.version; + server; + commands; + manager; + emitter = new tiny_typed_emitter_1.TypedEmitter(); + constructor(options = {}) { + super(); + this.options = options; + } + /** + * Gets the status response of a Java Minecraft server. Uses the `java` client options if no parameters are provided. + * @param host The host domain of the server. + * @param port The port for the host domain. + * @returns + */ + async getJavaStatus(host, port) { + return (0, resolveStatus_1.default)(node_mcstatus_1.statusJava, this.options.java, host, port); + } + /** + * Gets the status response of a Bedrock Minecraft server. Uses the `bedrock` client options if no parameters are provided. + * @param host The host domain of the server. + * @param port The port for the host domain. + * @returns + */ + async getBedrockStatus(host, port) { + return (0, resolveStatus_1.default)(node_mcstatus_1.statusBedrock, this.options.bedrock, host, port); + } + async init(client) { + client.minecraft = this; + this.commands = new managers_1.MinecraftCommandManager(client); + if (this.options.server) { + this.manager = new managers_1.MinecraftConnectionManager(this.options.server, this.emitter); + this.manager.on("connected", (server) => { + this.server = server; + }); + this.manager.connect(client); + } + forgescript_1.EventManager.load(constants_1.ForgeMinecraftEventHandlerName, __dirname + `/events`); + this.load(__dirname + `/native`); + if (this.options.events?.length) { + client.events.load(constants_1.ForgeMinecraftEventHandlerName, this.options.events); + } + } +} +exports.ForgeMinecraft = ForgeMinecraft; +__exportStar(require("./handlers"), exports); +__exportStar(require("./managers"), exports); +__exportStar(require("./structures"), exports); +__exportStar(require("./constants"), exports); +__exportStar(require("./types"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..c3b8fe3 --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA,uDAAiF;AAEjF,iDAAyD;AACzD,2DAAiD;AACjD,kDAAsD;AACtD,yCAAgF;AAChF,2CAA4D;AAE5D,8EAAqD;AAyFrD,MAAa,cAAe,SAAQ,4BAAc;IAWX;IAVnC,IAAI,GAAG,iBAAiB,CAAA;IACxB,WAAW,GAAG,0BAAW,CAAA;IACzB,OAAO,GAAG,sBAAO,CAAA;IAEV,MAAM,CAAkB;IACxB,QAAQ,CAA0B;IAEjC,OAAO,CAA6B;IACpC,OAAO,GAAG,IAAI,iCAAY,EAAqC,CAAA;IAEvE,YAAmC,UAAkC,EAAE;QACnE,KAAK,EAAE,CAAA;QADwB,YAAO,GAAP,OAAO,CAA6B;IAEvE,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,aAAa,CAAC,IAAoB,EAAE,IAAa;QAC1D,OAAO,IAAA,uBAAa,EAAC,0BAAU,EAAE,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IACnE,CAAC;IAED;;;;;OAKG;IACI,KAAK,CAAC,gBAAgB,CAAC,IAAoB,EAAE,IAAa;QAC7D,OAAO,IAAA,uBAAa,EAAC,6BAAa,EAAE,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,EAAE,IAAI,CAAC,CAAA;IACzE,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,MAAmB;QACjC,MAAM,CAAC,SAAS,GAAG,IAAI,CAAA;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,kCAAuB,CAAC,MAAM,CAAC,CAAA;QAEnD,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC;YACtB,IAAI,CAAC,OAAO,GAAG,IAAI,qCAA0B,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,IAAI,CAAC,OAAO,CAAC,CAAA;YAEhF,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,WAAW,EAAE,CAAC,MAAM,EAAE,EAAE;gBACpC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;YACxB,CAAC,CAAC,CAAA;YAEF,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAChC,CAAC;QAED,0BAAY,CAAC,IAAI,CAAC,0CAA8B,EAAE,SAAS,GAAG,SAAS,CAAC,CAAA;QACxE,IAAI,CAAC,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,CAAA;QAEhC,IAAI,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;YAC9B,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,0CAA8B,EAAE,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;QAC3E,CAAC;IACL,CAAC;CACJ;AAxDD,wCAwDC;AAED,6CAA0B;AAC1B,6CAA0B;AAC1B,+CAA4B;AAC5B,8CAA2B;AAC3B,0CAAuB"} \ No newline at end of file diff --git a/dist/managers/MinecraftCommandManager.d.ts b/dist/managers/MinecraftCommandManager.d.ts new file mode 100644 index 0000000..ee9172d --- /dev/null +++ b/dist/managers/MinecraftCommandManager.d.ts @@ -0,0 +1,6 @@ +import { BaseCommandManager } from "@tryforge/forgescript"; +import { IMinecraftEvents } from "../handlers"; +export declare class MinecraftCommandManager extends BaseCommandManager { + handlerName: string; +} +//# sourceMappingURL=MinecraftCommandManager.d.ts.map \ No newline at end of file diff --git a/dist/managers/MinecraftCommandManager.d.ts.map b/dist/managers/MinecraftCommandManager.d.ts.map new file mode 100644 index 0000000..c1ef801 --- /dev/null +++ b/dist/managers/MinecraftCommandManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MinecraftCommandManager.d.ts","sourceRoot":"","sources":["../../src/managers/MinecraftCommandManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAG9C,qBAAa,uBAAwB,SAAQ,kBAAkB,CAAC,MAAM,gBAAgB,CAAC;IACnF,WAAW,SAAiC;CAC/C"} \ No newline at end of file diff --git a/dist/managers/MinecraftCommandManager.js b/dist/managers/MinecraftCommandManager.js new file mode 100644 index 0000000..e4e1c82 --- /dev/null +++ b/dist/managers/MinecraftCommandManager.js @@ -0,0 +1,10 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MinecraftCommandManager = void 0; +const forgescript_1 = require("@tryforge/forgescript"); +const constants_1 = require("../constants"); +class MinecraftCommandManager extends forgescript_1.BaseCommandManager { + handlerName = constants_1.ForgeMinecraftEventHandlerName; +} +exports.MinecraftCommandManager = MinecraftCommandManager; +//# sourceMappingURL=MinecraftCommandManager.js.map \ No newline at end of file diff --git a/dist/managers/MinecraftCommandManager.js.map b/dist/managers/MinecraftCommandManager.js.map new file mode 100644 index 0000000..e730fa7 --- /dev/null +++ b/dist/managers/MinecraftCommandManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MinecraftCommandManager.js","sourceRoot":"","sources":["../../src/managers/MinecraftCommandManager.ts"],"names":[],"mappings":";;;AAAA,uDAA0D;AAE1D,4CAA6D;AAE7D,MAAa,uBAAwB,SAAQ,gCAA0C;IACnF,WAAW,GAAG,0CAA8B,CAAA;CAC/C;AAFD,0DAEC"} \ No newline at end of file diff --git a/dist/managers/MinecraftConnectionManager.d.ts b/dist/managers/MinecraftConnectionManager.d.ts new file mode 100644 index 0000000..0860216 --- /dev/null +++ b/dist/managers/MinecraftConnectionManager.d.ts @@ -0,0 +1,21 @@ +import { MinecraftServer, WebSocketConnection } from "mc-server-management"; +import { ForgeClient } from "@tryforge/forgescript"; +import { TypedEmitter } from "tiny-typed-emitter"; +import { IMinecraftEvents } from "../handlers"; +import { IManagementServerOptions, TransformEvents } from "../index"; +export interface IConnectionEvents { + connected: (server: MinecraftServer) => void; + reconnecting: () => void; + disconnected: () => void; +} +export declare class MinecraftConnectionManager extends TypedEmitter { + private readonly options; + private readonly emitter; + connection?: WebSocketConnection; + server?: MinecraftServer; + constructor(options: IManagementServerOptions, emitter: TypedEmitter>); + connect(client: ForgeClient): Promise; + private _attachSocketListeners; + private _attachServerListeners; +} +//# sourceMappingURL=MinecraftConnectionManager.d.ts.map \ No newline at end of file diff --git a/dist/managers/MinecraftConnectionManager.d.ts.map b/dist/managers/MinecraftConnectionManager.d.ts.map new file mode 100644 index 0000000..ad34a31 --- /dev/null +++ b/dist/managers/MinecraftConnectionManager.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"MinecraftConnectionManager.d.ts","sourceRoot":"","sources":["../../src/managers/MinecraftConnectionManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAa,eAAe,EAAiB,mBAAmB,EAAE,MAAM,sBAAsB,CAAA;AACrG,OAAO,EAAE,WAAW,EAAU,MAAM,uBAAuB,CAAA;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,UAAU,CAAA;AAEpE,MAAM,WAAW,iBAAiB;IAC9B,SAAS,EAAE,CAAC,MAAM,EAAE,eAAe,KAAK,IAAI,CAAA;IAC5C,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,YAAY,EAAE,MAAM,IAAI,CAAA;CAC3B;AAED,qBAAa,0BAA2B,SAAQ,YAAY,CAAC,iBAAiB,CAAC;IAKvE,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IALrB,UAAU,CAAC,EAAE,mBAAmB,CAAA;IAChC,MAAM,CAAC,EAAE,eAAe,CAAA;gBAGV,OAAO,EAAE,wBAAwB,EACjC,OAAO,EAAE,YAAY,CAAC,eAAe,CAAC,gBAAgB,CAAC,CAAC;IAKhE,OAAO,CAAC,MAAM,EAAE,WAAW;IAgCxC,OAAO,CAAC,sBAAsB;IA2B9B,OAAO,CAAC,sBAAsB;CA4BjC"} \ No newline at end of file diff --git a/dist/managers/MinecraftConnectionManager.js b/dist/managers/MinecraftConnectionManager.js new file mode 100644 index 0000000..89c12e6 --- /dev/null +++ b/dist/managers/MinecraftConnectionManager.js @@ -0,0 +1,94 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MinecraftConnectionManager = void 0; +const mc_server_management_1 = require("mc-server-management"); +const forgescript_1 = require("@tryforge/forgescript"); +const tiny_typed_emitter_1 = require("tiny-typed-emitter"); +class MinecraftConnectionManager extends tiny_typed_emitter_1.TypedEmitter { + options; + emitter; + connection; + server; + constructor(options, emitter) { + super(); + this.options = options; + this.emitter = emitter; + } + async connect(client) { + forgescript_1.Logger.info("[ForgeMinecraft] Connecting to management server..."); + const { host, port, token, reconnect, reconnectInterval, maxReconnectAttempts } = this.options; + const connection = await mc_server_management_1.WebSocketConnection.connect(`ws://${host}:${port}`, token, { + reconnect, + reconnect_interval: reconnectInterval, + max_reconnects: maxReconnectAttempts + }).catch(() => undefined); + if (!connection) { + forgescript_1.Logger.warn("[ForgeMinecraft] Management connection could not be established."); + return; + } + this.connection = connection; + this.server = new mc_server_management_1.MinecraftServer(connection); + forgescript_1.Logger.info("[ForgeMinecraft] Management connection established."); + this._attachSocketListeners(connection); + this.emit("connected", this.server); + const onReady = () => { + this.emitter.emit("connected"); + this._attachServerListeners(this.server); + }; + if (client.isReady()) + onReady(); + else + client.once("clientReady", () => onReady()); + } + _attachSocketListeners(connection) { + connection.on("open", () => { + forgescript_1.Logger.info("[ForgeMinecraft] Management connection established."); + this.emitter.emit("connected"); + }); + connection.on("close", () => { + forgescript_1.Logger.warn("[ForgeMinecraft] Management connection closed."); + // this.emit("disconnected") + this.emitter.emit("disconnected"); + if (this.options.reconnect !== false) { + forgescript_1.Logger.info("[ForgeMinecraft] Reconnecting to management server..."); + // this.emit("reconnecting") + this.emitter.emit("reconnecting"); + } + }); + connection.on("max_reconnects_reached", () => { + forgescript_1.Logger.warn("[ForgeMinecraft] Maximum reconnect attempts reached. Connection closed."); + }); + connection.on("error", (err) => { + forgescript_1.Logger.debug("[ForgeMinecraft] Management socket error:", err.message); + }); + } + _attachServerListeners(server) { + const events = [ + ["error", "error"], + [mc_server_management_1.Notifications.ALLOWLIST_ADDED, "allowListAdded"], + [mc_server_management_1.Notifications.ALLOWLIST_REMOVED, "allowListRemoved"], + [mc_server_management_1.Notifications.BAN_ADDED, "banAdded"], + [mc_server_management_1.Notifications.BAN_REMOVED, "banRemoved"], + [mc_server_management_1.Notifications.GAME_RULE_UPDATED, "gameRuleUpdated"], + [mc_server_management_1.Notifications.IP_BAN_ADDED, "ipBanAdded"], + [mc_server_management_1.Notifications.IP_BAN_REMOVED, "ipBanRemoved"], + [mc_server_management_1.Notifications.OPERATOR_ADDED, "operatorAdded"], + [mc_server_management_1.Notifications.OPERATOR_REMOVED, "operatorRemoved"], + [mc_server_management_1.Notifications.PLAYER_JOINED, "playerJoined"], + [mc_server_management_1.Notifications.PLAYER_LEFT, "playerLeft"], + [mc_server_management_1.Notifications.SERVER_ACTIVITY, "serverActivity"], + [mc_server_management_1.Notifications.SERVER_SAVED, "serverSaved"], + [mc_server_management_1.Notifications.SERVER_SAVING, "serverSaving"], + [mc_server_management_1.Notifications.SERVER_STARTED, "serverStarted"], + [mc_server_management_1.Notifications.SERVER_STATUS, "serverStatus"], + [mc_server_management_1.Notifications.SERVER_STOPPING, "serverStopping"] + ]; + for (const [event, targetEvent] of events) { + server.on(event, (...data) => { + this.emitter.emit(targetEvent, ...data); + }); + } + } +} +exports.MinecraftConnectionManager = MinecraftConnectionManager; +//# sourceMappingURL=MinecraftConnectionManager.js.map \ No newline at end of file diff --git a/dist/managers/MinecraftConnectionManager.js.map b/dist/managers/MinecraftConnectionManager.js.map new file mode 100644 index 0000000..4de9344 --- /dev/null +++ b/dist/managers/MinecraftConnectionManager.js.map @@ -0,0 +1 @@ +{"version":3,"file":"MinecraftConnectionManager.js","sourceRoot":"","sources":["../../src/managers/MinecraftConnectionManager.ts"],"names":[],"mappings":";;;AAAA,+DAAqG;AACrG,uDAA2D;AAC3D,2DAAiD;AAUjD,MAAa,0BAA2B,SAAQ,iCAA+B;IAKtD;IACA;IALd,UAAU,CAAsB;IAChC,MAAM,CAAkB;IAE/B,YACqB,OAAiC,EACjC,OAAwD;QAEzE,KAAK,EAAE,CAAA;QAHU,YAAO,GAAP,OAAO,CAA0B;QACjC,YAAO,GAAP,OAAO,CAAiD;IAG7E,CAAC;IAEM,KAAK,CAAC,OAAO,CAAC,MAAmB;QACpC,oBAAM,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAA;QAElE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,GAAG,IAAI,CAAC,OAAO,CAAA;QAC9F,MAAM,UAAU,GAAG,MAAM,0CAAmB,CAAC,OAAO,CAAC,QAAQ,IAAI,IAAI,IAAI,EAAE,EAAE,KAAK,EAAE;YAChF,SAAS;YACT,kBAAkB,EAAE,iBAAiB;YACrC,cAAc,EAAE,oBAAoB;SACvC,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC,SAAS,CAAC,CAAA;QAEzB,IAAI,CAAC,UAAU,EAAE,CAAC;YACd,oBAAM,CAAC,IAAI,CAAC,kEAAkE,CAAC,CAAA;YAC/E,OAAM;QACV,CAAC;QAED,IAAI,CAAC,UAAU,GAAG,UAAU,CAAA;QAC5B,IAAI,CAAC,MAAM,GAAG,IAAI,sCAAe,CAAC,UAAU,CAAC,CAAA;QAE7C,oBAAM,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAA;QAElE,IAAI,CAAC,sBAAsB,CAAC,UAAU,CAAC,CAAA;QACvC,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,CAAA;QAEnC,MAAM,OAAO,GAAG,GAAG,EAAE;YACjB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;YAC9B,IAAI,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAO,CAAC,CAAA;QAC7C,CAAC,CAAA;QAED,IAAI,MAAM,CAAC,OAAO,EAAa;YAAE,OAAO,EAAE,CAAA;;YACrC,MAAM,CAAC,IAAI,CAAC,aAAa,EAAE,GAAG,EAAE,CAAC,OAAO,EAAE,CAAC,CAAA;IACpD,CAAC;IAEO,sBAAsB,CAAC,UAA+B;QAC1D,UAAU,CAAC,EAAE,CAAC,MAAM,EAAE,GAAG,EAAE;YACvB,oBAAM,CAAC,IAAI,CAAC,qDAAqD,CAAC,CAAA;YAClE,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,CAAC,CAAA;QAClC,CAAC,CAAC,CAAA;QAEF,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YACxB,oBAAM,CAAC,IAAI,CAAC,gDAAgD,CAAC,CAAA;YAC7D,4BAA4B;YAC5B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;YAEjC,IAAI,IAAI,CAAC,OAAO,CAAC,SAAS,KAAK,KAAK,EAAE,CAAC;gBACnC,oBAAM,CAAC,IAAI,CAAC,uDAAuD,CAAC,CAAA;gBACpE,4BAA4B;gBAC5B,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,cAAc,CAAC,CAAA;YACrC,CAAC;QACL,CAAC,CAAC,CAAA;QAEF,UAAU,CAAC,EAAE,CAAC,wBAAwB,EAAE,GAAG,EAAE;YACzC,oBAAM,CAAC,IAAI,CAAC,yEAAyE,CAAC,CAAA;QAC1F,CAAC,CAAC,CAAA;QAEF,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YAC3B,oBAAM,CAAC,KAAK,CAAC,2CAA2C,EAAE,GAAG,CAAC,OAAO,CAAC,CAAA;QAC1E,CAAC,CAAC,CAAA;IACN,CAAC;IAEO,sBAAsB,CAAC,MAAuB;QAClD,MAAM,MAAM,GAAqD;YAC7D,CAAC,OAAO,EAAE,OAAO,CAAC;YAClB,CAAC,oCAAa,CAAC,eAAe,EAAE,gBAAgB,CAAC;YACjD,CAAC,oCAAa,CAAC,iBAAiB,EAAE,kBAAkB,CAAC;YACrD,CAAC,oCAAa,CAAC,SAAS,EAAE,UAAU,CAAC;YACrC,CAAC,oCAAa,CAAC,WAAW,EAAE,YAAY,CAAC;YACzC,CAAC,oCAAa,CAAC,iBAAiB,EAAE,iBAAiB,CAAC;YACpD,CAAC,oCAAa,CAAC,YAAY,EAAE,YAAY,CAAC;YAC1C,CAAC,oCAAa,CAAC,cAAc,EAAE,cAAc,CAAC;YAC9C,CAAC,oCAAa,CAAC,cAAc,EAAE,eAAe,CAAC;YAC/C,CAAC,oCAAa,CAAC,gBAAgB,EAAE,iBAAiB,CAAC;YACnD,CAAC,oCAAa,CAAC,aAAa,EAAE,cAAc,CAAC;YAC7C,CAAC,oCAAa,CAAC,WAAW,EAAE,YAAY,CAAC;YACzC,CAAC,oCAAa,CAAC,eAAe,EAAE,gBAAgB,CAAC;YACjD,CAAC,oCAAa,CAAC,YAAY,EAAE,aAAa,CAAC;YAC3C,CAAC,oCAAa,CAAC,aAAa,EAAE,cAAc,CAAC;YAC7C,CAAC,oCAAa,CAAC,cAAc,EAAE,eAAe,CAAC;YAC/C,CAAC,oCAAa,CAAC,aAAa,EAAE,cAAc,CAAC;YAC7C,CAAC,oCAAa,CAAC,eAAe,EAAE,gBAAgB,CAAC;SACpD,CAAA;QAED,KAAK,MAAM,CAAC,KAAK,EAAE,WAAW,CAAC,IAAI,MAAM,EAAE,CAAC;YACxC,MAAM,CAAC,EAAE,CAAC,KAAK,EAAE,CAAC,GAAG,IAAI,EAAE,EAAE;gBACzB,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,CAAA;YAC3C,CAAC,CAAC,CAAA;QACN,CAAC;IACL,CAAC;CACJ;AAlGD,gEAkGC"} \ No newline at end of file diff --git a/dist/managers/index.d.ts b/dist/managers/index.d.ts new file mode 100644 index 0000000..a7df112 --- /dev/null +++ b/dist/managers/index.d.ts @@ -0,0 +1,3 @@ +export * from "./MinecraftCommandManager"; +export * from "./MinecraftConnectionManager"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/managers/index.d.ts.map b/dist/managers/index.d.ts.map new file mode 100644 index 0000000..316881e --- /dev/null +++ b/dist/managers/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/managers/index.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAA;AACzC,cAAc,8BAA8B,CAAA"} \ No newline at end of file diff --git a/dist/managers/index.js b/dist/managers/index.js new file mode 100644 index 0000000..1062e0c --- /dev/null +++ b/dist/managers/index.js @@ -0,0 +1,19 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./MinecraftCommandManager"), exports); +__exportStar(require("./MinecraftConnectionManager"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/managers/index.js.map b/dist/managers/index.js.map new file mode 100644 index 0000000..97b8223 --- /dev/null +++ b/dist/managers/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/managers/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4DAAyC;AACzC,+DAA4C"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockEdition.d.ts b/dist/native/bedrock/bedrockEdition.d.ts new file mode 100644 index 0000000..1785b95 --- /dev/null +++ b/dist/native/bedrock/bedrockEdition.d.ts @@ -0,0 +1,18 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +export declare enum BedrockEdition { + MCPE = 0, + MCEE = 1 +} +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=bedrockEdition.d.ts.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockEdition.d.ts.map b/dist/native/bedrock/bedrockEdition.d.ts.map new file mode 100644 index 0000000..27353b2 --- /dev/null +++ b/dist/native/bedrock/bedrockEdition.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockEdition.d.ts","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockEdition.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE/D,oBAAY,cAAc;IACtB,IAAI,IAAA;IACJ,IAAI,IAAA;CACP;;;;;;;;;;;;AAED,wBAwBE"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockEdition.js b/dist/native/bedrock/bedrockEdition.js new file mode 100644 index 0000000..13535e3 --- /dev/null +++ b/dist/native/bedrock/bedrockEdition.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.BedrockEdition = void 0; +const forgescript_1 = require("@tryforge/forgescript"); +var BedrockEdition; +(function (BedrockEdition) { + BedrockEdition[BedrockEdition["MCPE"] = 0] = "MCPE"; + BedrockEdition[BedrockEdition["MCEE"] = 1] = "MCEE"; +})(BedrockEdition || (exports.BedrockEdition = BedrockEdition = {})); +exports.default = new forgescript_1.NativeFunction({ + name: "$bedrockEdition", + version: "1.0.0", + description: "Returns the edition of a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: BedrockEdition, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.edition); + } +}); +//# sourceMappingURL=bedrockEdition.js.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockEdition.js.map b/dist/native/bedrock/bedrockEdition.js.map new file mode 100644 index 0000000..5fed910 --- /dev/null +++ b/dist/native/bedrock/bedrockEdition.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockEdition.js","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockEdition.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAE/D,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,mDAAI,CAAA;IACJ,mDAAI,CAAA;AACR,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,yCAAyC;IACtD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,cAAc;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;IACxH,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockEulaBlocked.d.ts b/dist/native/bedrock/bedrockEulaBlocked.d.ts new file mode 100644 index 0000000..ac2f663 --- /dev/null +++ b/dist/native/bedrock/bedrockEulaBlocked.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=bedrockEulaBlocked.d.ts.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockEulaBlocked.d.ts.map b/dist/native/bedrock/bedrockEulaBlocked.d.ts.map new file mode 100644 index 0000000..10c94ef --- /dev/null +++ b/dist/native/bedrock/bedrockEulaBlocked.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockEulaBlocked.d.ts","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockEulaBlocked.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE/D,wBAwBE"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockEulaBlocked.js b/dist/native/bedrock/bedrockEulaBlocked.js new file mode 100644 index 0000000..ac7bbf5 --- /dev/null +++ b/dist/native/bedrock/bedrockEulaBlocked.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$bedrockEulaBlocked", + version: "1.0.0", + description: "Returns whether a bedrock server has EULA blocked", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.eula_blocked); + } +}); +//# sourceMappingURL=bedrockEulaBlocked.js.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockEulaBlocked.js.map b/dist/native/bedrock/bedrockEulaBlocked.js.map new file mode 100644 index 0000000..9ce98cc --- /dev/null +++ b/dist/native/bedrock/bedrockEulaBlocked.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockEulaBlocked.js","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockEulaBlocked.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,mDAAmD;IAChE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,YAAY,CAAC,CAAA;IAC7H,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockGameMode.d.ts b/dist/native/bedrock/bedrockGameMode.d.ts new file mode 100644 index 0000000..22e9b39 --- /dev/null +++ b/dist/native/bedrock/bedrockGameMode.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=bedrockGameMode.d.ts.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockGameMode.d.ts.map b/dist/native/bedrock/bedrockGameMode.d.ts.map new file mode 100644 index 0000000..d2eb251 --- /dev/null +++ b/dist/native/bedrock/bedrockGameMode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockGameMode.d.ts","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockGameMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAG/D,wBAwBE"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockGameMode.js b/dist/native/bedrock/bedrockGameMode.js new file mode 100644 index 0000000..a0a9236 --- /dev/null +++ b/dist/native/bedrock/bedrockGameMode.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const types_1 = require("../../types"); +exports.default = new forgescript_1.NativeFunction({ + name: "$bedrockGameMode", + version: "1.0.0", + description: "Returns the game mode of a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: types_1.GameMode, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.gamemode); + } +}); +//# sourceMappingURL=bedrockGameMode.js.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockGameMode.js.map b/dist/native/bedrock/bedrockGameMode.js.map new file mode 100644 index 0000000..40c5485 --- /dev/null +++ b/dist/native/bedrock/bedrockGameMode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockGameMode.js","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockGameMode.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAC/D,uCAAsC;AAEtC,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,2CAA2C;IACxD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,gBAAQ;IAChB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;IACzH,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockHost.d.ts b/dist/native/bedrock/bedrockHost.d.ts new file mode 100644 index 0000000..749f05e --- /dev/null +++ b/dist/native/bedrock/bedrockHost.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=bedrockHost.d.ts.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockHost.d.ts.map b/dist/native/bedrock/bedrockHost.d.ts.map new file mode 100644 index 0000000..5558ecf --- /dev/null +++ b/dist/native/bedrock/bedrockHost.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockHost.d.ts","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockHost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockHost.js b/dist/native/bedrock/bedrockHost.js new file mode 100644 index 0000000..fe3fa21 --- /dev/null +++ b/dist/native/bedrock/bedrockHost.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$bedrockHost", + version: "1.0.0", + description: "Returns the host name of the bedrock server", + unwrap: false, + output: forgescript_1.ArgType.String, + async execute(ctx) { + return this.success((await ctx.client.minecraft.getBedrockStatus().catch(ctx.noop))?.host); + } +}); +//# sourceMappingURL=bedrockHost.js.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockHost.js.map b/dist/native/bedrock/bedrockHost.js.map new file mode 100644 index 0000000..178c315 --- /dev/null +++ b/dist/native/bedrock/bedrockHost.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockHost.js","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockHost.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,6CAA6C;IAC1D,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;IAC9F,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockIPAddress.d.ts b/dist/native/bedrock/bedrockIPAddress.d.ts new file mode 100644 index 0000000..178ce4a --- /dev/null +++ b/dist/native/bedrock/bedrockIPAddress.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=bedrockIPAddress.d.ts.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockIPAddress.d.ts.map b/dist/native/bedrock/bedrockIPAddress.d.ts.map new file mode 100644 index 0000000..00d8850 --- /dev/null +++ b/dist/native/bedrock/bedrockIPAddress.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockIPAddress.d.ts","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockIPAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE/D,wBAyBE"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockIPAddress.js b/dist/native/bedrock/bedrockIPAddress.js new file mode 100644 index 0000000..fcda03c --- /dev/null +++ b/dist/native/bedrock/bedrockIPAddress.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$bedrockIPAddress", + version: "1.0.0", + description: "Returns the IP address of a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.String, + async execute(ctx, [host, port]) { + const status = await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop); + return this.success(status && "ip_address" in status ? status?.ip_address : null); + } +}); +//# sourceMappingURL=bedrockIPAddress.js.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockIPAddress.js.map b/dist/native/bedrock/bedrockIPAddress.js.map new file mode 100644 index 0000000..b8c8979 --- /dev/null +++ b/dist/native/bedrock/bedrockIPAddress.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockIPAddress.js","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockIPAddress.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,4CAA4C;IACzD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACnG,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,YAAY,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACrF,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockMOTD.d.ts b/dist/native/bedrock/bedrockMOTD.d.ts new file mode 100644 index 0000000..00c9fcf --- /dev/null +++ b/dist/native/bedrock/bedrockMOTD.d.ts @@ -0,0 +1,21 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { MOTDProperty } from "../java/javaMOTD"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof MOTDProperty; +}], true>; +export default _default; +//# sourceMappingURL=bedrockMOTD.d.ts.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockMOTD.d.ts.map b/dist/native/bedrock/bedrockMOTD.d.ts.map new file mode 100644 index 0000000..fb61865 --- /dev/null +++ b/dist/native/bedrock/bedrockMOTD.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockMOTD.d.ts","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockMOTD.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;;;;;;;;;;;;;;;;;;AAE/C,wBAoCE"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockMOTD.js b/dist/native/bedrock/bedrockMOTD.js new file mode 100644 index 0000000..7197a6d --- /dev/null +++ b/dist/native/bedrock/bedrockMOTD.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const javaMOTD_1 = require("../java/javaMOTD"); +exports.default = new forgescript_1.NativeFunction({ + name: "$bedrockMOTD", + version: "1.0.0", + description: "Returns the message of the day (MOTD) from a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: javaMOTD_1.MOTDProperty, + }, + ], + output: [ + forgescript_1.ArgType.Json, + forgescript_1.ArgType.Unknown + ], + async execute(ctx, [host, port, prop]) { + const motd = (await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.motd; + if (!motd || prop) + return this.success(motd?.[prop]); + return this.successJSON(motd); + } +}); +//# sourceMappingURL=bedrockMOTD.js.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockMOTD.js.map b/dist/native/bedrock/bedrockMOTD.js.map new file mode 100644 index 0000000..f3b09be --- /dev/null +++ b/dist/native/bedrock/bedrockMOTD.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockMOTD.js","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockMOTD.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAC/D,+CAA+C;AAE/C,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,6DAA6D;IAC1E,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,uBAAY;SACrB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,qBAAO,CAAC,OAAO;KAClB;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;QACjC,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAA;QACzG,IAAI,CAAC,IAAI,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,IAAK,CAAC,CAAC,CAAA;QACrD,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockMaxPlayers.d.ts b/dist/native/bedrock/bedrockMaxPlayers.d.ts new file mode 100644 index 0000000..a05e936 --- /dev/null +++ b/dist/native/bedrock/bedrockMaxPlayers.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=bedrockMaxPlayers.d.ts.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockMaxPlayers.d.ts.map b/dist/native/bedrock/bedrockMaxPlayers.d.ts.map new file mode 100644 index 0000000..0744ee4 --- /dev/null +++ b/dist/native/bedrock/bedrockMaxPlayers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockMaxPlayers.d.ts","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockMaxPlayers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE/D,wBAwBE"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockMaxPlayers.js b/dist/native/bedrock/bedrockMaxPlayers.js new file mode 100644 index 0000000..72ade86 --- /dev/null +++ b/dist/native/bedrock/bedrockMaxPlayers.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$bedrockMaxPlayers", + version: "1.0.0", + description: "Returns the maximum amount of allowed players on a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.Number, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.players?.max); + } +}); +//# sourceMappingURL=bedrockMaxPlayers.js.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockMaxPlayers.js.map b/dist/native/bedrock/bedrockMaxPlayers.js.map new file mode 100644 index 0000000..81413c2 --- /dev/null +++ b/dist/native/bedrock/bedrockMaxPlayers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockMaxPlayers.js","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockMaxPlayers.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,mEAAmE;IAChF,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAC7H,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockPlayerCount.d.ts b/dist/native/bedrock/bedrockPlayerCount.d.ts new file mode 100644 index 0000000..8e8f384 --- /dev/null +++ b/dist/native/bedrock/bedrockPlayerCount.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=bedrockPlayerCount.d.ts.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockPlayerCount.d.ts.map b/dist/native/bedrock/bedrockPlayerCount.d.ts.map new file mode 100644 index 0000000..656da6f --- /dev/null +++ b/dist/native/bedrock/bedrockPlayerCount.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockPlayerCount.d.ts","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockPlayerCount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE/D,wBAwBE"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockPlayerCount.js b/dist/native/bedrock/bedrockPlayerCount.js new file mode 100644 index 0000000..f84094e --- /dev/null +++ b/dist/native/bedrock/bedrockPlayerCount.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$bedrockPlayerCount", + version: "1.0.0", + description: "Returns the online player count of a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.Number, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.players?.online); + } +}); +//# sourceMappingURL=bedrockPlayerCount.js.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockPlayerCount.js.map b/dist/native/bedrock/bedrockPlayerCount.js.map new file mode 100644 index 0000000..0d21f09 --- /dev/null +++ b/dist/native/bedrock/bedrockPlayerCount.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockPlayerCount.js","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockPlayerCount.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,qDAAqD;IAClE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;IAChI,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockPort.d.ts b/dist/native/bedrock/bedrockPort.d.ts new file mode 100644 index 0000000..0e00b73 --- /dev/null +++ b/dist/native/bedrock/bedrockPort.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=bedrockPort.d.ts.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockPort.d.ts.map b/dist/native/bedrock/bedrockPort.d.ts.map new file mode 100644 index 0000000..a35074f --- /dev/null +++ b/dist/native/bedrock/bedrockPort.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockPort.d.ts","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockPort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockPort.js b/dist/native/bedrock/bedrockPort.js new file mode 100644 index 0000000..df4ce67 --- /dev/null +++ b/dist/native/bedrock/bedrockPort.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$bedrockPort", + version: "1.0.0", + description: "Returns the port of the bedrock server", + unwrap: false, + output: forgescript_1.ArgType.Number, + async execute(ctx) { + return this.success((await ctx.client.minecraft.getBedrockStatus().catch(ctx.noop))?.port); + } +}); +//# sourceMappingURL=bedrockPort.js.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockPort.js.map b/dist/native/bedrock/bedrockPort.js.map new file mode 100644 index 0000000..9a7487e --- /dev/null +++ b/dist/native/bedrock/bedrockPort.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockPort.js","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockPort.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,wCAAwC;IACrD,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;IAC9F,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockServerID.d.ts b/dist/native/bedrock/bedrockServerID.d.ts new file mode 100644 index 0000000..0313e26 --- /dev/null +++ b/dist/native/bedrock/bedrockServerID.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=bedrockServerID.d.ts.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockServerID.d.ts.map b/dist/native/bedrock/bedrockServerID.d.ts.map new file mode 100644 index 0000000..a2c180e --- /dev/null +++ b/dist/native/bedrock/bedrockServerID.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockServerID.d.ts","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockServerID.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE/D,wBAwBE"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockServerID.js b/dist/native/bedrock/bedrockServerID.js new file mode 100644 index 0000000..a3fa34d --- /dev/null +++ b/dist/native/bedrock/bedrockServerID.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$bedrockServerID", + version: "1.0.0", + description: "Returns the server ID of a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.String, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.server_id); + } +}); +//# sourceMappingURL=bedrockServerID.js.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockServerID.js.map b/dist/native/bedrock/bedrockServerID.js.map new file mode 100644 index 0000000..410dc1b --- /dev/null +++ b/dist/native/bedrock/bedrockServerID.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockServerID.js","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockServerID.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,2CAA2C;IACxD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,SAAS,CAAC,CAAA;IAC1H,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockServerOnline.d.ts b/dist/native/bedrock/bedrockServerOnline.d.ts new file mode 100644 index 0000000..6da9dab --- /dev/null +++ b/dist/native/bedrock/bedrockServerOnline.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=bedrockServerOnline.d.ts.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockServerOnline.d.ts.map b/dist/native/bedrock/bedrockServerOnline.d.ts.map new file mode 100644 index 0000000..e5fdd9c --- /dev/null +++ b/dist/native/bedrock/bedrockServerOnline.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockServerOnline.d.ts","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockServerOnline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE/D,wBAwBE"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockServerOnline.js b/dist/native/bedrock/bedrockServerOnline.js new file mode 100644 index 0000000..bd9227b --- /dev/null +++ b/dist/native/bedrock/bedrockServerOnline.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$bedrockServerOnline", + version: "1.0.0", + description: "Returns whether a bedrock server is online", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.online); + } +}); +//# sourceMappingURL=bedrockServerOnline.js.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockServerOnline.js.map b/dist/native/bedrock/bedrockServerOnline.js.map new file mode 100644 index 0000000..e6c1766 --- /dev/null +++ b/dist/native/bedrock/bedrockServerOnline.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockServerOnline.js","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockServerOnline.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,4CAA4C;IACzD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IACvH,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockVersion.d.ts b/dist/native/bedrock/bedrockVersion.d.ts new file mode 100644 index 0000000..f8c9855 --- /dev/null +++ b/dist/native/bedrock/bedrockVersion.d.ts @@ -0,0 +1,21 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { VersionProperty } from "../management/getServerVersion"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof VersionProperty; +}], true>; +export default _default; +//# sourceMappingURL=bedrockVersion.d.ts.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockVersion.d.ts.map b/dist/native/bedrock/bedrockVersion.d.ts.map new file mode 100644 index 0000000..c7f3b85 --- /dev/null +++ b/dist/native/bedrock/bedrockVersion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockVersion.d.ts","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;;;;;;;;;;;;;;;;;;AAEhE,wBAoCE"} \ No newline at end of file diff --git a/dist/native/bedrock/bedrockVersion.js b/dist/native/bedrock/bedrockVersion.js new file mode 100644 index 0000000..578a343 --- /dev/null +++ b/dist/native/bedrock/bedrockVersion.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const getServerVersion_1 = require("../management/getServerVersion"); +exports.default = new forgescript_1.NativeFunction({ + name: "$bedrockVersion", + version: "1.0.0", + description: "Returns the version of a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: getServerVersion_1.VersionProperty, + }, + ], + output: [ + forgescript_1.ArgType.Json, + forgescript_1.ArgType.Unknown + ], + async execute(ctx, [host, port, prop]) { + const version = (await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.version; + if (!version || prop) + return this.success(version?.[prop]); + return this.successJSON(version); + } +}); +//# sourceMappingURL=bedrockVersion.js.map \ No newline at end of file diff --git a/dist/native/bedrock/bedrockVersion.js.map b/dist/native/bedrock/bedrockVersion.js.map new file mode 100644 index 0000000..1c70d9c --- /dev/null +++ b/dist/native/bedrock/bedrockVersion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"bedrockVersion.js","sourceRoot":"","sources":["../../../src/native/bedrock/bedrockVersion.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAC/D,qEAAgE;AAEhE,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,yCAAyC;IACtD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,kCAAe;SACxB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,qBAAO,CAAC,OAAO;KAClB;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;QACjC,MAAM,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,gBAAgB,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAA;QAC/G,IAAI,CAAC,OAAO,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,IAAK,CAAC,CAAC,CAAA;QAC3D,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/event/gameRule.d.ts b/dist/native/event/gameRule.d.ts new file mode 100644 index 0000000..01c90f8 --- /dev/null +++ b/dist/native/event/gameRule.d.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { GameRuleProperty } from "../../properties/gameRule"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Enum; + enum: typeof GameRuleProperty; +}], true>; +export default _default; +//# sourceMappingURL=gameRule.d.ts.map \ No newline at end of file diff --git a/dist/native/event/gameRule.d.ts.map b/dist/native/event/gameRule.d.ts.map new file mode 100644 index 0000000..afc5b8f --- /dev/null +++ b/dist/native/event/gameRule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gameRule.d.ts","sourceRoot":"","sources":["../../../src/native/event/gameRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAsB,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;;;;;;;;;AAEhF,wBAyBE"} \ No newline at end of file diff --git a/dist/native/event/gameRule.js b/dist/native/event/gameRule.js new file mode 100644 index 0000000..aae78cd --- /dev/null +++ b/dist/native/event/gameRule.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const gameRule_1 = require("../../properties/gameRule"); +exports.default = new forgescript_1.NativeFunction({ + name: "$gameRule", + version: "1.0.0", + description: "Retrieves data from an event whose context was a game rule event", + unwrap: true, + brackets: false, + args: [ + { + name: "property", + description: "The property to pull", + rest: false, + required: true, + type: forgescript_1.ArgType.Enum, + enum: gameRule_1.GameRuleProperty, + }, + ], + output: [ + forgescript_1.ArgType.Json, + forgescript_1.ArgType.Unknown + ], + execute(ctx, [prop]) { + const rule = ctx.gameRule; + if (!rule || prop) + return this.success(gameRule_1.GameRuleProperties[prop](rule)); + return this.successJSON(rule); + }, +}); +//# sourceMappingURL=gameRule.js.map \ No newline at end of file diff --git a/dist/native/event/gameRule.js.map b/dist/native/event/gameRule.js.map new file mode 100644 index 0000000..c7c7dfc --- /dev/null +++ b/dist/native/event/gameRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gameRule.js","sourceRoot":"","sources":["../../../src/native/event/gameRule.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAC/D,wDAAgF;AAEhF,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,kEAAkE;IAC/E,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,2BAAgB;SACzB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,qBAAO,CAAC,OAAO;KAClB;IACD,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QACf,MAAM,IAAI,GAAG,GAAG,CAAC,QAAQ,CAAA;QACzB,IAAI,CAAC,IAAI,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,6BAAkB,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,CAAC,CAAA;QACtE,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/event/ipBan.d.ts b/dist/native/event/ipBan.d.ts new file mode 100644 index 0000000..fcfcccd --- /dev/null +++ b/dist/native/event/ipBan.d.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { IPBanProperty } from "../../properties/ban"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Enum; + enum: typeof IPBanProperty; +}], true>; +export default _default; +//# sourceMappingURL=ipBan.d.ts.map \ No newline at end of file diff --git a/dist/native/event/ipBan.d.ts.map b/dist/native/event/ipBan.d.ts.map new file mode 100644 index 0000000..1bf64c9 --- /dev/null +++ b/dist/native/event/ipBan.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ipBan.d.ts","sourceRoot":"","sources":["../../../src/native/event/ipBan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAmB,aAAa,EAAE,MAAM,sBAAsB,CAAA;;;;;;;;;AAErE,wBAyBE"} \ No newline at end of file diff --git a/dist/native/event/ipBan.js b/dist/native/event/ipBan.js new file mode 100644 index 0000000..019feb7 --- /dev/null +++ b/dist/native/event/ipBan.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const ban_1 = require("../../properties/ban"); +exports.default = new forgescript_1.NativeFunction({ + name: "$ipBan", + version: "1.0.0", + description: "Retrieves data from an event whose context was an IP ban event", + unwrap: true, + brackets: false, + args: [ + { + name: "property", + description: "The property to pull", + rest: false, + required: true, + type: forgescript_1.ArgType.Enum, + enum: ban_1.IPBanProperty, + }, + ], + output: [ + forgescript_1.ArgType.Json, + forgescript_1.ArgType.Unknown + ], + execute(ctx, [prop]) { + const ban = ctx.ipBan; + if (!ban || prop) + return this.success(ban_1.IPBanProperties[prop](ban)); + return this.successJSON(ban); + }, +}); +//# sourceMappingURL=ipBan.js.map \ No newline at end of file diff --git a/dist/native/event/ipBan.js.map b/dist/native/event/ipBan.js.map new file mode 100644 index 0000000..03e44be --- /dev/null +++ b/dist/native/event/ipBan.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ipBan.js","sourceRoot":"","sources":["../../../src/native/event/ipBan.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAC/D,8CAAqE;AAErE,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,QAAQ;IACd,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gEAAgE;IAC7E,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,mBAAa;SACtB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,qBAAO,CAAC,OAAO;KAClB;IACD,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QACf,MAAM,GAAG,GAAG,GAAG,CAAC,KAAK,CAAA;QACrB,IAAI,CAAC,GAAG,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,qBAAe,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QACjE,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;IAChC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/event/operator.d.ts b/dist/native/event/operator.d.ts new file mode 100644 index 0000000..f3ba758 --- /dev/null +++ b/dist/native/event/operator.d.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { OperatorProperty } from "../../properties/operator"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Enum; + enum: typeof OperatorProperty; +}], true>; +export default _default; +//# sourceMappingURL=operator.d.ts.map \ No newline at end of file diff --git a/dist/native/event/operator.d.ts.map b/dist/native/event/operator.d.ts.map new file mode 100644 index 0000000..d665274 --- /dev/null +++ b/dist/native/event/operator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../../src/native/event/operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAsB,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;;;;;;;;;AAEhF,wBAyBE"} \ No newline at end of file diff --git a/dist/native/event/operator.js b/dist/native/event/operator.js new file mode 100644 index 0000000..f832b22 --- /dev/null +++ b/dist/native/event/operator.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const operator_1 = require("../../properties/operator"); +exports.default = new forgescript_1.NativeFunction({ + name: "$operator", + version: "1.0.0", + description: "Retrieves data from an event whose context was an operator event", + unwrap: true, + brackets: false, + args: [ + { + name: "property", + description: "The property to pull", + rest: false, + required: true, + type: forgescript_1.ArgType.Enum, + enum: operator_1.OperatorProperty, + }, + ], + output: [ + forgescript_1.ArgType.Json, + forgescript_1.ArgType.Unknown + ], + execute(ctx, [prop]) { + const operator = ctx.operator; + if (!operator || prop) + return this.success(operator_1.OperatorProperties[prop](operator)); + return this.successJSON(operator); + }, +}); +//# sourceMappingURL=operator.js.map \ No newline at end of file diff --git a/dist/native/event/operator.js.map b/dist/native/event/operator.js.map new file mode 100644 index 0000000..c7f1d13 --- /dev/null +++ b/dist/native/event/operator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"operator.js","sourceRoot":"","sources":["../../../src/native/event/operator.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAC/D,wDAAgF;AAEhF,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,kEAAkE;IAC/E,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,2BAAgB;SACzB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,qBAAO,CAAC,OAAO;KAClB;IACD,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QACf,MAAM,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAA;QAC7B,IAAI,CAAC,QAAQ,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,6BAAkB,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAA;QAC9E,OAAO,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;IACrC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/event/player.d.ts b/dist/native/event/player.d.ts new file mode 100644 index 0000000..4981d9b --- /dev/null +++ b/dist/native/event/player.d.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { PlayerProperty } from "../management/getConnectedPlayers"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Enum; + enum: typeof PlayerProperty; +}], true>; +export default _default; +//# sourceMappingURL=player.d.ts.map \ No newline at end of file diff --git a/dist/native/event/player.d.ts.map b/dist/native/event/player.d.ts.map new file mode 100644 index 0000000..334f5f6 --- /dev/null +++ b/dist/native/event/player.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"player.d.ts","sourceRoot":"","sources":["../../../src/native/event/player.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,mCAAmC,CAAA;;;;;;;;;AAElE,wBAyBE"} \ No newline at end of file diff --git a/dist/native/event/player.js b/dist/native/event/player.js new file mode 100644 index 0000000..bf07c7f --- /dev/null +++ b/dist/native/event/player.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const getConnectedPlayers_1 = require("../management/getConnectedPlayers"); +exports.default = new forgescript_1.NativeFunction({ + name: "$player", + version: "1.0.0", + description: "Retrieves data from an event whose context was a player event", + unwrap: true, + brackets: false, + args: [ + { + name: "property", + description: "The property to pull", + rest: false, + required: true, + type: forgescript_1.ArgType.Enum, + enum: getConnectedPlayers_1.PlayerProperty, + }, + ], + output: [ + forgescript_1.ArgType.Json, + forgescript_1.ArgType.Unknown + ], + execute(ctx, [prop]) { + const player = ctx.player; + if (!player || prop) + return this.success(player?.[prop]); + return this.successJSON(player); + }, +}); +//# sourceMappingURL=player.js.map \ No newline at end of file diff --git a/dist/native/event/player.js.map b/dist/native/event/player.js.map new file mode 100644 index 0000000..ab256d4 --- /dev/null +++ b/dist/native/event/player.js.map @@ -0,0 +1 @@ +{"version":3,"file":"player.js","sourceRoot":"","sources":["../../../src/native/event/player.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAC/D,2EAAkE;AAElE,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,SAAS;IACf,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,+DAA+D;IAC5E,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,oCAAc;SACvB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,qBAAO,CAAC,OAAO;KAClB;IACD,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QACf,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAA;QACzB,IAAI,CAAC,MAAM,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,CAAC,IAAI,CAAC,CAAC,CAAA;QACxD,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;IACnC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/event/playerBan.d.ts b/dist/native/event/playerBan.d.ts new file mode 100644 index 0000000..aa282b5 --- /dev/null +++ b/dist/native/event/playerBan.d.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { UserBanProperty } from "../../properties/ban"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Enum; + enum: typeof UserBanProperty; +}], true>; +export default _default; +//# sourceMappingURL=playerBan.d.ts.map \ No newline at end of file diff --git a/dist/native/event/playerBan.d.ts.map b/dist/native/event/playerBan.d.ts.map new file mode 100644 index 0000000..96b751e --- /dev/null +++ b/dist/native/event/playerBan.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"playerBan.d.ts","sourceRoot":"","sources":["../../../src/native/event/playerBan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAqB,eAAe,EAAE,MAAM,sBAAsB,CAAA;;;;;;;;;AAEzE,wBAyBE"} \ No newline at end of file diff --git a/dist/native/event/playerBan.js b/dist/native/event/playerBan.js new file mode 100644 index 0000000..dfc9a06 --- /dev/null +++ b/dist/native/event/playerBan.js @@ -0,0 +1,32 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const ban_1 = require("../../properties/ban"); +exports.default = new forgescript_1.NativeFunction({ + name: "$playerBan", + version: "1.0.0", + description: "Retrieves data from an event whose context was a player ban event", + unwrap: true, + brackets: false, + args: [ + { + name: "property", + description: "The property to pull", + rest: false, + required: true, + type: forgescript_1.ArgType.Enum, + enum: ban_1.UserBanProperty, + }, + ], + output: [ + forgescript_1.ArgType.Json, + forgescript_1.ArgType.Unknown + ], + execute(ctx, [prop]) { + const ban = ctx.userBan; + if (!ban || prop) + return this.success(ban_1.UserBanProperties[prop](ban)); + return this.successJSON(ban); + }, +}); +//# sourceMappingURL=playerBan.js.map \ No newline at end of file diff --git a/dist/native/event/playerBan.js.map b/dist/native/event/playerBan.js.map new file mode 100644 index 0000000..bdd8232 --- /dev/null +++ b/dist/native/event/playerBan.js.map @@ -0,0 +1 @@ +{"version":3,"file":"playerBan.js","sourceRoot":"","sources":["../../../src/native/event/playerBan.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAC/D,8CAAyE;AAEzE,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,mEAAmE;IAChF,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,qBAAe;SACxB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,qBAAO,CAAC,OAAO;KAClB;IACD,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QACf,MAAM,GAAG,GAAG,GAAG,CAAC,OAAO,CAAA;QACvB,IAAI,CAAC,GAAG,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,uBAAiB,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,CAAC,CAAA;QACnE,OAAO,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAA;IAChC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/event/serverState.d.ts b/dist/native/event/serverState.d.ts new file mode 100644 index 0000000..b0b63ed --- /dev/null +++ b/dist/native/event/serverState.d.ts @@ -0,0 +1,17 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { ServerStateProperty } from "../../properties/serverState"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Enum; + enum: typeof ServerStateProperty; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=serverState.d.ts.map \ No newline at end of file diff --git a/dist/native/event/serverState.d.ts.map b/dist/native/event/serverState.d.ts.map new file mode 100644 index 0000000..d8465c7 --- /dev/null +++ b/dist/native/event/serverState.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverState.d.ts","sourceRoot":"","sources":["../../../src/native/event/serverState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAyB,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;;;;;;;;;;;;;;AAEzF,wBA+BE"} \ No newline at end of file diff --git a/dist/native/event/serverState.js b/dist/native/event/serverState.js new file mode 100644 index 0000000..b68d9c9 --- /dev/null +++ b/dist/native/event/serverState.js @@ -0,0 +1,38 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const serverState_1 = require("../../properties/serverState"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverState", + version: "1.0.0", + description: "Retrieves data from an event whose context was a server status event", + unwrap: true, + brackets: false, + args: [ + { + name: "property", + description: "The property to pull", + rest: false, + required: true, + type: forgescript_1.ArgType.Enum, + enum: serverState_1.ServerStateProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: forgescript_1.ArgType.String, + }, + ], + output: [ + forgescript_1.ArgType.Json, + forgescript_1.ArgType.Unknown + ], + execute(ctx, [prop, sep]) { + const state = ctx.serverState; + if (!state || prop) + return this.success(serverState_1.ServerStateProperties[prop](state, sep)); + return this.successJSON(state); + }, +}); +//# sourceMappingURL=serverState.js.map \ No newline at end of file diff --git a/dist/native/event/serverState.js.map b/dist/native/event/serverState.js.map new file mode 100644 index 0000000..c328104 --- /dev/null +++ b/dist/native/event/serverState.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverState.js","sourceRoot":"","sources":["../../../src/native/event/serverState.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAC/D,8DAAyF;AAEzF,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,sEAAsE;IACnF,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,iCAAmB;SAC5B;QACD;YACI,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,qBAAO,CAAC,OAAO;KAClB;IACD,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,GAAG,CAAC;QACpB,MAAM,KAAK,GAAG,GAAG,CAAC,WAAW,CAAA;QAC7B,IAAI,CAAC,KAAK,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,mCAAqB,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC,CAAA;QAChF,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaEulaBlocked.d.ts b/dist/native/java/javaEulaBlocked.d.ts new file mode 100644 index 0000000..fad5528 --- /dev/null +++ b/dist/native/java/javaEulaBlocked.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=javaEulaBlocked.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaEulaBlocked.d.ts.map b/dist/native/java/javaEulaBlocked.d.ts.map new file mode 100644 index 0000000..3b74bd7 --- /dev/null +++ b/dist/native/java/javaEulaBlocked.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaEulaBlocked.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaEulaBlocked.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE/D,wBAwBE"} \ No newline at end of file diff --git a/dist/native/java/javaEulaBlocked.js b/dist/native/java/javaEulaBlocked.js new file mode 100644 index 0000000..3f579b9 --- /dev/null +++ b/dist/native/java/javaEulaBlocked.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaEulaBlocked", + version: "1.0.0", + description: "Returns whether a java server has EULA blocked", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.eula_blocked); + } +}); +//# sourceMappingURL=javaEulaBlocked.js.map \ No newline at end of file diff --git a/dist/native/java/javaEulaBlocked.js.map b/dist/native/java/javaEulaBlocked.js.map new file mode 100644 index 0000000..21bc7e9 --- /dev/null +++ b/dist/native/java/javaEulaBlocked.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaEulaBlocked.js","sourceRoot":"","sources":["../../../src/native/java/javaEulaBlocked.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,YAAY,CAAC,CAAA;IAC1H,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaHost.d.ts b/dist/native/java/javaHost.d.ts new file mode 100644 index 0000000..fe1ea21 --- /dev/null +++ b/dist/native/java/javaHost.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=javaHost.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaHost.d.ts.map b/dist/native/java/javaHost.d.ts.map new file mode 100644 index 0000000..566e4ca --- /dev/null +++ b/dist/native/java/javaHost.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaHost.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaHost.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/java/javaHost.js b/dist/native/java/javaHost.js new file mode 100644 index 0000000..0cf2b0c --- /dev/null +++ b/dist/native/java/javaHost.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaHost", + version: "1.0.0", + description: "Returns the host name of the java server", + unwrap: false, + output: forgescript_1.ArgType.String, + async execute(ctx) { + return this.success((await ctx.client.minecraft.getJavaStatus().catch(ctx.noop))?.host); + } +}); +//# sourceMappingURL=javaHost.js.map \ No newline at end of file diff --git a/dist/native/java/javaHost.js.map b/dist/native/java/javaHost.js.map new file mode 100644 index 0000000..b4b0f4c --- /dev/null +++ b/dist/native/java/javaHost.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaHost.js","sourceRoot":"","sources":["../../../src/native/java/javaHost.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,0CAA0C;IACvD,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;IAC3F,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaIPAddress.d.ts b/dist/native/java/javaIPAddress.d.ts new file mode 100644 index 0000000..b840946 --- /dev/null +++ b/dist/native/java/javaIPAddress.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=javaIPAddress.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaIPAddress.d.ts.map b/dist/native/java/javaIPAddress.d.ts.map new file mode 100644 index 0000000..2eb5243 --- /dev/null +++ b/dist/native/java/javaIPAddress.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaIPAddress.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaIPAddress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE/D,wBAyBE"} \ No newline at end of file diff --git a/dist/native/java/javaIPAddress.js b/dist/native/java/javaIPAddress.js new file mode 100644 index 0000000..7a9c5b2 --- /dev/null +++ b/dist/native/java/javaIPAddress.js @@ -0,0 +1,30 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaIPAddress", + version: "1.0.0", + description: "Returns the IP address of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.String, + async execute(ctx, [host, port]) { + const status = await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop); + return this.success(status && "ip_address" in status ? status?.ip_address : null); + } +}); +//# sourceMappingURL=javaIPAddress.js.map \ No newline at end of file diff --git a/dist/native/java/javaIPAddress.js.map b/dist/native/java/javaIPAddress.js.map new file mode 100644 index 0000000..798ebfd --- /dev/null +++ b/dist/native/java/javaIPAddress.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaIPAddress.js","sourceRoot":"","sources":["../../../src/native/java/javaIPAddress.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,yCAAyC;IACtD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAChG,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,YAAY,IAAI,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACrF,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaIcon.d.ts b/dist/native/java/javaIcon.d.ts new file mode 100644 index 0000000..cae5a61 --- /dev/null +++ b/dist/native/java/javaIcon.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=javaIcon.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaIcon.d.ts.map b/dist/native/java/javaIcon.d.ts.map new file mode 100644 index 0000000..547663c --- /dev/null +++ b/dist/native/java/javaIcon.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaIcon.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaIcon.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAG/D,wBA6BE"} \ No newline at end of file diff --git a/dist/native/java/javaIcon.js b/dist/native/java/javaIcon.js new file mode 100644 index 0000000..20f05c0 --- /dev/null +++ b/dist/native/java/javaIcon.js @@ -0,0 +1,35 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const discord_js_1 = require("discord.js"); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaIcon", + version: "1.0.0", + description: "Returns the icon of a java server as attachment", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.Attachment, + async execute(ctx, [host, port]) { + const icon = (await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.icon; + if (icon) { + const buffer = Buffer.from(icon.split(",")[1], "base64"); + ctx.container.files.push(new discord_js_1.AttachmentBuilder(buffer).setName("icon.png")); + } + return this.success(); + } +}); +//# sourceMappingURL=javaIcon.js.map \ No newline at end of file diff --git a/dist/native/java/javaIcon.js.map b/dist/native/java/javaIcon.js.map new file mode 100644 index 0000000..3bc4fa5 --- /dev/null +++ b/dist/native/java/javaIcon.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaIcon.js","sourceRoot":"","sources":["../../../src/native/java/javaIcon.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAC/D,2CAA8C;AAE9C,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,iDAAiD;IAC9D,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,UAAU;IAC1B,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAA;QACtG,IAAI,IAAI,EAAE,CAAC;YACP,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;YACxD,GAAG,CAAC,SAAS,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,8BAAiB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAA;QAC/E,CAAC;QACD,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaMOTD.d.ts b/dist/native/java/javaMOTD.d.ts new file mode 100644 index 0000000..7f5c321 --- /dev/null +++ b/dist/native/java/javaMOTD.d.ts @@ -0,0 +1,25 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +export declare enum MOTDProperty { + Raw = "raw", + Clean = "clean", + Html = "html" +} +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof MOTDProperty; +}], true>; +export default _default; +//# sourceMappingURL=javaMOTD.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaMOTD.d.ts.map b/dist/native/java/javaMOTD.d.ts.map new file mode 100644 index 0000000..53fe9b5 --- /dev/null +++ b/dist/native/java/javaMOTD.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaMOTD.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaMOTD.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE/D,oBAAY,YAAY;IACpB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,IAAI,SAAS;CAChB;;;;;;;;;;;;;;;;;;AAED,wBAoCE"} \ No newline at end of file diff --git a/dist/native/java/javaMOTD.js b/dist/native/java/javaMOTD.js new file mode 100644 index 0000000..7adbcc7 --- /dev/null +++ b/dist/native/java/javaMOTD.js @@ -0,0 +1,49 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.MOTDProperty = void 0; +const forgescript_1 = require("@tryforge/forgescript"); +var MOTDProperty; +(function (MOTDProperty) { + MOTDProperty["Raw"] = "raw"; + MOTDProperty["Clean"] = "clean"; + MOTDProperty["Html"] = "html"; +})(MOTDProperty || (exports.MOTDProperty = MOTDProperty = {})); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaMOTD", + version: "1.0.0", + description: "Returns the message of the day (MOTD) from a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: MOTDProperty, + }, + ], + output: [ + forgescript_1.ArgType.Json, + forgescript_1.ArgType.Unknown + ], + async execute(ctx, [host, port, prop]) { + const motd = (await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.motd; + if (!motd || prop) + return this.success(motd?.[prop]); + return this.successJSON(motd); + } +}); +//# sourceMappingURL=javaMOTD.js.map \ No newline at end of file diff --git a/dist/native/java/javaMOTD.js.map b/dist/native/java/javaMOTD.js.map new file mode 100644 index 0000000..4f9e798 --- /dev/null +++ b/dist/native/java/javaMOTD.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaMOTD.js","sourceRoot":"","sources":["../../../src/native/java/javaMOTD.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAE/D,IAAY,YAIX;AAJD,WAAY,YAAY;IACpB,2BAAW,CAAA;IACX,+BAAe,CAAA;IACf,6BAAa,CAAA;AACjB,CAAC,EAJW,YAAY,4BAAZ,YAAY,QAIvB;AAED,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,0DAA0D;IACvE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,YAAY;SACrB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,qBAAO,CAAC,OAAO;KAClB;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;QACjC,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAA;QACtG,IAAI,CAAC,IAAI,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,IAAK,CAAC,CAAC,CAAA;QACrD,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaMaxPlayers.d.ts b/dist/native/java/javaMaxPlayers.d.ts new file mode 100644 index 0000000..7133601 --- /dev/null +++ b/dist/native/java/javaMaxPlayers.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=javaMaxPlayers.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaMaxPlayers.d.ts.map b/dist/native/java/javaMaxPlayers.d.ts.map new file mode 100644 index 0000000..1813faf --- /dev/null +++ b/dist/native/java/javaMaxPlayers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaMaxPlayers.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaMaxPlayers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE/D,wBAwBE"} \ No newline at end of file diff --git a/dist/native/java/javaMaxPlayers.js b/dist/native/java/javaMaxPlayers.js new file mode 100644 index 0000000..95a6230 --- /dev/null +++ b/dist/native/java/javaMaxPlayers.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaMaxPlayers", + version: "1.0.0", + description: "Returns the maximum amount of allowed players on a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.Number, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.players?.max); + } +}); +//# sourceMappingURL=javaMaxPlayers.js.map \ No newline at end of file diff --git a/dist/native/java/javaMaxPlayers.js.map b/dist/native/java/javaMaxPlayers.js.map new file mode 100644 index 0000000..334c14b --- /dev/null +++ b/dist/native/java/javaMaxPlayers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaMaxPlayers.js","sourceRoot":"","sources":["../../../src/native/java/javaMaxPlayers.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gEAAgE;IAC7E,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,GAAG,CAAC,CAAA;IAC1H,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaMods.d.ts b/dist/native/java/javaMods.d.ts new file mode 100644 index 0000000..27bb5bd --- /dev/null +++ b/dist/native/java/javaMods.d.ts @@ -0,0 +1,29 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +export declare enum JavaModProperty { + name = "name", + version = "version" +} +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof JavaModProperty; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=javaMods.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaMods.d.ts.map b/dist/native/java/javaMods.d.ts.map new file mode 100644 index 0000000..dc4fd0a --- /dev/null +++ b/dist/native/java/javaMods.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaMods.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaMods.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAG/D,oBAAY,eAAe;IACvB,IAAI,SAAS;IACb,OAAO,YAAY;CACtB;;;;;;;;;;;;;;;;;;;;;;;AAED,wBA0CE"} \ No newline at end of file diff --git a/dist/native/java/javaMods.js b/dist/native/java/javaMods.js new file mode 100644 index 0000000..c023243 --- /dev/null +++ b/dist/native/java/javaMods.js @@ -0,0 +1,58 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.JavaModProperty = void 0; +const forgescript_1 = require("@tryforge/forgescript"); +const array_1 = __importDefault(require("../../functions/array")); +var JavaModProperty; +(function (JavaModProperty) { + JavaModProperty["name"] = "name"; + JavaModProperty["version"] = "version"; +})(JavaModProperty || (exports.JavaModProperty = JavaModProperty = {})); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaMods", + version: "1.0.0", + description: "Returns the mods of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: JavaModProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: forgescript_1.ArgType.String, + }, + ], + output: [ + forgescript_1.ArgType.Json, + (0, array_1.default)() + ], + async execute(ctx, [host, port, prop, sep]) { + const mods = (await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.mods; + if (!mods || prop) + return this.success(mods?.map((x) => x[prop]).join(sep ?? ", ")); + return this.successJSON(mods); + } +}); +//# sourceMappingURL=javaMods.js.map \ No newline at end of file diff --git a/dist/native/java/javaMods.js.map b/dist/native/java/javaMods.js.map new file mode 100644 index 0000000..5647565 --- /dev/null +++ b/dist/native/java/javaMods.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaMods.js","sourceRoot":"","sources":["../../../src/native/java/javaMods.ts"],"names":[],"mappings":";;;;;;AAAA,uDAA+D;AAC/D,kEAAyC;AAEzC,IAAY,eAGX;AAHD,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,sCAAmB,CAAA;AACvB,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B;AAED,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,mCAAmC;IAChD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,eAAe;SACxB;QACD;YACI,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,IAAA,eAAK,GAAkB;KAC1B;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC;QACtC,MAAM,IAAI,GAAG,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAA;QACtG,IAAI,CAAC,IAAI,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAA;QACpF,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaPlayerCount.d.ts b/dist/native/java/javaPlayerCount.d.ts new file mode 100644 index 0000000..c068c38 --- /dev/null +++ b/dist/native/java/javaPlayerCount.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=javaPlayerCount.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaPlayerCount.d.ts.map b/dist/native/java/javaPlayerCount.d.ts.map new file mode 100644 index 0000000..fd25516 --- /dev/null +++ b/dist/native/java/javaPlayerCount.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaPlayerCount.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaPlayerCount.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE/D,wBAwBE"} \ No newline at end of file diff --git a/dist/native/java/javaPlayerCount.js b/dist/native/java/javaPlayerCount.js new file mode 100644 index 0000000..4934e5d --- /dev/null +++ b/dist/native/java/javaPlayerCount.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaPlayerCount", + version: "1.0.0", + description: "Returns the online player count of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.Number, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.players?.online); + } +}); +//# sourceMappingURL=javaPlayerCount.js.map \ No newline at end of file diff --git a/dist/native/java/javaPlayerCount.js.map b/dist/native/java/javaPlayerCount.js.map new file mode 100644 index 0000000..1fd0ba2 --- /dev/null +++ b/dist/native/java/javaPlayerCount.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaPlayerCount.js","sourceRoot":"","sources":["../../../src/native/java/javaPlayerCount.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,kDAAkD;IAC/D,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,CAAC,CAAA;IAC7H,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaPlayerList.d.ts b/dist/native/java/javaPlayerList.d.ts new file mode 100644 index 0000000..fa1529d --- /dev/null +++ b/dist/native/java/javaPlayerList.d.ts @@ -0,0 +1,31 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +export declare enum JavaPlayerProperty { + uuid = "uuid", + nameRaw = "name_raw", + nameClean = "name_clean", + nameHtml = "name_html" +} +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof JavaPlayerProperty; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=javaPlayerList.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaPlayerList.d.ts.map b/dist/native/java/javaPlayerList.d.ts.map new file mode 100644 index 0000000..e7ddbb6 --- /dev/null +++ b/dist/native/java/javaPlayerList.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaPlayerList.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaPlayerList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAG/D,oBAAY,kBAAkB;IAC1B,IAAI,SAAS;IACb,OAAO,aAAa;IACpB,SAAS,eAAe;IACxB,QAAQ,cAAc;CACzB;;;;;;;;;;;;;;;;;;;;;;;AAED,wBA0CE"} \ No newline at end of file diff --git a/dist/native/java/javaPlayerList.js b/dist/native/java/javaPlayerList.js new file mode 100644 index 0000000..44b9308 --- /dev/null +++ b/dist/native/java/javaPlayerList.js @@ -0,0 +1,60 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.JavaPlayerProperty = void 0; +const forgescript_1 = require("@tryforge/forgescript"); +const array_1 = __importDefault(require("../../functions/array")); +var JavaPlayerProperty; +(function (JavaPlayerProperty) { + JavaPlayerProperty["uuid"] = "uuid"; + JavaPlayerProperty["nameRaw"] = "name_raw"; + JavaPlayerProperty["nameClean"] = "name_clean"; + JavaPlayerProperty["nameHtml"] = "name_html"; +})(JavaPlayerProperty || (exports.JavaPlayerProperty = JavaPlayerProperty = {})); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaPlayerList", + version: "1.0.0", + description: "Returns the online player list of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: JavaPlayerProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: forgescript_1.ArgType.String, + }, + ], + output: [ + forgescript_1.ArgType.Json, + (0, array_1.default)() + ], + async execute(ctx, [host, port, prop, sep]) { + const players = (await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.players?.list; + if (!players || prop) + return this.success(players?.map((x) => x[prop]).join(sep ?? ", ")); + return this.successJSON(players); + } +}); +//# sourceMappingURL=javaPlayerList.js.map \ No newline at end of file diff --git a/dist/native/java/javaPlayerList.js.map b/dist/native/java/javaPlayerList.js.map new file mode 100644 index 0000000..3f93afa --- /dev/null +++ b/dist/native/java/javaPlayerList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaPlayerList.js","sourceRoot":"","sources":["../../../src/native/java/javaPlayerList.ts"],"names":[],"mappings":";;;;;;AAAA,uDAA+D;AAC/D,kEAAyC;AAEzC,IAAY,kBAKX;AALD,WAAY,kBAAkB;IAC1B,mCAAa,CAAA;IACb,0CAAoB,CAAA;IACpB,8CAAwB,CAAA;IACxB,4CAAsB,CAAA;AAC1B,CAAC,EALW,kBAAkB,kCAAlB,kBAAkB,QAK7B;AAED,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,iDAAiD;IAC9D,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,kBAAkB;SAC3B;QACD;YACI,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,IAAA,eAAK,GAAkB;KAC1B;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC;QACtC,MAAM,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAA;QAClH,IAAI,CAAC,OAAO,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAA;QAC1F,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaPlugins.d.ts b/dist/native/java/javaPlugins.d.ts new file mode 100644 index 0000000..d660c56 --- /dev/null +++ b/dist/native/java/javaPlugins.d.ts @@ -0,0 +1,29 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +export declare enum JavaPluginProperty { + name = "name", + version = "version" +} +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof JavaPluginProperty; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=javaPlugins.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaPlugins.d.ts.map b/dist/native/java/javaPlugins.d.ts.map new file mode 100644 index 0000000..79203a5 --- /dev/null +++ b/dist/native/java/javaPlugins.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaPlugins.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaPlugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAG/D,oBAAY,kBAAkB;IAC1B,IAAI,SAAS;IACb,OAAO,YAAY;CACtB;;;;;;;;;;;;;;;;;;;;;;;AAED,wBA0CE"} \ No newline at end of file diff --git a/dist/native/java/javaPlugins.js b/dist/native/java/javaPlugins.js new file mode 100644 index 0000000..f6b817b --- /dev/null +++ b/dist/native/java/javaPlugins.js @@ -0,0 +1,58 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.JavaPluginProperty = void 0; +const forgescript_1 = require("@tryforge/forgescript"); +const array_1 = __importDefault(require("../../functions/array")); +var JavaPluginProperty; +(function (JavaPluginProperty) { + JavaPluginProperty["name"] = "name"; + JavaPluginProperty["version"] = "version"; +})(JavaPluginProperty || (exports.JavaPluginProperty = JavaPluginProperty = {})); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaPlugins", + version: "1.0.0", + description: "Returns the plugins of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: JavaPluginProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: forgescript_1.ArgType.String, + }, + ], + output: [ + forgescript_1.ArgType.Json, + (0, array_1.default)() + ], + async execute(ctx, [host, port, prop, sep]) { + const plugins = (await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.plugins; + if (!plugins || prop) + return this.success(plugins?.map((x) => x[prop]).join(sep ?? ", ")); + return this.successJSON(plugins); + } +}); +//# sourceMappingURL=javaPlugins.js.map \ No newline at end of file diff --git a/dist/native/java/javaPlugins.js.map b/dist/native/java/javaPlugins.js.map new file mode 100644 index 0000000..12adc94 --- /dev/null +++ b/dist/native/java/javaPlugins.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaPlugins.js","sourceRoot":"","sources":["../../../src/native/java/javaPlugins.ts"],"names":[],"mappings":";;;;;;AAAA,uDAA+D;AAC/D,kEAAyC;AAEzC,IAAY,kBAGX;AAHD,WAAY,kBAAkB;IAC1B,mCAAa,CAAA;IACb,yCAAmB,CAAA;AACvB,CAAC,EAHW,kBAAkB,kCAAlB,kBAAkB,QAG7B;AAED,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,sCAAsC;IACnD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,kBAAkB;SAC3B;QACD;YACI,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,IAAA,eAAK,GAAkB;KAC1B;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,GAAG,CAAC;QACtC,MAAM,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAA;QAC5G,IAAI,CAAC,OAAO,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAA;QAC1F,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaPort.d.ts b/dist/native/java/javaPort.d.ts new file mode 100644 index 0000000..3638d3c --- /dev/null +++ b/dist/native/java/javaPort.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=javaPort.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaPort.d.ts.map b/dist/native/java/javaPort.d.ts.map new file mode 100644 index 0000000..bd29f33 --- /dev/null +++ b/dist/native/java/javaPort.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaPort.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaPort.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/java/javaPort.js b/dist/native/java/javaPort.js new file mode 100644 index 0000000..dac6c6a --- /dev/null +++ b/dist/native/java/javaPort.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaPort", + version: "1.0.0", + description: "Returns the port of the java server", + unwrap: false, + output: forgescript_1.ArgType.Number, + async execute(ctx) { + return this.success((await ctx.client.minecraft.getJavaStatus().catch(ctx.noop))?.port); + } +}); +//# sourceMappingURL=javaPort.js.map \ No newline at end of file diff --git a/dist/native/java/javaPort.js.map b/dist/native/java/javaPort.js.map new file mode 100644 index 0000000..0e161ab --- /dev/null +++ b/dist/native/java/javaPort.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaPort.js","sourceRoot":"","sources":["../../../src/native/java/javaPort.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,qCAAqC;IAClD,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,CAAA;IAC3F,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaServerOnline.d.ts b/dist/native/java/javaServerOnline.d.ts new file mode 100644 index 0000000..f6dc243 --- /dev/null +++ b/dist/native/java/javaServerOnline.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=javaServerOnline.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaServerOnline.d.ts.map b/dist/native/java/javaServerOnline.d.ts.map new file mode 100644 index 0000000..3b03cea --- /dev/null +++ b/dist/native/java/javaServerOnline.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaServerOnline.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaServerOnline.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE/D,wBAwBE"} \ No newline at end of file diff --git a/dist/native/java/javaServerOnline.js b/dist/native/java/javaServerOnline.js new file mode 100644 index 0000000..2690704 --- /dev/null +++ b/dist/native/java/javaServerOnline.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaServerOnline", + version: "1.0.0", + description: "Returns whether a java server is online", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.online); + } +}); +//# sourceMappingURL=javaServerOnline.js.map \ No newline at end of file diff --git a/dist/native/java/javaServerOnline.js.map b/dist/native/java/javaServerOnline.js.map new file mode 100644 index 0000000..6c51a2d --- /dev/null +++ b/dist/native/java/javaServerOnline.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaServerOnline.js","sourceRoot":"","sources":["../../../src/native/java/javaServerOnline.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,yCAAyC;IACtD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,MAAM,CAAC,CAAA;IACpH,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaSoftware.d.ts b/dist/native/java/javaSoftware.d.ts new file mode 100644 index 0000000..468153a --- /dev/null +++ b/dist/native/java/javaSoftware.d.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=javaSoftware.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaSoftware.d.ts.map b/dist/native/java/javaSoftware.d.ts.map new file mode 100644 index 0000000..9a3a9f0 --- /dev/null +++ b/dist/native/java/javaSoftware.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaSoftware.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaSoftware.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;AAE/D,wBAwBE"} \ No newline at end of file diff --git a/dist/native/java/javaSoftware.js b/dist/native/java/javaSoftware.js new file mode 100644 index 0000000..045c976 --- /dev/null +++ b/dist/native/java/javaSoftware.js @@ -0,0 +1,29 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaSoftware", + version: "1.0.0", + description: "Returns the software of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + } + ], + output: forgescript_1.ArgType.String, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.software); + } +}); +//# sourceMappingURL=javaSoftware.js.map \ No newline at end of file diff --git a/dist/native/java/javaSoftware.js.map b/dist/native/java/javaSoftware.js.map new file mode 100644 index 0000000..1532372 --- /dev/null +++ b/dist/native/java/javaSoftware.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaSoftware.js","sourceRoot":"","sources":["../../../src/native/java/javaSoftware.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,uCAAuC;IACpD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,CAAC,CAAA;IACtH,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/java/javaVersion.d.ts b/dist/native/java/javaVersion.d.ts new file mode 100644 index 0000000..61a8956 --- /dev/null +++ b/dist/native/java/javaVersion.d.ts @@ -0,0 +1,26 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +export declare enum JavaVersionProperty { + nameRaw = "name_raw", + nameClean = "name_clean", + nameHtml = "name_html", + protocol = "protocol" +} +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof JavaVersionProperty; +}], true>; +export default _default; +//# sourceMappingURL=javaVersion.d.ts.map \ No newline at end of file diff --git a/dist/native/java/javaVersion.d.ts.map b/dist/native/java/javaVersion.d.ts.map new file mode 100644 index 0000000..2f7d2c0 --- /dev/null +++ b/dist/native/java/javaVersion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"javaVersion.d.ts","sourceRoot":"","sources":["../../../src/native/java/javaVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE/D,oBAAY,mBAAmB;IAC3B,OAAO,aAAa;IACpB,SAAS,eAAe;IACxB,QAAQ,cAAc;IACtB,QAAQ,aAAa;CACxB;;;;;;;;;;;;;;;;;;AAED,wBAoCE"} \ No newline at end of file diff --git a/dist/native/java/javaVersion.js b/dist/native/java/javaVersion.js new file mode 100644 index 0000000..7425d10 --- /dev/null +++ b/dist/native/java/javaVersion.js @@ -0,0 +1,50 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.JavaVersionProperty = void 0; +const forgescript_1 = require("@tryforge/forgescript"); +var JavaVersionProperty; +(function (JavaVersionProperty) { + JavaVersionProperty["nameRaw"] = "name_raw"; + JavaVersionProperty["nameClean"] = "name_clean"; + JavaVersionProperty["nameHtml"] = "name_html"; + JavaVersionProperty["protocol"] = "protocol"; +})(JavaVersionProperty || (exports.JavaVersionProperty = JavaVersionProperty = {})); +exports.default = new forgescript_1.NativeFunction({ + name: "$javaVersion", + version: "1.0.0", + description: "Returns the version of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: forgescript_1.ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: JavaVersionProperty, + }, + ], + output: [ + forgescript_1.ArgType.Json, + forgescript_1.ArgType.Unknown + ], + async execute(ctx, [host, port, prop]) { + const version = (await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.version; + if (!version || prop) + return this.success(version?.[prop]); + return this.successJSON(version); + } +}); +//# sourceMappingURL=javaVersion.js.map \ No newline at end of file diff --git a/dist/native/java/javaVersion.js.map b/dist/native/java/javaVersion.js.map new file mode 100644 index 0000000..ca79dc6 --- /dev/null +++ b/dist/native/java/javaVersion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"javaVersion.js","sourceRoot":"","sources":["../../../src/native/java/javaVersion.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAE/D,IAAY,mBAKX;AALD,WAAY,mBAAmB;IAC3B,2CAAoB,CAAA;IACpB,+CAAwB,CAAA;IACxB,6CAAsB,CAAA;IACtB,4CAAqB,CAAA;AACzB,CAAC,EALW,mBAAmB,mCAAnB,mBAAmB,QAK9B;AAED,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,sCAAsC;IACnD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,mBAAmB;SAC5B;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,qBAAO,CAAC,OAAO;KAClB;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,CAAC;QACjC,MAAM,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,aAAa,CAAC,IAAI,EAAE,IAAI,IAAI,SAAS,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAA;QAC5G,IAAI,CAAC,OAAO,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,IAAK,CAAC,CAAC,CAAA;QAC3D,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/addAllowList.d.ts b/dist/native/management/addAllowList.d.ts new file mode 100644 index 0000000..da94a71 --- /dev/null +++ b/dist/native/management/addAllowList.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: true; + required: true; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=addAllowList.d.ts.map \ No newline at end of file diff --git a/dist/native/management/addAllowList.d.ts.map b/dist/native/management/addAllowList.d.ts.map new file mode 100644 index 0000000..8338359 --- /dev/null +++ b/dist/native/management/addAllowList.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"addAllowList.d.ts","sourceRoot":"","sources":["../../../src/native/management/addAllowList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAG/D,wBAqBE"} \ No newline at end of file diff --git a/dist/native/management/addAllowList.js b/dist/native/management/addAllowList.js new file mode 100644 index 0000000..c5e1de8 --- /dev/null +++ b/dist/native/management/addAllowList.js @@ -0,0 +1,28 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const parsePlayer_1 = __importDefault(require("../../functions/parsePlayer")); +exports.default = new forgescript_1.NativeFunction({ + name: "$addAllowList", + version: "1.0.0", + description: "Adds players to the server's allow list, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "players", + description: "The players to add", + rest: true, + required: true, + type: forgescript_1.ArgType.String, + }, + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [players]) { + return this.success(!!(await ctx.client.minecraft.server?.allowlist().add(players.map(parsePlayer_1.default)).catch(ctx.noop))); + } +}); +//# sourceMappingURL=addAllowList.js.map \ No newline at end of file diff --git a/dist/native/management/addAllowList.js.map b/dist/native/management/addAllowList.js.map new file mode 100644 index 0000000..f74efb4 --- /dev/null +++ b/dist/native/management/addAllowList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"addAllowList.js","sourceRoot":"","sources":["../../../src/native/management/addAllowList.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,8EAAqD;AAErD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,uDAAuD;IACpE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAC/F,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/addIPBan.d.ts b/dist/native/management/addIPBan.d.ts new file mode 100644 index 0000000..d23f80b --- /dev/null +++ b/dist/native/management/addIPBan.d.ts @@ -0,0 +1,25 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Date; +}], true>; +export default _default; +//# sourceMappingURL=addIPBan.d.ts.map \ No newline at end of file diff --git a/dist/native/management/addIPBan.d.ts.map b/dist/native/management/addIPBan.d.ts.map new file mode 100644 index 0000000..07e0ca4 --- /dev/null +++ b/dist/native/management/addIPBan.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"addIPBan.d.ts","sourceRoot":"","sources":["../../../src/native/management/addIPBan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;;;;;;;;;;;;AAE/D,wBA4CE"} \ No newline at end of file diff --git a/dist/native/management/addIPBan.js b/dist/native/management/addIPBan.js new file mode 100644 index 0000000..7296628 --- /dev/null +++ b/dist/native/management/addIPBan.js @@ -0,0 +1,42 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$addIPBan", + version: "1.0.0", + description: "Adds an IP address to the server's ban list, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "ip", + description: "The IP address to ban from the server", + rest: false, + required: true, + type: forgescript_1.ArgType.String, + }, + { + name: "reason", + description: "The reason for the ban", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "source", + description: "The source of the ban", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "expires", + description: "The expire date of the ban", + rest: false, + type: forgescript_1.ArgType.Date, + }, + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [ip, reason, source, expires]) { + return this.success(!!(await ctx.client.minecraft.server?.ipBanList().add(ip, reason || undefined, source || undefined, expires || undefined).catch(ctx.noop))); + } +}); +//# sourceMappingURL=addIPBan.js.map \ No newline at end of file diff --git a/dist/native/management/addIPBan.js.map b/dist/native/management/addIPBan.js.map new file mode 100644 index 0000000..b930ae7 --- /dev/null +++ b/dist/native/management/addIPBan.js.map @@ -0,0 +1 @@ +{"version":3,"file":"addIPBan.js","sourceRoot":"","sources":["../../../src/native/management/addIPBan.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,WAAW;IACjB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,2DAA2D;IACxE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,IAAI;YACV,WAAW,EAAE,uCAAuC;YACpD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,4BAA4B;YACzC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;SACrB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;QAC5C,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAC9C,EAAE,EACF,MAAM,IAAI,SAAS,EACnB,MAAM,IAAI,SAAS,EACnB,OAAO,IAAI,SAAS,CACvB,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CACpB,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/addOperator.d.ts b/dist/native/management/addOperator.d.ts new file mode 100644 index 0000000..5cd8a93 --- /dev/null +++ b/dist/native/management/addOperator.d.ts @@ -0,0 +1,20 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Number; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Boolean; +}], true>; +export default _default; +//# sourceMappingURL=addOperator.d.ts.map \ No newline at end of file diff --git a/dist/native/management/addOperator.d.ts.map b/dist/native/management/addOperator.d.ts.map new file mode 100644 index 0000000..893571d --- /dev/null +++ b/dist/native/management/addOperator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"addOperator.d.ts","sourceRoot":"","sources":["../../../src/native/management/addOperator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;;;;;;;AAG/D,wBAqCE"} \ No newline at end of file diff --git a/dist/native/management/addOperator.js b/dist/native/management/addOperator.js new file mode 100644 index 0000000..c3bcd40 --- /dev/null +++ b/dist/native/management/addOperator.js @@ -0,0 +1,40 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const parsePlayer_1 = __importDefault(require("../../functions/parsePlayer")); +exports.default = new forgescript_1.NativeFunction({ + name: "$addOperator", + version: "1.0.0", + description: "Adds a player to the server's operator list, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "player", + description: "The player to add as an operator", + rest: false, + required: true, + type: forgescript_1.ArgType.String, + }, + { + name: "level", + description: "The operator permission level to grant (from 1 to 4, with 4 being the highest)", + rest: false, + type: forgescript_1.ArgType.Number, + }, + { + name: "bypass", + description: "Whether the operator bypasses the player limit", + rest: false, + type: forgescript_1.ArgType.Boolean, + }, + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [player, level, bypass]) { + return this.success(!!(await ctx.client.minecraft.server?.operatorList().add((0, parsePlayer_1.default)(player), level || undefined, typeof (bypass) === "boolean" ? bypass : undefined).catch(ctx.noop))); + } +}); +//# sourceMappingURL=addOperator.js.map \ No newline at end of file diff --git a/dist/native/management/addOperator.js.map b/dist/native/management/addOperator.js.map new file mode 100644 index 0000000..bee8955 --- /dev/null +++ b/dist/native/management/addOperator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"addOperator.js","sourceRoot":"","sources":["../../../src/native/management/addOperator.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,8EAAqD;AAErD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,2DAA2D;IACxE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,kCAAkC;YAC/C,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,gFAAgF;YAC7F,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,gDAAgD;YAC7D,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,CACjD,IAAA,qBAAW,EAAC,MAAM,CAAC,EACnB,KAAK,IAAI,SAAS,EAClB,OAAM,CAAC,MAAM,CAAC,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS,CACpD,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CACpB,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/addPlayerBan.d.ts b/dist/native/management/addPlayerBan.d.ts new file mode 100644 index 0000000..7fc7f25 --- /dev/null +++ b/dist/native/management/addPlayerBan.d.ts @@ -0,0 +1,25 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Date; +}], true>; +export default _default; +//# sourceMappingURL=addPlayerBan.d.ts.map \ No newline at end of file diff --git a/dist/native/management/addPlayerBan.d.ts.map b/dist/native/management/addPlayerBan.d.ts.map new file mode 100644 index 0000000..1635251 --- /dev/null +++ b/dist/native/management/addPlayerBan.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"addPlayerBan.d.ts","sourceRoot":"","sources":["../../../src/native/management/addPlayerBan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;;;;;;;;;;;;AAG/D,wBA4CE"} \ No newline at end of file diff --git a/dist/native/management/addPlayerBan.js b/dist/native/management/addPlayerBan.js new file mode 100644 index 0000000..9301ed3 --- /dev/null +++ b/dist/native/management/addPlayerBan.js @@ -0,0 +1,46 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const parsePlayer_1 = __importDefault(require("../../functions/parsePlayer")); +exports.default = new forgescript_1.NativeFunction({ + name: "$addPlayerBan", + version: "1.0.0", + description: "Adds a player to the server's ban list, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "player", + description: "The player to ban from the server", + rest: false, + required: true, + type: forgescript_1.ArgType.String, + }, + { + name: "reason", + description: "The reason for the ban", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "source", + description: "The source of the ban", + rest: false, + type: forgescript_1.ArgType.String, + }, + { + name: "expires", + description: "The expire date of the ban", + rest: false, + type: forgescript_1.ArgType.Date, + }, + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [player, reason, source, expires]) { + return this.success(!!(await ctx.client.minecraft.server?.banList().add((0, parsePlayer_1.default)(player), reason || undefined, source || undefined, expires || undefined).catch(ctx.noop))); + } +}); +//# sourceMappingURL=addPlayerBan.js.map \ No newline at end of file diff --git a/dist/native/management/addPlayerBan.js.map b/dist/native/management/addPlayerBan.js.map new file mode 100644 index 0000000..db6d4a9 --- /dev/null +++ b/dist/native/management/addPlayerBan.js.map @@ -0,0 +1 @@ +{"version":3,"file":"addPlayerBan.js","sourceRoot":"","sources":["../../../src/native/management/addPlayerBan.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,8EAAqD;AAErD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,sDAAsD;IACnE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,mCAAmC;YAChD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,4BAA4B;YACzC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;SACrB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC;QAChD,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,CAC5C,IAAA,qBAAW,EAAC,MAAM,CAAC,EACnB,MAAM,IAAI,SAAS,EACnB,MAAM,IAAI,SAAS,EACnB,OAAO,IAAI,SAAS,CACvB,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CACpB,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/clearAllowList.d.ts b/dist/native/management/clearAllowList.d.ts new file mode 100644 index 0000000..d11edc7 --- /dev/null +++ b/dist/native/management/clearAllowList.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=clearAllowList.d.ts.map \ No newline at end of file diff --git a/dist/native/management/clearAllowList.d.ts.map b/dist/native/management/clearAllowList.d.ts.map new file mode 100644 index 0000000..3a72b56 --- /dev/null +++ b/dist/native/management/clearAllowList.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"clearAllowList.d.ts","sourceRoot":"","sources":["../../../src/native/management/clearAllowList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBAWE"} \ No newline at end of file diff --git a/dist/native/management/clearAllowList.js b/dist/native/management/clearAllowList.js new file mode 100644 index 0000000..923bebe --- /dev/null +++ b/dist/native/management/clearAllowList.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$clearAllowList", + version: "1.0.0", + description: "Clears the server's allow list, returns bool", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.successJSON(!!(await ctx.client.minecraft.server?.allowlist().clear().catch(ctx.noop))); + } +}); +//# sourceMappingURL=clearAllowList.js.map \ No newline at end of file diff --git a/dist/native/management/clearAllowList.js.map b/dist/native/management/clearAllowList.js.map new file mode 100644 index 0000000..50741bf --- /dev/null +++ b/dist/native/management/clearAllowList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"clearAllowList.js","sourceRoot":"","sources":["../../../src/native/management/clearAllowList.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,8CAA8C;IAC3D,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CACtB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CACzE,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/clearIPBans.d.ts b/dist/native/management/clearIPBans.d.ts new file mode 100644 index 0000000..685ae99 --- /dev/null +++ b/dist/native/management/clearIPBans.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=clearIPBans.d.ts.map \ No newline at end of file diff --git a/dist/native/management/clearIPBans.d.ts.map b/dist/native/management/clearIPBans.d.ts.map new file mode 100644 index 0000000..0da1dbe --- /dev/null +++ b/dist/native/management/clearIPBans.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"clearIPBans.d.ts","sourceRoot":"","sources":["../../../src/native/management/clearIPBans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBAWE"} \ No newline at end of file diff --git a/dist/native/management/clearIPBans.js b/dist/native/management/clearIPBans.js new file mode 100644 index 0000000..a293a0e --- /dev/null +++ b/dist/native/management/clearIPBans.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$clearIPBans", + version: "1.0.0", + description: "Clears the server's IP ban list, returns bool", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.successJSON(!!(await ctx.client.minecraft.server?.ipBanList().clear().catch(ctx.noop))); + } +}); +//# sourceMappingURL=clearIPBans.js.map \ No newline at end of file diff --git a/dist/native/management/clearIPBans.js.map b/dist/native/management/clearIPBans.js.map new file mode 100644 index 0000000..7661fd9 --- /dev/null +++ b/dist/native/management/clearIPBans.js.map @@ -0,0 +1 @@ +{"version":3,"file":"clearIPBans.js","sourceRoot":"","sources":["../../../src/native/management/clearIPBans.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,+CAA+C;IAC5D,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CACtB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CACzE,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/clearOperators.d.ts b/dist/native/management/clearOperators.d.ts new file mode 100644 index 0000000..9bf539a --- /dev/null +++ b/dist/native/management/clearOperators.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=clearOperators.d.ts.map \ No newline at end of file diff --git a/dist/native/management/clearOperators.d.ts.map b/dist/native/management/clearOperators.d.ts.map new file mode 100644 index 0000000..f92e606 --- /dev/null +++ b/dist/native/management/clearOperators.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"clearOperators.d.ts","sourceRoot":"","sources":["../../../src/native/management/clearOperators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBAWE"} \ No newline at end of file diff --git a/dist/native/management/clearOperators.js b/dist/native/management/clearOperators.js new file mode 100644 index 0000000..91424a5 --- /dev/null +++ b/dist/native/management/clearOperators.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$clearOperators", + version: "1.0.0", + description: "Clears the server's operator list, returns bool", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.successJSON(!!(await ctx.client.minecraft.server?.operatorList().clear().catch(ctx.noop))); + } +}); +//# sourceMappingURL=clearOperators.js.map \ No newline at end of file diff --git a/dist/native/management/clearOperators.js.map b/dist/native/management/clearOperators.js.map new file mode 100644 index 0000000..7f4e318 --- /dev/null +++ b/dist/native/management/clearOperators.js.map @@ -0,0 +1 @@ +{"version":3,"file":"clearOperators.js","sourceRoot":"","sources":["../../../src/native/management/clearOperators.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,iDAAiD;IAC9D,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CACtB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAC5E,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/clearPlayerBans.d.ts b/dist/native/management/clearPlayerBans.d.ts new file mode 100644 index 0000000..176f922 --- /dev/null +++ b/dist/native/management/clearPlayerBans.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=clearPlayerBans.d.ts.map \ No newline at end of file diff --git a/dist/native/management/clearPlayerBans.d.ts.map b/dist/native/management/clearPlayerBans.d.ts.map new file mode 100644 index 0000000..bc470d2 --- /dev/null +++ b/dist/native/management/clearPlayerBans.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"clearPlayerBans.d.ts","sourceRoot":"","sources":["../../../src/native/management/clearPlayerBans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBAWE"} \ No newline at end of file diff --git a/dist/native/management/clearPlayerBans.js b/dist/native/management/clearPlayerBans.js new file mode 100644 index 0000000..d87d5aa --- /dev/null +++ b/dist/native/management/clearPlayerBans.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$clearPlayerBans", + version: "1.0.0", + description: "Clears the server's player ban list, returns bool", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.successJSON(!!(await ctx.client.minecraft.server?.banList().clear().catch(ctx.noop))); + } +}); +//# sourceMappingURL=clearPlayerBans.js.map \ No newline at end of file diff --git a/dist/native/management/clearPlayerBans.js.map b/dist/native/management/clearPlayerBans.js.map new file mode 100644 index 0000000..c2298f7 --- /dev/null +++ b/dist/native/management/clearPlayerBans.js.map @@ -0,0 +1 @@ +{"version":3,"file":"clearPlayerBans.js","sourceRoot":"","sources":["../../../src/native/management/clearPlayerBans.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,mDAAmD;IAChE,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,WAAW,CAAC,CAAC,CAAC,CACtB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CACvE,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/getAllowList.d.ts b/dist/native/management/getAllowList.d.ts new file mode 100644 index 0000000..317868a --- /dev/null +++ b/dist/native/management/getAllowList.d.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { PlayerProperty } from "./getConnectedPlayers"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof PlayerProperty; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=getAllowList.d.ts.map \ No newline at end of file diff --git a/dist/native/management/getAllowList.d.ts.map b/dist/native/management/getAllowList.d.ts.map new file mode 100644 index 0000000..467b909 --- /dev/null +++ b/dist/native/management/getAllowList.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getAllowList.d.ts","sourceRoot":"","sources":["../../../src/native/management/getAllowList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;;;;;;;;AAGtD,wBAqCE"} \ No newline at end of file diff --git a/dist/native/management/getAllowList.js b/dist/native/management/getAllowList.js new file mode 100644 index 0000000..c88973f --- /dev/null +++ b/dist/native/management/getAllowList.js @@ -0,0 +1,48 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const getConnectedPlayers_1 = require("./getConnectedPlayers"); +const array_1 = __importDefault(require("../../functions/array")); +exports.default = new forgescript_1.NativeFunction({ + name: "$getAllowList", + version: "1.0.0", + description: "Returns the server's allow list", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: getConnectedPlayers_1.PlayerProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: forgescript_1.ArgType.String, + } + ], + output: [ + forgescript_1.ArgType.Json, + (0, array_1.default)() + ], + async execute(ctx, [force, prop, sep]) { + const players = await ctx.client.minecraft.server?.allowlist().get(force || false).catch(ctx.noop); + if (!players || prop) + return this.success(players?.map((x) => x[prop]).join(sep ?? ", ")); + return this.successJSON(players); + } +}); +//# sourceMappingURL=getAllowList.js.map \ No newline at end of file diff --git a/dist/native/management/getAllowList.js.map b/dist/native/management/getAllowList.js.map new file mode 100644 index 0000000..96e2617 --- /dev/null +++ b/dist/native/management/getAllowList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getAllowList.js","sourceRoot":"","sources":["../../../src/native/management/getAllowList.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,+DAAsD;AACtD,kEAAyC;AAEzC,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,iCAAiC;IAC9C,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,oCAAc;SACvB;QACD;YACI,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,IAAA,eAAK,GAAkB;KAC1B;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC;QACjC,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAClG,IAAI,CAAC,OAAO,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAA;QAC1F,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/getConnectedPlayers.d.ts b/dist/native/management/getConnectedPlayers.d.ts new file mode 100644 index 0000000..d4674ec --- /dev/null +++ b/dist/native/management/getConnectedPlayers.d.ts @@ -0,0 +1,25 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +export declare enum PlayerProperty { + id = "id", + name = "name" +} +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof PlayerProperty; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=getConnectedPlayers.d.ts.map \ No newline at end of file diff --git a/dist/native/management/getConnectedPlayers.d.ts.map b/dist/native/management/getConnectedPlayers.d.ts.map new file mode 100644 index 0000000..f78a832 --- /dev/null +++ b/dist/native/management/getConnectedPlayers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getConnectedPlayers.d.ts","sourceRoot":"","sources":["../../../src/native/management/getConnectedPlayers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAG/D,oBAAY,cAAc;IACtB,EAAE,OAAO;IACT,IAAI,SAAS;CAChB;;;;;;;;;;;;;;;;;;;AAED,wBAqCE"} \ No newline at end of file diff --git a/dist/native/management/getConnectedPlayers.js b/dist/native/management/getConnectedPlayers.js new file mode 100644 index 0000000..127fbe7 --- /dev/null +++ b/dist/native/management/getConnectedPlayers.js @@ -0,0 +1,53 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.PlayerProperty = void 0; +const forgescript_1 = require("@tryforge/forgescript"); +const array_1 = __importDefault(require("../../functions/array")); +var PlayerProperty; +(function (PlayerProperty) { + PlayerProperty["id"] = "id"; + PlayerProperty["name"] = "name"; +})(PlayerProperty || (exports.PlayerProperty = PlayerProperty = {})); +exports.default = new forgescript_1.NativeFunction({ + name: "$getConnectedPlayers", + version: "1.0.0", + description: "Returns the server's currently connected players", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: PlayerProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: forgescript_1.ArgType.String, + } + ], + output: [ + forgescript_1.ArgType.Json, + (0, array_1.default)() + ], + async execute(ctx, [force, prop, sep]) { + const players = await ctx.client.minecraft.server?.getConnectedPlayers(force || false).catch(ctx.noop); + if (!players || prop) + return this.success(players?.map((x) => x[prop]).join(sep ?? ", ")); + return this.successJSON(players); + } +}); +//# sourceMappingURL=getConnectedPlayers.js.map \ No newline at end of file diff --git a/dist/native/management/getConnectedPlayers.js.map b/dist/native/management/getConnectedPlayers.js.map new file mode 100644 index 0000000..822a90a --- /dev/null +++ b/dist/native/management/getConnectedPlayers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getConnectedPlayers.js","sourceRoot":"","sources":["../../../src/native/management/getConnectedPlayers.ts"],"names":[],"mappings":";;;;;;AAAA,uDAA+D;AAC/D,kEAAyC;AAEzC,IAAY,cAGX;AAHD,WAAY,cAAc;IACtB,2BAAS,CAAA;IACT,+BAAa,CAAA;AACjB,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AAED,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,kDAAkD;IAC/D,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,cAAc;SACvB;QACD;YACI,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,IAAA,eAAK,GAAkB;KAC1B;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC;QACjC,MAAM,OAAO,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,mBAAmB,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACtG,IAAI,CAAC,OAAO,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAA;QAC1F,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/getGameRules.d.ts b/dist/native/management/getGameRules.d.ts new file mode 100644 index 0000000..ed3d636 --- /dev/null +++ b/dist/native/management/getGameRules.d.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { GameRuleProperty } from "../../properties/gameRule"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof GameRuleProperty; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=getGameRules.d.ts.map \ No newline at end of file diff --git a/dist/native/management/getGameRules.d.ts.map b/dist/native/management/getGameRules.d.ts.map new file mode 100644 index 0000000..0eac004 --- /dev/null +++ b/dist/native/management/getGameRules.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getGameRules.d.ts","sourceRoot":"","sources":["../../../src/native/management/getGameRules.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAsB,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;;;;;;;;;;;;;;;;;;;AAGhF,wBAsCE"} \ No newline at end of file diff --git a/dist/native/management/getGameRules.js b/dist/native/management/getGameRules.js new file mode 100644 index 0000000..8f7cd4e --- /dev/null +++ b/dist/native/management/getGameRules.js @@ -0,0 +1,49 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const gameRule_1 = require("../../properties/gameRule"); +const array_1 = __importDefault(require("../../functions/array")); +exports.default = new forgescript_1.NativeFunction({ + name: "$getGameRules", + version: "1.0.0", + description: "Returns the server's game rules", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: gameRule_1.GameRuleProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: forgescript_1.ArgType.String, + } + ], + output: [ + forgescript_1.ArgType.Json, + (0, array_1.default)() + ], + async execute(ctx, [force, prop, sep]) { + const map = await ctx.client.minecraft.server?.getGameRules(force || false).catch(ctx.noop); + const rules = Array.from(map?.values() || []); + if (!map || prop) + return this.success(rules.map((x) => gameRule_1.GameRuleProperties[prop](x)).join(sep ?? ", ")); + return this.successJSON(rules); + } +}); +//# sourceMappingURL=getGameRules.js.map \ No newline at end of file diff --git a/dist/native/management/getGameRules.js.map b/dist/native/management/getGameRules.js.map new file mode 100644 index 0000000..a85b5b9 --- /dev/null +++ b/dist/native/management/getGameRules.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getGameRules.js","sourceRoot":"","sources":["../../../src/native/management/getGameRules.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,wDAAgF;AAChF,kEAAyC;AAEzC,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,iCAAiC;IAC9C,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,2BAAgB;SACzB;QACD;YACI,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,IAAA,eAAK,GAAmB;KAC3B;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC;QACjC,MAAM,GAAG,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC3F,MAAM,KAAK,GAAG,KAAK,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC,CAAA;QAC7C,IAAI,CAAC,GAAG,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,6BAAkB,CAAC,IAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAA;QACvG,OAAO,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAA;IAClC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/getIPBans.d.ts b/dist/native/management/getIPBans.d.ts new file mode 100644 index 0000000..06ec097 --- /dev/null +++ b/dist/native/management/getIPBans.d.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { IPBanProperty } from "../../properties/ban"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof IPBanProperty; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=getIPBans.d.ts.map \ No newline at end of file diff --git a/dist/native/management/getIPBans.d.ts.map b/dist/native/management/getIPBans.d.ts.map new file mode 100644 index 0000000..82c5213 --- /dev/null +++ b/dist/native/management/getIPBans.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getIPBans.d.ts","sourceRoot":"","sources":["../../../src/native/management/getIPBans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAmB,aAAa,EAAE,MAAM,sBAAsB,CAAA;;;;;;;;;;;;;;;;;;;AAGrE,wBAqCE"} \ No newline at end of file diff --git a/dist/native/management/getIPBans.js b/dist/native/management/getIPBans.js new file mode 100644 index 0000000..ff92e24 --- /dev/null +++ b/dist/native/management/getIPBans.js @@ -0,0 +1,48 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const ban_1 = require("../../properties/ban"); +const array_1 = __importDefault(require("../../functions/array")); +exports.default = new forgescript_1.NativeFunction({ + name: "$getIPBans", + version: "1.0.0", + description: "Returns the server's IP ban list", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: ban_1.IPBanProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: forgescript_1.ArgType.String, + } + ], + output: [ + forgescript_1.ArgType.Json, + (0, array_1.default)() + ], + async execute(ctx, [force, prop, sep]) { + const bans = await ctx.client.minecraft.server?.ipBanList().get(force || false).catch(ctx.noop); + if (!bans || prop) + return this.success(bans?.map((x) => ban_1.IPBanProperties[prop](x)).join(sep ?? ", ")); + return this.successJSON(bans); + } +}); +//# sourceMappingURL=getIPBans.js.map \ No newline at end of file diff --git a/dist/native/management/getIPBans.js.map b/dist/native/management/getIPBans.js.map new file mode 100644 index 0000000..253111f --- /dev/null +++ b/dist/native/management/getIPBans.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getIPBans.js","sourceRoot":"","sources":["../../../src/native/management/getIPBans.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,8CAAqE;AACrE,kEAAyC;AAEzC,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,YAAY;IAClB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,kCAAkC;IAC/C,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,mBAAa;SACtB;QACD;YACI,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,IAAA,eAAK,GAAmB;KAC3B;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC/F,IAAI,CAAC,IAAI,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,qBAAe,CAAC,IAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAA;QACrG,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/getOperators.d.ts b/dist/native/management/getOperators.d.ts new file mode 100644 index 0000000..55541e2 --- /dev/null +++ b/dist/native/management/getOperators.d.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { OperatorProperty } from "../../properties/operator"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof OperatorProperty; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=getOperators.d.ts.map \ No newline at end of file diff --git a/dist/native/management/getOperators.d.ts.map b/dist/native/management/getOperators.d.ts.map new file mode 100644 index 0000000..890d51a --- /dev/null +++ b/dist/native/management/getOperators.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getOperators.d.ts","sourceRoot":"","sources":["../../../src/native/management/getOperators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAsB,gBAAgB,EAAE,MAAM,2BAA2B,CAAA;;;;;;;;;;;;;;;;;;;AAGhF,wBAqCE"} \ No newline at end of file diff --git a/dist/native/management/getOperators.js b/dist/native/management/getOperators.js new file mode 100644 index 0000000..03e582e --- /dev/null +++ b/dist/native/management/getOperators.js @@ -0,0 +1,48 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const operator_1 = require("../../properties/operator"); +const array_1 = __importDefault(require("../../functions/array")); +exports.default = new forgescript_1.NativeFunction({ + name: "$getOperators", + version: "1.0.0", + description: "Returns the server's operator list", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: operator_1.OperatorProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: forgescript_1.ArgType.String, + } + ], + output: [ + forgescript_1.ArgType.Json, + (0, array_1.default)() + ], + async execute(ctx, [force, prop, sep]) { + const operators = await ctx.client.minecraft.server?.operatorList().get(force || false).catch(ctx.noop); + if (!operators || prop) + return this.success(operators?.map((x) => operator_1.OperatorProperties[prop](x)).join(sep ?? ", ")); + return this.successJSON(operators); + } +}); +//# sourceMappingURL=getOperators.js.map \ No newline at end of file diff --git a/dist/native/management/getOperators.js.map b/dist/native/management/getOperators.js.map new file mode 100644 index 0000000..90014db --- /dev/null +++ b/dist/native/management/getOperators.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getOperators.js","sourceRoot":"","sources":["../../../src/native/management/getOperators.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,wDAAgF;AAChF,kEAAyC;AAEzC,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,oCAAoC;IACjD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,2BAAgB;SACzB;QACD;YACI,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,IAAA,eAAK,GAAmB;KAC3B;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC;QACjC,MAAM,SAAS,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACvG,IAAI,CAAC,SAAS,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,6BAAkB,CAAC,IAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAA;QAClH,OAAO,IAAI,CAAC,WAAW,CAAC,SAAS,CAAC,CAAA;IACtC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/getPlayerBans.d.ts b/dist/native/management/getPlayerBans.d.ts new file mode 100644 index 0000000..f393180 --- /dev/null +++ b/dist/native/management/getPlayerBans.d.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { UserBanProperty } from "../../properties/ban"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof UserBanProperty; +}, { + name: string; + description: string; + rest: false; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=getPlayerBans.d.ts.map \ No newline at end of file diff --git a/dist/native/management/getPlayerBans.d.ts.map b/dist/native/management/getPlayerBans.d.ts.map new file mode 100644 index 0000000..b76a33e --- /dev/null +++ b/dist/native/management/getPlayerBans.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getPlayerBans.d.ts","sourceRoot":"","sources":["../../../src/native/management/getPlayerBans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAC/D,OAAO,EAAqB,eAAe,EAAE,MAAM,sBAAsB,CAAA;;;;;;;;;;;;;;;;;;;AAGzE,wBAqCE"} \ No newline at end of file diff --git a/dist/native/management/getPlayerBans.js b/dist/native/management/getPlayerBans.js new file mode 100644 index 0000000..a762139 --- /dev/null +++ b/dist/native/management/getPlayerBans.js @@ -0,0 +1,48 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const ban_1 = require("../../properties/ban"); +const array_1 = __importDefault(require("../../functions/array")); +exports.default = new forgescript_1.NativeFunction({ + name: "$getPlayerBans", + version: "1.0.0", + description: "Returns the server's player ban list", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: ban_1.UserBanProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: forgescript_1.ArgType.String, + } + ], + output: [ + forgescript_1.ArgType.Json, + (0, array_1.default)() + ], + async execute(ctx, [force, prop, sep]) { + const bans = await ctx.client.minecraft.server?.banList().get(force || false).catch(ctx.noop); + if (!bans || prop) + return this.success(bans?.map((x) => ban_1.UserBanProperties[prop](x)).join(sep ?? ", ")); + return this.successJSON(bans); + } +}); +//# sourceMappingURL=getPlayerBans.js.map \ No newline at end of file diff --git a/dist/native/management/getPlayerBans.js.map b/dist/native/management/getPlayerBans.js.map new file mode 100644 index 0000000..aa8b138 --- /dev/null +++ b/dist/native/management/getPlayerBans.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getPlayerBans.js","sourceRoot":"","sources":["../../../src/native/management/getPlayerBans.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,8CAAyE;AACzE,kEAAyC;AAEzC,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,sCAAsC;IACnD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,qBAAe;SACxB;QACD;YACI,IAAI,EAAE,WAAW;YACjB,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,IAAA,eAAK,GAAmB;KAC3B;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,EAAE,GAAG,CAAC;QACjC,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,GAAG,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC7F,IAAI,CAAC,IAAI,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,uBAAiB,CAAC,IAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAA;QACvG,OAAO,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/getServerVersion.d.ts b/dist/native/management/getServerVersion.d.ts new file mode 100644 index 0000000..8c6831a --- /dev/null +++ b/dist/native/management/getServerVersion.d.ts @@ -0,0 +1,20 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +export declare enum VersionProperty { + name = "name", + protocol = "protocol" +} +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Enum; + enum: typeof VersionProperty; +}], true>; +export default _default; +//# sourceMappingURL=getServerVersion.d.ts.map \ No newline at end of file diff --git a/dist/native/management/getServerVersion.d.ts.map b/dist/native/management/getServerVersion.d.ts.map new file mode 100644 index 0000000..9de6999 --- /dev/null +++ b/dist/native/management/getServerVersion.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"getServerVersion.d.ts","sourceRoot":"","sources":["../../../src/native/management/getServerVersion.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE/D,oBAAY,eAAe;IACvB,IAAI,SAAS;IACb,QAAQ,aAAa;CACxB;;;;;;;;;;;;;;AAED,wBA+BE"} \ No newline at end of file diff --git a/dist/native/management/getServerVersion.js b/dist/native/management/getServerVersion.js new file mode 100644 index 0000000..33f2100 --- /dev/null +++ b/dist/native/management/getServerVersion.js @@ -0,0 +1,43 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.VersionProperty = void 0; +const forgescript_1 = require("@tryforge/forgescript"); +var VersionProperty; +(function (VersionProperty) { + VersionProperty["name"] = "name"; + VersionProperty["protocol"] = "protocol"; +})(VersionProperty || (exports.VersionProperty = VersionProperty = {})); +exports.default = new forgescript_1.NativeFunction({ + name: "$getServerVersion", + version: "1.0.0", + description: "Returns current version of the minecraft server", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: forgescript_1.ArgType.Enum, + enum: VersionProperty, + } + ], + output: [ + forgescript_1.ArgType.Json, + forgescript_1.ArgType.String + ], + async execute(ctx, [force, prop]) { + const version = (await ctx.client.minecraft.server?.getStatus(force || false).catch(ctx.noop))?.version; + if (!version || prop) + return this.success(version?.[prop]); + return this.successJSON(version); + } +}); +//# sourceMappingURL=getServerVersion.js.map \ No newline at end of file diff --git a/dist/native/management/getServerVersion.js.map b/dist/native/management/getServerVersion.js.map new file mode 100644 index 0000000..75fd15f --- /dev/null +++ b/dist/native/management/getServerVersion.js.map @@ -0,0 +1 @@ +{"version":3,"file":"getServerVersion.js","sourceRoot":"","sources":["../../../src/native/management/getServerVersion.ts"],"names":[],"mappings":";;;AAAA,uDAA+D;AAE/D,IAAY,eAGX;AAHD,WAAY,eAAe;IACvB,gCAAa,CAAA;IACb,wCAAqB,CAAA;AACzB,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B;AAED,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,iDAAiD;IAC9D,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;QACD;YACI,IAAI,EAAE,UAAU;YAChB,WAAW,EAAE,wBAAwB;YACrC,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,eAAe;SACxB;KACJ;IACD,MAAM,EAAE;QACJ,qBAAO,CAAC,IAAI;QACZ,qBAAO,CAAC,MAAM;KACjB;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,EAAE,IAAI,CAAC;QAC5B,MAAM,OAAO,GAAG,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAA;QACvG,IAAI,CAAC,OAAO,IAAI,IAAI;YAAE,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,IAAK,CAAC,CAAC,CAAA;QAC3D,OAAO,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,CAAA;IACpC,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/hasGameRulesRegistry.d.ts b/dist/native/management/hasGameRulesRegistry.d.ts new file mode 100644 index 0000000..4f21862 --- /dev/null +++ b/dist/native/management/hasGameRulesRegistry.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=hasGameRulesRegistry.d.ts.map \ No newline at end of file diff --git a/dist/native/management/hasGameRulesRegistry.d.ts.map b/dist/native/management/hasGameRulesRegistry.d.ts.map new file mode 100644 index 0000000..35a3273 --- /dev/null +++ b/dist/native/management/hasGameRulesRegistry.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"hasGameRulesRegistry.d.ts","sourceRoot":"","sources":["../../../src/native/management/hasGameRulesRegistry.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/hasGameRulesRegistry.js b/dist/native/management/hasGameRulesRegistry.js new file mode 100644 index 0000000..0e0b4ba --- /dev/null +++ b/dist/native/management/hasGameRulesRegistry.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$hasGameRulesRegistry", + version: "1.0.0", + description: "Returns whether the server has the new game rules registry", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.success(!!(await ctx.client.minecraft.server?.hasGameRulesRegistry().catch(ctx.noop))); + } +}); +//# sourceMappingURL=hasGameRulesRegistry.js.map \ No newline at end of file diff --git a/dist/native/management/hasGameRulesRegistry.js.map b/dist/native/management/hasGameRulesRegistry.js.map new file mode 100644 index 0000000..f3f93f0 --- /dev/null +++ b/dist/native/management/hasGameRulesRegistry.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hasGameRulesRegistry.js","sourceRoot":"","sources":["../../../src/native/management/hasGameRulesRegistry.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,uBAAuB;IAC7B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,4DAA4D;IACzE,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,oBAAoB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACtG,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/hasServerStarted.d.ts b/dist/native/management/hasServerStarted.d.ts new file mode 100644 index 0000000..f639fce --- /dev/null +++ b/dist/native/management/hasServerStarted.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}], true>; +export default _default; +//# sourceMappingURL=hasServerStarted.d.ts.map \ No newline at end of file diff --git a/dist/native/management/hasServerStarted.d.ts.map b/dist/native/management/hasServerStarted.d.ts.map new file mode 100644 index 0000000..f0e806d --- /dev/null +++ b/dist/native/management/hasServerStarted.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"hasServerStarted.d.ts","sourceRoot":"","sources":["../../../src/native/management/hasServerStarted.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/hasServerStarted.js b/dist/native/management/hasServerStarted.js new file mode 100644 index 0000000..987d7c6 --- /dev/null +++ b/dist/native/management/hasServerStarted.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$hasServerStarted", + version: "1.0.0", + description: "Returns whether the server has fully started", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + } + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [force]) { + return this.success(!!(await ctx.client.minecraft.server?.getStatus(force || false).catch(ctx.noop))?.started); + } +}); +//# sourceMappingURL=hasServerStarted.js.map \ No newline at end of file diff --git a/dist/native/management/hasServerStarted.js.map b/dist/native/management/hasServerStarted.js.map new file mode 100644 index 0000000..aeba1aa --- /dev/null +++ b/dist/native/management/hasServerStarted.js.map @@ -0,0 +1 @@ +{"version":3,"file":"hasServerStarted.js","sourceRoot":"","sources":["../../../src/native/management/hasServerStarted.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,8CAA8C;IAC3D,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,oDAAoD;YACjE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;QACtB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC,KAAK,IAAI,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,EAAE,OAAO,CAAC,CAAA;IAClH,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/kickPlayers.d.ts b/dist/native/management/kickPlayers.d.ts new file mode 100644 index 0000000..03a66bd --- /dev/null +++ b/dist/native/management/kickPlayers.d.ts @@ -0,0 +1,16 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: false; + type: ArgType.String; +}, { + name: string; + description: string; + rest: true; + required: true; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=kickPlayers.d.ts.map \ No newline at end of file diff --git a/dist/native/management/kickPlayers.d.ts.map b/dist/native/management/kickPlayers.d.ts.map new file mode 100644 index 0000000..7d23195 --- /dev/null +++ b/dist/native/management/kickPlayers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"kickPlayers.d.ts","sourceRoot":"","sources":["../../../src/native/management/kickPlayers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;;;AAG/D,wBAkCE"} \ No newline at end of file diff --git a/dist/native/management/kickPlayers.js b/dist/native/management/kickPlayers.js new file mode 100644 index 0000000..05fcfdb --- /dev/null +++ b/dist/native/management/kickPlayers.js @@ -0,0 +1,40 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const parsePlayer_1 = __importDefault(require("../../functions/parsePlayer")); +exports.default = new forgescript_1.NativeFunction({ + name: "$kickPlayers", + version: "1.0.0", + description: "Kicks players from the minecraft server, returns number of kicked players", + unwrap: true, + brackets: true, + experimental: true, + args: [ + { + name: "message", + description: "The message displayed to the players when they are kicked", + rest: false, + required: false, + type: forgescript_1.ArgType.String, + }, + { + name: "players", + description: "The players to kick", + rest: true, + required: true, + type: forgescript_1.ArgType.String, + } + ], + output: forgescript_1.ArgType.Number, + async execute(ctx, [msg, players]) { + const result = await ctx.client.minecraft.server?.kickPlayers(players.map((x) => (0, parsePlayer_1.default)(x)), msg || undefined).catch((err) => { + if (err?.code !== -32603) + ctx.noop(err); + }); + return this.success(result?.length || 0); + } +}); +//# sourceMappingURL=kickPlayers.js.map \ No newline at end of file diff --git a/dist/native/management/kickPlayers.js.map b/dist/native/management/kickPlayers.js.map new file mode 100644 index 0000000..b650905 --- /dev/null +++ b/dist/native/management/kickPlayers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"kickPlayers.js","sourceRoot":"","sources":["../../../src/native/management/kickPlayers.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,8EAAqD;AAErD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,2EAA2E;IACxF,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,YAAY,EAAE,IAAI;IAClB,IAAI,EAAE;QACF;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,2DAA2D;YACxE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,KAAK;YACf,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,OAAO,CAAC;QAC7B,MAAM,MAAM,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,WAAW,CACzD,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,qBAAW,EAAC,CAAC,CAAC,CAAC,EAClC,GAAG,IAAI,SAAS,CACnB,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACZ,IAAI,GAAG,EAAE,IAAI,KAAK,CAAC,KAAK;gBAAE,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;QAC3C,CAAC,CAAC,CAAA;QAEF,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,CAAC,CAAA;IAC5C,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/removeAllowList.d.ts b/dist/native/management/removeAllowList.d.ts new file mode 100644 index 0000000..521cd6b --- /dev/null +++ b/dist/native/management/removeAllowList.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: true; + required: true; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=removeAllowList.d.ts.map \ No newline at end of file diff --git a/dist/native/management/removeAllowList.d.ts.map b/dist/native/management/removeAllowList.d.ts.map new file mode 100644 index 0000000..018a1b7 --- /dev/null +++ b/dist/native/management/removeAllowList.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"removeAllowList.d.ts","sourceRoot":"","sources":["../../../src/native/management/removeAllowList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAG/D,wBAqBE"} \ No newline at end of file diff --git a/dist/native/management/removeAllowList.js b/dist/native/management/removeAllowList.js new file mode 100644 index 0000000..300b9ad --- /dev/null +++ b/dist/native/management/removeAllowList.js @@ -0,0 +1,28 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const parsePlayer_1 = __importDefault(require("../../functions/parsePlayer")); +exports.default = new forgescript_1.NativeFunction({ + name: "$removeAllowList", + version: "1.0.0", + description: "Removes players from the server's allow list, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "players", + description: "The players to remove", + rest: true, + required: true, + type: forgescript_1.ArgType.String, + }, + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [players]) { + return this.success(!!(await ctx.client.minecraft.server?.allowlist().remove(players.map(parsePlayer_1.default)).catch(ctx.noop))); + } +}); +//# sourceMappingURL=removeAllowList.js.map \ No newline at end of file diff --git a/dist/native/management/removeAllowList.js.map b/dist/native/management/removeAllowList.js.map new file mode 100644 index 0000000..4f07e2c --- /dev/null +++ b/dist/native/management/removeAllowList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"removeAllowList.js","sourceRoot":"","sources":["../../../src/native/management/removeAllowList.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,8EAAqD;AAErD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,4DAA4D;IACzE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,uBAAuB;YACpC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAClG,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/removeIPBans.d.ts b/dist/native/management/removeIPBans.d.ts new file mode 100644 index 0000000..d84a324 --- /dev/null +++ b/dist/native/management/removeIPBans.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: true; + required: true; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=removeIPBans.d.ts.map \ No newline at end of file diff --git a/dist/native/management/removeIPBans.d.ts.map b/dist/native/management/removeIPBans.d.ts.map new file mode 100644 index 0000000..32bba6f --- /dev/null +++ b/dist/native/management/removeIPBans.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"removeIPBans.d.ts","sourceRoot":"","sources":["../../../src/native/management/removeIPBans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAsBE"} \ No newline at end of file diff --git a/dist/native/management/removeIPBans.js b/dist/native/management/removeIPBans.js new file mode 100644 index 0000000..0004fba --- /dev/null +++ b/dist/native/management/removeIPBans.js @@ -0,0 +1,25 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$removeIPBans", + version: "1.0.0", + description: "Removes IP addresses from the server's ban list, returns bool", + aliases: ["$removeIPBan"], + unwrap: true, + brackets: true, + args: [ + { + name: "ips", + description: "The IP addresses to unban", + rest: true, + required: true, + type: forgescript_1.ArgType.String, + }, + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [ips]) { + return this.success(!!(await ctx.client.minecraft.server?.ipBanList().remove(ips).catch(ctx.noop))); + } +}); +//# sourceMappingURL=removeIPBans.js.map \ No newline at end of file diff --git a/dist/native/management/removeIPBans.js.map b/dist/native/management/removeIPBans.js.map new file mode 100644 index 0000000..20f1395 --- /dev/null +++ b/dist/native/management/removeIPBans.js.map @@ -0,0 +1 @@ +{"version":3,"file":"removeIPBans.js","sourceRoot":"","sources":["../../../src/native/management/removeIPBans.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,+DAA+D;IAC5E,OAAO,EAAE,CAAC,cAAc,CAAC;IACzB,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,2BAA2B;YACxC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;QACpB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAC7E,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/removeOperators.d.ts b/dist/native/management/removeOperators.d.ts new file mode 100644 index 0000000..e8076bf --- /dev/null +++ b/dist/native/management/removeOperators.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: true; + required: true; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=removeOperators.d.ts.map \ No newline at end of file diff --git a/dist/native/management/removeOperators.d.ts.map b/dist/native/management/removeOperators.d.ts.map new file mode 100644 index 0000000..6e96416 --- /dev/null +++ b/dist/native/management/removeOperators.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"removeOperators.d.ts","sourceRoot":"","sources":["../../../src/native/management/removeOperators.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAG/D,wBAsBE"} \ No newline at end of file diff --git a/dist/native/management/removeOperators.js b/dist/native/management/removeOperators.js new file mode 100644 index 0000000..f227e86 --- /dev/null +++ b/dist/native/management/removeOperators.js @@ -0,0 +1,29 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const parsePlayer_1 = __importDefault(require("../../functions/parsePlayer")); +exports.default = new forgescript_1.NativeFunction({ + name: "$removeOperators", + version: "1.0.0", + description: "Removes players from the server's operator list, returns bool", + aliases: ["$removeOperator"], + unwrap: true, + brackets: true, + args: [ + { + name: "players", + description: "The players to remove as operator", + rest: true, + required: true, + type: forgescript_1.ArgType.String, + }, + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [players]) { + return this.success(!!(await ctx.client.minecraft.server?.operatorList().remove(players.map(parsePlayer_1.default)).catch(ctx.noop))); + } +}); +//# sourceMappingURL=removeOperators.js.map \ No newline at end of file diff --git a/dist/native/management/removeOperators.js.map b/dist/native/management/removeOperators.js.map new file mode 100644 index 0000000..1f505ce --- /dev/null +++ b/dist/native/management/removeOperators.js.map @@ -0,0 +1 @@ +{"version":3,"file":"removeOperators.js","sourceRoot":"","sources":["../../../src/native/management/removeOperators.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,8EAAqD;AAErD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,+DAA+D;IAC5E,OAAO,EAAE,CAAC,iBAAiB,CAAC;IAC5B,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,mCAAmC;YAChD,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,YAAY,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CACrG,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/removePlayerBans.d.ts b/dist/native/management/removePlayerBans.d.ts new file mode 100644 index 0000000..5f588da --- /dev/null +++ b/dist/native/management/removePlayerBans.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: true; + required: true; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=removePlayerBans.d.ts.map \ No newline at end of file diff --git a/dist/native/management/removePlayerBans.d.ts.map b/dist/native/management/removePlayerBans.d.ts.map new file mode 100644 index 0000000..a5a94aa --- /dev/null +++ b/dist/native/management/removePlayerBans.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"removePlayerBans.d.ts","sourceRoot":"","sources":["../../../src/native/management/removePlayerBans.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAG/D,wBAsBE"} \ No newline at end of file diff --git a/dist/native/management/removePlayerBans.js b/dist/native/management/removePlayerBans.js new file mode 100644 index 0000000..5702679 --- /dev/null +++ b/dist/native/management/removePlayerBans.js @@ -0,0 +1,29 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const parsePlayer_1 = __importDefault(require("../../functions/parsePlayer")); +exports.default = new forgescript_1.NativeFunction({ + name: "$removePlayerBans", + version: "1.0.0", + description: "Removes players from the server's ban list, returns bool", + aliases: ["$removePlayerBan"], + unwrap: true, + brackets: true, + args: [ + { + name: "players", + description: "The players to unban", + rest: true, + required: true, + type: forgescript_1.ArgType.String, + }, + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [players]) { + return this.success(!!(await ctx.client.minecraft.server?.banList().remove(players.map(parsePlayer_1.default)).catch(ctx.noop))); + } +}); +//# sourceMappingURL=removePlayerBans.js.map \ No newline at end of file diff --git a/dist/native/management/removePlayerBans.js.map b/dist/native/management/removePlayerBans.js.map new file mode 100644 index 0000000..f49f0ac --- /dev/null +++ b/dist/native/management/removePlayerBans.js.map @@ -0,0 +1 @@ +{"version":3,"file":"removePlayerBans.js","sourceRoot":"","sources":["../../../src/native/management/removePlayerBans.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,8EAAqD;AAErD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,0DAA0D;IACvE,OAAO,EAAE,CAAC,kBAAkB,CAAC;IAC7B,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,sBAAsB;YACnC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAChG,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/saveServer.d.ts b/dist/native/management/saveServer.d.ts new file mode 100644 index 0000000..d5c0ee7 --- /dev/null +++ b/dist/native/management/saveServer.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}], true>; +export default _default; +//# sourceMappingURL=saveServer.d.ts.map \ No newline at end of file diff --git a/dist/native/management/saveServer.d.ts.map b/dist/native/management/saveServer.d.ts.map new file mode 100644 index 0000000..9de2a90 --- /dev/null +++ b/dist/native/management/saveServer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"saveServer.d.ts","sourceRoot":"","sources":["../../../src/native/management/saveServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/saveServer.js b/dist/native/management/saveServer.js new file mode 100644 index 0000000..c9c1f33 --- /dev/null +++ b/dist/native/management/saveServer.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$saveServer", + version: "1.0.0", + description: "Saves the minecraft server", + unwrap: true, + brackets: false, + args: [ + { + name: "flush", + description: "Whether to save chunks to disk immediately, defaults to true", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + } + ], + async execute(ctx, [flush]) { + await ctx.client.minecraft.server?.save(flush ?? true).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=saveServer.js.map \ No newline at end of file diff --git a/dist/native/management/saveServer.js.map b/dist/native/management/saveServer.js.map new file mode 100644 index 0000000..c754e08 --- /dev/null +++ b/dist/native/management/saveServer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"saveServer.js","sourceRoot":"","sources":["../../../src/native/management/saveServer.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,4BAA4B;IACzC,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,KAAK;IACf,IAAI,EAAE;QACF;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,8DAA8D;YAC3E,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;QACtB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACtE,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/sendSystemMessage.d.ts b/dist/native/management/sendSystemMessage.d.ts new file mode 100644 index 0000000..208b0df --- /dev/null +++ b/dist/native/management/sendSystemMessage.d.ts @@ -0,0 +1,20 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + type: ArgType.Boolean; +}, { + name: string; + description: string; + rest: true; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=sendSystemMessage.d.ts.map \ No newline at end of file diff --git a/dist/native/management/sendSystemMessage.d.ts.map b/dist/native/management/sendSystemMessage.d.ts.map new file mode 100644 index 0000000..5c9c935 --- /dev/null +++ b/dist/native/management/sendSystemMessage.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"sendSystemMessage.d.ts","sourceRoot":"","sources":["../../../src/native/management/sendSystemMessage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;;;;;;;AAG/D,wBAqCE"} \ No newline at end of file diff --git a/dist/native/management/sendSystemMessage.js b/dist/native/management/sendSystemMessage.js new file mode 100644 index 0000000..dd638c4 --- /dev/null +++ b/dist/native/management/sendSystemMessage.js @@ -0,0 +1,40 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const parsePlayer_1 = __importDefault(require("../../functions/parsePlayer")); +exports.default = new forgescript_1.NativeFunction({ + name: "$sendSystemMessage", + version: "1.0.0", + description: "Sends a system message to the minecraft server, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "message", + description: "The message to send", + rest: false, + required: true, + type: forgescript_1.ArgType.String, + }, + { + name: "overlay", + description: "Whether to display the message as an overlay above the hotbar, otherwise in chat", + rest: false, + type: forgescript_1.ArgType.Boolean, + }, + { + name: "players", + description: "The players receiving the message, omit to send to all players", + rest: true, + type: forgescript_1.ArgType.String, + } + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [msg, overlay, players]) { + return this.success(!!(await ctx.client.minecraft.server?.sendSystemMessage(msg, players?.length ? players.map((x) => (0, parsePlayer_1.default)(x)) : undefined, overlay || undefined).catch(ctx.noop))); + } +}); +//# sourceMappingURL=sendSystemMessage.js.map \ No newline at end of file diff --git a/dist/native/management/sendSystemMessage.js.map b/dist/native/management/sendSystemMessage.js.map new file mode 100644 index 0000000..fa6699f --- /dev/null +++ b/dist/native/management/sendSystemMessage.js.map @@ -0,0 +1 @@ +{"version":3,"file":"sendSystemMessage.js","sourceRoot":"","sources":["../../../src/native/management/sendSystemMessage.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,8EAAqD;AAErD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,8DAA8D;IAC3E,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,qBAAqB;YAClC,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,kFAAkF;YAC/F,IAAI,EAAE,KAAK;YACX,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;QACD;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,gEAAgE;YAC7E,IAAI,EAAE,IAAI;YACV,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,OAAO,EAAE,OAAO,CAAC;QACtC,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,iBAAiB,CAChD,GAAG,EACH,OAAO,EAAE,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAA,qBAAW,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,EAChE,OAAO,IAAI,SAAS,CACvB,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CACpB,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverAcceptTransfers.d.ts b/dist/native/management/serverAcceptTransfers.d.ts new file mode 100644 index 0000000..3357a54 --- /dev/null +++ b/dist/native/management/serverAcceptTransfers.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverAcceptTransfers.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverAcceptTransfers.d.ts.map b/dist/native/management/serverAcceptTransfers.d.ts.map new file mode 100644 index 0000000..838c654 --- /dev/null +++ b/dist/native/management/serverAcceptTransfers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverAcceptTransfers.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverAcceptTransfers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverAcceptTransfers.js b/dist/native/management/serverAcceptTransfers.js new file mode 100644 index 0000000..2eadc73 --- /dev/null +++ b/dist/native/management/serverAcceptTransfers.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverAcceptTransfers", + version: "1.0.0", + description: "Returns whether the server accepts players transferred from other servers", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getAcceptTransfers().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverAcceptTransfers.js.map \ No newline at end of file diff --git a/dist/native/management/serverAcceptTransfers.js.map b/dist/native/management/serverAcceptTransfers.js.map new file mode 100644 index 0000000..e969b9e --- /dev/null +++ b/dist/native/management/serverAcceptTransfers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverAcceptTransfers.js","sourceRoot":"","sources":["../../../src/native/management/serverAcceptTransfers.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,wBAAwB;IAC9B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,2EAA2E;IACxF,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,kBAAkB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IAC3G,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverAllowFlight.d.ts b/dist/native/management/serverAllowFlight.d.ts new file mode 100644 index 0000000..04227e4 --- /dev/null +++ b/dist/native/management/serverAllowFlight.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverAllowFlight.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverAllowFlight.d.ts.map b/dist/native/management/serverAllowFlight.d.ts.map new file mode 100644 index 0000000..1429257 --- /dev/null +++ b/dist/native/management/serverAllowFlight.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverAllowFlight.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverAllowFlight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverAllowFlight.js b/dist/native/management/serverAllowFlight.js new file mode 100644 index 0000000..57fe0be --- /dev/null +++ b/dist/native/management/serverAllowFlight.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverAllowFlight", + version: "1.0.0", + description: "Returns whether players are allowed to fly on the server", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getAllowFlight().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverAllowFlight.js.map \ No newline at end of file diff --git a/dist/native/management/serverAllowFlight.js.map b/dist/native/management/serverAllowFlight.js.map new file mode 100644 index 0000000..26da78a --- /dev/null +++ b/dist/native/management/serverAllowFlight.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverAllowFlight.js","sourceRoot":"","sources":["../../../src/native/management/serverAllowFlight.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,oBAAoB;IAC1B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,0DAA0D;IACvE,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,cAAc,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IACvG,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverAutoSave.d.ts b/dist/native/management/serverAutoSave.d.ts new file mode 100644 index 0000000..a10c53c --- /dev/null +++ b/dist/native/management/serverAutoSave.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverAutoSave.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverAutoSave.d.ts.map b/dist/native/management/serverAutoSave.d.ts.map new file mode 100644 index 0000000..62b49f0 --- /dev/null +++ b/dist/native/management/serverAutoSave.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverAutoSave.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverAutoSave.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverAutoSave.js b/dist/native/management/serverAutoSave.js new file mode 100644 index 0000000..d398ce8 --- /dev/null +++ b/dist/native/management/serverAutoSave.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverAutoSave", + version: "1.0.0", + description: "Returns whether the server automatically saves the world periodically", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getAutoSave().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverAutoSave.js.map \ No newline at end of file diff --git a/dist/native/management/serverAutoSave.js.map b/dist/native/management/serverAutoSave.js.map new file mode 100644 index 0000000..97ea93a --- /dev/null +++ b/dist/native/management/serverAutoSave.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverAutoSave.js","sourceRoot":"","sources":["../../../src/native/management/serverAutoSave.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,uEAAuE;IACpF,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IACpG,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverDifficulty.d.ts b/dist/native/management/serverDifficulty.d.ts new file mode 100644 index 0000000..5a8f0d3 --- /dev/null +++ b/dist/native/management/serverDifficulty.d.ts @@ -0,0 +1,4 @@ +import { NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverDifficulty.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverDifficulty.d.ts.map b/dist/native/management/serverDifficulty.d.ts.map new file mode 100644 index 0000000..fdd49df --- /dev/null +++ b/dist/native/management/serverDifficulty.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverDifficulty.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverDifficulty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAItD,wBAUE"} \ No newline at end of file diff --git a/dist/native/management/serverDifficulty.js b/dist/native/management/serverDifficulty.js new file mode 100644 index 0000000..cb7a88b --- /dev/null +++ b/dist/native/management/serverDifficulty.js @@ -0,0 +1,20 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const types_1 = require("../../types"); +const convertEnum_1 = __importDefault(require("../../functions/convertEnum")); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverDifficulty", + version: "1.0.0", + description: "Returns the difficulty level of the server", + unwrap: false, + output: types_1.Difficulty, + async execute(ctx) { + const diff = await ctx.client.minecraft.server?.settings().getDifficulty().catch(ctx.noop); + return this.success(diff ? (0, convertEnum_1.default)(types_1.Difficulty, diff) : null); + } +}); +//# sourceMappingURL=serverDifficulty.js.map \ No newline at end of file diff --git a/dist/native/management/serverDifficulty.js.map b/dist/native/management/serverDifficulty.js.map new file mode 100644 index 0000000..b81864c --- /dev/null +++ b/dist/native/management/serverDifficulty.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverDifficulty.js","sourceRoot":"","sources":["../../../src/native/management/serverDifficulty.ts"],"names":[],"mappings":";;;;;AAAA,uDAAsD;AACtD,uCAAwC;AACxC,8EAAqD;AAErD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,4CAA4C;IACzD,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,kBAAU;IAClB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC1F,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,qBAAW,EAAC,kBAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IACpE,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverEnforceAllowList.d.ts b/dist/native/management/serverEnforceAllowList.d.ts new file mode 100644 index 0000000..16b5fdd --- /dev/null +++ b/dist/native/management/serverEnforceAllowList.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverEnforceAllowList.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverEnforceAllowList.d.ts.map b/dist/native/management/serverEnforceAllowList.d.ts.map new file mode 100644 index 0000000..a231beb --- /dev/null +++ b/dist/native/management/serverEnforceAllowList.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverEnforceAllowList.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverEnforceAllowList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverEnforceAllowList.js b/dist/native/management/serverEnforceAllowList.js new file mode 100644 index 0000000..ddfc0b3 --- /dev/null +++ b/dist/native/management/serverEnforceAllowList.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverEnforceAllowList", + version: "1.0.0", + description: "Returns whether the server immediately kicks players when they are removed from the allow list", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getEnforceAllowList().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverEnforceAllowList.js.map \ No newline at end of file diff --git a/dist/native/management/serverEnforceAllowList.js.map b/dist/native/management/serverEnforceAllowList.js.map new file mode 100644 index 0000000..fdee38a --- /dev/null +++ b/dist/native/management/serverEnforceAllowList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverEnforceAllowList.js","sourceRoot":"","sources":["../../../src/native/management/serverEnforceAllowList.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,yBAAyB;IAC/B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gGAAgG;IAC7G,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,mBAAmB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IAC5G,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverEntityBroadcastRange.d.ts b/dist/native/management/serverEntityBroadcastRange.d.ts new file mode 100644 index 0000000..a8cdf42 --- /dev/null +++ b/dist/native/management/serverEntityBroadcastRange.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverEntityBroadcastRange.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverEntityBroadcastRange.d.ts.map b/dist/native/management/serverEntityBroadcastRange.d.ts.map new file mode 100644 index 0000000..89ed9df --- /dev/null +++ b/dist/native/management/serverEntityBroadcastRange.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverEntityBroadcastRange.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverEntityBroadcastRange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverEntityBroadcastRange.js b/dist/native/management/serverEntityBroadcastRange.js new file mode 100644 index 0000000..22e5303 --- /dev/null +++ b/dist/native/management/serverEntityBroadcastRange.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverEntityBroadcastRange", + version: "1.0.0", + description: "Returns the range in chunks around each player in which entities are updated to the player, in percentage", + unwrap: false, + output: forgescript_1.ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getEntityBroadcastRange().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverEntityBroadcastRange.js.map \ No newline at end of file diff --git a/dist/native/management/serverEntityBroadcastRange.js.map b/dist/native/management/serverEntityBroadcastRange.js.map new file mode 100644 index 0000000..266516e --- /dev/null +++ b/dist/native/management/serverEntityBroadcastRange.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverEntityBroadcastRange.js","sourceRoot":"","sources":["../../../src/native/management/serverEntityBroadcastRange.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,6BAA6B;IACnC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,2GAA2G;IACxH,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,uBAAuB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IAChH,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverForceGameMode.d.ts b/dist/native/management/serverForceGameMode.d.ts new file mode 100644 index 0000000..431f255 --- /dev/null +++ b/dist/native/management/serverForceGameMode.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverForceGameMode.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverForceGameMode.d.ts.map b/dist/native/management/serverForceGameMode.d.ts.map new file mode 100644 index 0000000..18dd834 --- /dev/null +++ b/dist/native/management/serverForceGameMode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverForceGameMode.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverForceGameMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverForceGameMode.js b/dist/native/management/serverForceGameMode.js new file mode 100644 index 0000000..ba6bb5e --- /dev/null +++ b/dist/native/management/serverForceGameMode.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverForceGameMode", + version: "1.0.0", + description: "Returns whether players are forced to use the server's game mode when they join", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getForceGameMode().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverForceGameMode.js.map \ No newline at end of file diff --git a/dist/native/management/serverForceGameMode.js.map b/dist/native/management/serverForceGameMode.js.map new file mode 100644 index 0000000..a505751 --- /dev/null +++ b/dist/native/management/serverForceGameMode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverForceGameMode.js","sourceRoot":"","sources":["../../../src/native/management/serverForceGameMode.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,iFAAiF;IAC9F,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IACzG,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverGameMode.d.ts b/dist/native/management/serverGameMode.d.ts new file mode 100644 index 0000000..1f1ff61 --- /dev/null +++ b/dist/native/management/serverGameMode.d.ts @@ -0,0 +1,4 @@ +import { NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverGameMode.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverGameMode.d.ts.map b/dist/native/management/serverGameMode.d.ts.map new file mode 100644 index 0000000..9fbc360 --- /dev/null +++ b/dist/native/management/serverGameMode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverGameMode.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverGameMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAItD,wBAUE"} \ No newline at end of file diff --git a/dist/native/management/serverGameMode.js b/dist/native/management/serverGameMode.js new file mode 100644 index 0000000..97aba41 --- /dev/null +++ b/dist/native/management/serverGameMode.js @@ -0,0 +1,20 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const types_1 = require("../../types"); +const convertEnum_1 = __importDefault(require("../../functions/convertEnum")); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverGameMode", + version: "1.0.0", + description: "Returns the default game mode for players when they join the server for the first time", + unwrap: false, + output: types_1.GameMode, + async execute(ctx) { + const mode = await ctx.client.minecraft.server?.settings().getGameMode().catch(ctx.noop); + return this.success(mode ? (0, convertEnum_1.default)(types_1.GameMode, mode) : null); + } +}); +//# sourceMappingURL=serverGameMode.js.map \ No newline at end of file diff --git a/dist/native/management/serverGameMode.js.map b/dist/native/management/serverGameMode.js.map new file mode 100644 index 0000000..8aaaf72 --- /dev/null +++ b/dist/native/management/serverGameMode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverGameMode.js","sourceRoot":"","sources":["../../../src/native/management/serverGameMode.ts"],"names":[],"mappings":";;;;;AAAA,uDAAsD;AACtD,uCAAsC;AACtC,8EAAqD;AAErD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,wFAAwF;IACrG,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,gBAAQ;IAChB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,MAAM,IAAI,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACxF,OAAO,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,qBAAW,EAAC,gBAAQ,EAAE,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAA;IAClE,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverHideOnlinePlayers.d.ts b/dist/native/management/serverHideOnlinePlayers.d.ts new file mode 100644 index 0000000..810d6c1 --- /dev/null +++ b/dist/native/management/serverHideOnlinePlayers.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverHideOnlinePlayers.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverHideOnlinePlayers.d.ts.map b/dist/native/management/serverHideOnlinePlayers.d.ts.map new file mode 100644 index 0000000..33a8506 --- /dev/null +++ b/dist/native/management/serverHideOnlinePlayers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverHideOnlinePlayers.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverHideOnlinePlayers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverHideOnlinePlayers.js b/dist/native/management/serverHideOnlinePlayers.js new file mode 100644 index 0000000..68b6912 --- /dev/null +++ b/dist/native/management/serverHideOnlinePlayers.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverHideOnlinePlayers", + version: "1.0.0", + description: "Returns whether the server hides the list of online players from the server list", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getHideOnlinePlayers().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverHideOnlinePlayers.js.map \ No newline at end of file diff --git a/dist/native/management/serverHideOnlinePlayers.js.map b/dist/native/management/serverHideOnlinePlayers.js.map new file mode 100644 index 0000000..b31f6c9 --- /dev/null +++ b/dist/native/management/serverHideOnlinePlayers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverHideOnlinePlayers.js","sourceRoot":"","sources":["../../../src/native/management/serverHideOnlinePlayers.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,0BAA0B;IAChC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,kFAAkF;IAC/F,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,oBAAoB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IAC7G,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverMOTD.d.ts b/dist/native/management/serverMOTD.d.ts new file mode 100644 index 0000000..0bebbce --- /dev/null +++ b/dist/native/management/serverMOTD.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverMOTD.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverMOTD.d.ts.map b/dist/native/management/serverMOTD.d.ts.map new file mode 100644 index 0000000..acaea8e --- /dev/null +++ b/dist/native/management/serverMOTD.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverMOTD.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverMOTD.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverMOTD.js b/dist/native/management/serverMOTD.js new file mode 100644 index 0000000..b367d60 --- /dev/null +++ b/dist/native/management/serverMOTD.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverMOTD", + version: "1.0.0", + description: "Returns the server's message of the day (MOTD)", + unwrap: false, + output: forgescript_1.ArgType.String, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getMOTD().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverMOTD.js.map \ No newline at end of file diff --git a/dist/native/management/serverMOTD.js.map b/dist/native/management/serverMOTD.js.map new file mode 100644 index 0000000..f626c08 --- /dev/null +++ b/dist/native/management/serverMOTD.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverMOTD.js","sourceRoot":"","sources":["../../../src/native/management/serverMOTD.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IAChG,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverMaxPlayers.d.ts b/dist/native/management/serverMaxPlayers.d.ts new file mode 100644 index 0000000..b4ce5ee --- /dev/null +++ b/dist/native/management/serverMaxPlayers.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverMaxPlayers.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverMaxPlayers.d.ts.map b/dist/native/management/serverMaxPlayers.d.ts.map new file mode 100644 index 0000000..abb7f96 --- /dev/null +++ b/dist/native/management/serverMaxPlayers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverMaxPlayers.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverMaxPlayers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverMaxPlayers.js b/dist/native/management/serverMaxPlayers.js new file mode 100644 index 0000000..bd20a4f --- /dev/null +++ b/dist/native/management/serverMaxPlayers.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverMaxPlayers", + version: "1.0.0", + description: "Returns the maximum number of players that can join the server", + unwrap: false, + output: forgescript_1.ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getMaxPlayers().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverMaxPlayers.js.map \ No newline at end of file diff --git a/dist/native/management/serverMaxPlayers.js.map b/dist/native/management/serverMaxPlayers.js.map new file mode 100644 index 0000000..022c68c --- /dev/null +++ b/dist/native/management/serverMaxPlayers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverMaxPlayers.js","sourceRoot":"","sources":["../../../src/native/management/serverMaxPlayers.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gEAAgE;IAC7E,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,aAAa,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IACtG,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverOperatorUserPermissionLevel.d.ts b/dist/native/management/serverOperatorUserPermissionLevel.d.ts new file mode 100644 index 0000000..a396ad9 --- /dev/null +++ b/dist/native/management/serverOperatorUserPermissionLevel.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverOperatorUserPermissionLevel.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverOperatorUserPermissionLevel.d.ts.map b/dist/native/management/serverOperatorUserPermissionLevel.d.ts.map new file mode 100644 index 0000000..4e069be --- /dev/null +++ b/dist/native/management/serverOperatorUserPermissionLevel.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverOperatorUserPermissionLevel.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverOperatorUserPermissionLevel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverOperatorUserPermissionLevel.js b/dist/native/management/serverOperatorUserPermissionLevel.js new file mode 100644 index 0000000..fdd5e0d --- /dev/null +++ b/dist/native/management/serverOperatorUserPermissionLevel.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverOperatorUserPermissionLevel", + version: "1.0.0", + description: "Returns the permission level granted to new operators", + unwrap: false, + output: forgescript_1.ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getOperatorUserPermissionLevel().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverOperatorUserPermissionLevel.js.map \ No newline at end of file diff --git a/dist/native/management/serverOperatorUserPermissionLevel.js.map b/dist/native/management/serverOperatorUserPermissionLevel.js.map new file mode 100644 index 0000000..ec488d4 --- /dev/null +++ b/dist/native/management/serverOperatorUserPermissionLevel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverOperatorUserPermissionLevel.js","sourceRoot":"","sources":["../../../src/native/management/serverOperatorUserPermissionLevel.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,oCAAoC;IAC1C,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,uDAAuD;IACpE,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,8BAA8B,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IACvH,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverPauseWhenEmptySeconds.d.ts b/dist/native/management/serverPauseWhenEmptySeconds.d.ts new file mode 100644 index 0000000..4a98101 --- /dev/null +++ b/dist/native/management/serverPauseWhenEmptySeconds.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverPauseWhenEmptySeconds.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverPauseWhenEmptySeconds.d.ts.map b/dist/native/management/serverPauseWhenEmptySeconds.d.ts.map new file mode 100644 index 0000000..6d7da61 --- /dev/null +++ b/dist/native/management/serverPauseWhenEmptySeconds.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverPauseWhenEmptySeconds.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverPauseWhenEmptySeconds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverPauseWhenEmptySeconds.js b/dist/native/management/serverPauseWhenEmptySeconds.js new file mode 100644 index 0000000..f81a684 --- /dev/null +++ b/dist/native/management/serverPauseWhenEmptySeconds.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverPauseWhenEmptySeconds", + version: "1.0.0", + description: "Returns the number of seconds before pausing server when no players are online", + unwrap: false, + output: forgescript_1.ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getPauseWhenEmptySeconds().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverPauseWhenEmptySeconds.js.map \ No newline at end of file diff --git a/dist/native/management/serverPauseWhenEmptySeconds.js.map b/dist/native/management/serverPauseWhenEmptySeconds.js.map new file mode 100644 index 0000000..3d2d67e --- /dev/null +++ b/dist/native/management/serverPauseWhenEmptySeconds.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverPauseWhenEmptySeconds.js","sourceRoot":"","sources":["../../../src/native/management/serverPauseWhenEmptySeconds.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,8BAA8B;IACpC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gFAAgF;IAC7F,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,wBAAwB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IACjH,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverPlayerIdleTimeout.d.ts b/dist/native/management/serverPlayerIdleTimeout.d.ts new file mode 100644 index 0000000..69f53ec --- /dev/null +++ b/dist/native/management/serverPlayerIdleTimeout.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverPlayerIdleTimeout.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverPlayerIdleTimeout.d.ts.map b/dist/native/management/serverPlayerIdleTimeout.d.ts.map new file mode 100644 index 0000000..13ee0d8 --- /dev/null +++ b/dist/native/management/serverPlayerIdleTimeout.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverPlayerIdleTimeout.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverPlayerIdleTimeout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverPlayerIdleTimeout.js b/dist/native/management/serverPlayerIdleTimeout.js new file mode 100644 index 0000000..053ab0b --- /dev/null +++ b/dist/native/management/serverPlayerIdleTimeout.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverPlayerIdleTimeout", + version: "1.0.0", + description: "Returns the number of minutes a player can be idle before being kicked", + unwrap: false, + output: forgescript_1.ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getPlayerIdleTimeout().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverPlayerIdleTimeout.js.map \ No newline at end of file diff --git a/dist/native/management/serverPlayerIdleTimeout.js.map b/dist/native/management/serverPlayerIdleTimeout.js.map new file mode 100644 index 0000000..61a89cb --- /dev/null +++ b/dist/native/management/serverPlayerIdleTimeout.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverPlayerIdleTimeout.js","sourceRoot":"","sources":["../../../src/native/management/serverPlayerIdleTimeout.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,0BAA0B;IAChC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,wEAAwE;IACrF,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,oBAAoB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IAC7G,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverSimulationDistance.d.ts b/dist/native/management/serverSimulationDistance.d.ts new file mode 100644 index 0000000..c8a50db --- /dev/null +++ b/dist/native/management/serverSimulationDistance.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverSimulationDistance.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverSimulationDistance.d.ts.map b/dist/native/management/serverSimulationDistance.d.ts.map new file mode 100644 index 0000000..033cc4a --- /dev/null +++ b/dist/native/management/serverSimulationDistance.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverSimulationDistance.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverSimulationDistance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverSimulationDistance.js b/dist/native/management/serverSimulationDistance.js new file mode 100644 index 0000000..712b32d --- /dev/null +++ b/dist/native/management/serverSimulationDistance.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverSimulationDistance", + version: "1.0.0", + description: "Returns the simulation distance of the server in chunks", + unwrap: false, + output: forgescript_1.ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getSimulationDistance().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverSimulationDistance.js.map \ No newline at end of file diff --git a/dist/native/management/serverSimulationDistance.js.map b/dist/native/management/serverSimulationDistance.js.map new file mode 100644 index 0000000..79cdc8a --- /dev/null +++ b/dist/native/management/serverSimulationDistance.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverSimulationDistance.js","sourceRoot":"","sources":["../../../src/native/management/serverSimulationDistance.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,2BAA2B;IACjC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,yDAAyD;IACtE,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,qBAAqB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IAC9G,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverSpawnProtectionRadius.d.ts b/dist/native/management/serverSpawnProtectionRadius.d.ts new file mode 100644 index 0000000..7ad2c0b --- /dev/null +++ b/dist/native/management/serverSpawnProtectionRadius.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverSpawnProtectionRadius.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverSpawnProtectionRadius.d.ts.map b/dist/native/management/serverSpawnProtectionRadius.d.ts.map new file mode 100644 index 0000000..d09b185 --- /dev/null +++ b/dist/native/management/serverSpawnProtectionRadius.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverSpawnProtectionRadius.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverSpawnProtectionRadius.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverSpawnProtectionRadius.js b/dist/native/management/serverSpawnProtectionRadius.js new file mode 100644 index 0000000..bf38719 --- /dev/null +++ b/dist/native/management/serverSpawnProtectionRadius.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverSpawnProtectionRadius", + version: "1.0.0", + description: "Returns the radius around the world spawn point that is protected from non-operator players", + unwrap: false, + output: forgescript_1.ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getSpawnProtectionRadius().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverSpawnProtectionRadius.js.map \ No newline at end of file diff --git a/dist/native/management/serverSpawnProtectionRadius.js.map b/dist/native/management/serverSpawnProtectionRadius.js.map new file mode 100644 index 0000000..7675af2 --- /dev/null +++ b/dist/native/management/serverSpawnProtectionRadius.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverSpawnProtectionRadius.js","sourceRoot":"","sources":["../../../src/native/management/serverSpawnProtectionRadius.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,8BAA8B;IACpC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,6FAA6F;IAC1G,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,wBAAwB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IACjH,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverStatusHeartbeatInterval.d.ts b/dist/native/management/serverStatusHeartbeatInterval.d.ts new file mode 100644 index 0000000..0c3230c --- /dev/null +++ b/dist/native/management/serverStatusHeartbeatInterval.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverStatusHeartbeatInterval.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverStatusHeartbeatInterval.d.ts.map b/dist/native/management/serverStatusHeartbeatInterval.d.ts.map new file mode 100644 index 0000000..6abf1d3 --- /dev/null +++ b/dist/native/management/serverStatusHeartbeatInterval.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverStatusHeartbeatInterval.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverStatusHeartbeatInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverStatusHeartbeatInterval.js b/dist/native/management/serverStatusHeartbeatInterval.js new file mode 100644 index 0000000..d0b5411 --- /dev/null +++ b/dist/native/management/serverStatusHeartbeatInterval.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverStatusHeartbeatInterval", + version: "1.0.0", + description: "Returns the interval in seconds between status heartbeats sent to server management clients", + unwrap: false, + output: forgescript_1.ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getStatusHeartbeatInterval().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverStatusHeartbeatInterval.js.map \ No newline at end of file diff --git a/dist/native/management/serverStatusHeartbeatInterval.js.map b/dist/native/management/serverStatusHeartbeatInterval.js.map new file mode 100644 index 0000000..a4b3b4b --- /dev/null +++ b/dist/native/management/serverStatusHeartbeatInterval.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverStatusHeartbeatInterval.js","sourceRoot":"","sources":["../../../src/native/management/serverStatusHeartbeatInterval.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,gCAAgC;IACtC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,6FAA6F;IAC1G,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,0BAA0B,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IACnH,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverStatusReplies.d.ts b/dist/native/management/serverStatusReplies.d.ts new file mode 100644 index 0000000..d75de49 --- /dev/null +++ b/dist/native/management/serverStatusReplies.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverStatusReplies.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverStatusReplies.d.ts.map b/dist/native/management/serverStatusReplies.d.ts.map new file mode 100644 index 0000000..bca6a77 --- /dev/null +++ b/dist/native/management/serverStatusReplies.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverStatusReplies.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverStatusReplies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverStatusReplies.js b/dist/native/management/serverStatusReplies.js new file mode 100644 index 0000000..7546dad --- /dev/null +++ b/dist/native/management/serverStatusReplies.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverStatusReplies", + version: "1.0.0", + description: "Returns whether the server responds to status requests in the multiplayer server list", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getStatusReplies().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverStatusReplies.js.map \ No newline at end of file diff --git a/dist/native/management/serverStatusReplies.js.map b/dist/native/management/serverStatusReplies.js.map new file mode 100644 index 0000000..8fd5571 --- /dev/null +++ b/dist/native/management/serverStatusReplies.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverStatusReplies.js","sourceRoot":"","sources":["../../../src/native/management/serverStatusReplies.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,uFAAuF;IACpG,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,gBAAgB,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IACzG,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverUseAllowList.d.ts b/dist/native/management/serverUseAllowList.d.ts new file mode 100644 index 0000000..927d5d9 --- /dev/null +++ b/dist/native/management/serverUseAllowList.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverUseAllowList.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverUseAllowList.d.ts.map b/dist/native/management/serverUseAllowList.d.ts.map new file mode 100644 index 0000000..03b59cf --- /dev/null +++ b/dist/native/management/serverUseAllowList.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverUseAllowList.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverUseAllowList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverUseAllowList.js b/dist/native/management/serverUseAllowList.js new file mode 100644 index 0000000..a772c28 --- /dev/null +++ b/dist/native/management/serverUseAllowList.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverUseAllowList", + version: "1.0.0", + description: "Returns whether the server uses the allow list", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getUseAllowList().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverUseAllowList.js.map \ No newline at end of file diff --git a/dist/native/management/serverUseAllowList.js.map b/dist/native/management/serverUseAllowList.js.map new file mode 100644 index 0000000..7f4cc2d --- /dev/null +++ b/dist/native/management/serverUseAllowList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverUseAllowList.js","sourceRoot":"","sources":["../../../src/native/management/serverUseAllowList.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,eAAe,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IACxG,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/serverViewDistance.d.ts b/dist/native/management/serverViewDistance.d.ts new file mode 100644 index 0000000..2934c6f --- /dev/null +++ b/dist/native/management/serverViewDistance.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=serverViewDistance.d.ts.map \ No newline at end of file diff --git a/dist/native/management/serverViewDistance.d.ts.map b/dist/native/management/serverViewDistance.d.ts.map new file mode 100644 index 0000000..c8c7628 --- /dev/null +++ b/dist/native/management/serverViewDistance.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverViewDistance.d.ts","sourceRoot":"","sources":["../../../src/native/management/serverViewDistance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/serverViewDistance.js b/dist/native/management/serverViewDistance.js new file mode 100644 index 0000000..f32d310 --- /dev/null +++ b/dist/native/management/serverViewDistance.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$serverViewDistance", + version: "1.0.0", + description: "Returns the view distance of the server in chunks", + unwrap: false, + output: forgescript_1.ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getViewDistance().catch(ctx.noop)); + } +}); +//# sourceMappingURL=serverViewDistance.js.map \ No newline at end of file diff --git a/dist/native/management/serverViewDistance.js.map b/dist/native/management/serverViewDistance.js.map new file mode 100644 index 0000000..1e02abf --- /dev/null +++ b/dist/native/management/serverViewDistance.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverViewDistance.js","sourceRoot":"","sources":["../../../src/native/management/serverViewDistance.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,mDAAmD;IAChE,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,MAAM;IACtB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,eAAe,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAA;IACxG,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setAcceptTransfers.d.ts b/dist/native/management/setAcceptTransfers.d.ts new file mode 100644 index 0000000..92a1fda --- /dev/null +++ b/dist/native/management/setAcceptTransfers.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}], true>; +export default _default; +//# sourceMappingURL=setAcceptTransfers.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setAcceptTransfers.d.ts.map b/dist/native/management/setAcceptTransfers.d.ts.map new file mode 100644 index 0000000..3f07cb3 --- /dev/null +++ b/dist/native/management/setAcceptTransfers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setAcceptTransfers.d.ts","sourceRoot":"","sources":["../../../src/native/management/setAcceptTransfers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setAcceptTransfers.js b/dist/native/management/setAcceptTransfers.js new file mode 100644 index 0000000..96a3844 --- /dev/null +++ b/dist/native/management/setAcceptTransfers.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setAcceptTransfers", + version: "1.0.0", + description: "Sets whether the server accepts players transferred from other servers", + unwrap: true, + brackets: true, + args: [ + { + name: "accept", + description: "Whether to accept transferred players", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + } + ], + async execute(ctx, [accept]) { + await ctx.client.minecraft.server?.settings().setAcceptTransfers(accept).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setAcceptTransfers.js.map \ No newline at end of file diff --git a/dist/native/management/setAcceptTransfers.js.map b/dist/native/management/setAcceptTransfers.js.map new file mode 100644 index 0000000..4ae41b2 --- /dev/null +++ b/dist/native/management/setAcceptTransfers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setAcceptTransfers.js","sourceRoot":"","sources":["../../../src/native/management/setAcceptTransfers.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,qBAAqB;IAC3B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,wEAAwE;IACrF,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,uCAAuC;YACpD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;QACvB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACxF,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setAllowFlight.d.ts b/dist/native/management/setAllowFlight.d.ts new file mode 100644 index 0000000..e122dcf --- /dev/null +++ b/dist/native/management/setAllowFlight.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}], true>; +export default _default; +//# sourceMappingURL=setAllowFlight.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setAllowFlight.d.ts.map b/dist/native/management/setAllowFlight.d.ts.map new file mode 100644 index 0000000..83d7695 --- /dev/null +++ b/dist/native/management/setAllowFlight.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setAllowFlight.d.ts","sourceRoot":"","sources":["../../../src/native/management/setAllowFlight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setAllowFlight.js b/dist/native/management/setAllowFlight.js new file mode 100644 index 0000000..8ef316e --- /dev/null +++ b/dist/native/management/setAllowFlight.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setAllowFlight", + version: "1.0.0", + description: "Sets whether players are allowed to fly on the server", + unwrap: true, + brackets: true, + args: [ + { + name: "allow", + description: "Whether to allow flying for players", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + } + ], + async execute(ctx, [allow]) { + await ctx.client.minecraft.server?.settings().setAllowFlight(allow).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setAllowFlight.js.map \ No newline at end of file diff --git a/dist/native/management/setAllowFlight.js.map b/dist/native/management/setAllowFlight.js.map new file mode 100644 index 0000000..13a0e74 --- /dev/null +++ b/dist/native/management/setAllowFlight.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setAllowFlight.js","sourceRoot":"","sources":["../../../src/native/management/setAllowFlight.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,uDAAuD;IACpE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,qCAAqC;YAClD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;QACtB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACnF,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setAllowList.d.ts b/dist/native/management/setAllowList.d.ts new file mode 100644 index 0000000..2548175 --- /dev/null +++ b/dist/native/management/setAllowList.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: true; + required: true; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=setAllowList.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setAllowList.d.ts.map b/dist/native/management/setAllowList.d.ts.map new file mode 100644 index 0000000..bd24491 --- /dev/null +++ b/dist/native/management/setAllowList.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setAllowList.d.ts","sourceRoot":"","sources":["../../../src/native/management/setAllowList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAG/D,wBAqBE"} \ No newline at end of file diff --git a/dist/native/management/setAllowList.js b/dist/native/management/setAllowList.js new file mode 100644 index 0000000..3ae61ed --- /dev/null +++ b/dist/native/management/setAllowList.js @@ -0,0 +1,28 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const parsePlayer_1 = __importDefault(require("../../functions/parsePlayer")); +exports.default = new forgescript_1.NativeFunction({ + name: "$setAllowList", + version: "1.0.0", + description: "Overwrites the existing allow list with a set of players, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "players", + description: "The players to set", + rest: true, + required: true, + type: forgescript_1.ArgType.String, + }, + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [players]) { + return this.success(!!(await ctx.client.minecraft.server?.allowlist().set(players.map(parsePlayer_1.default)).catch(ctx.noop))); + } +}); +//# sourceMappingURL=setAllowList.js.map \ No newline at end of file diff --git a/dist/native/management/setAllowList.js.map b/dist/native/management/setAllowList.js.map new file mode 100644 index 0000000..25c6764 --- /dev/null +++ b/dist/native/management/setAllowList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setAllowList.js","sourceRoot":"","sources":["../../../src/native/management/setAllowList.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,8EAAqD;AAErD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,eAAe;IACrB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,wEAAwE;IACrF,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,oBAAoB;YACjC,IAAI,EAAE,IAAI;YACV,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;QACxB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAClB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,qBAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAC/F,CAAC,CAAA;IACN,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setAutoSave.d.ts b/dist/native/management/setAutoSave.d.ts new file mode 100644 index 0000000..68afac9 --- /dev/null +++ b/dist/native/management/setAutoSave.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}], true>; +export default _default; +//# sourceMappingURL=setAutoSave.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setAutoSave.d.ts.map b/dist/native/management/setAutoSave.d.ts.map new file mode 100644 index 0000000..fab7ff4 --- /dev/null +++ b/dist/native/management/setAutoSave.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setAutoSave.d.ts","sourceRoot":"","sources":["../../../src/native/management/setAutoSave.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setAutoSave.js b/dist/native/management/setAutoSave.js new file mode 100644 index 0000000..7736e1b --- /dev/null +++ b/dist/native/management/setAutoSave.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setAutoSave", + version: "1.0.0", + description: "Sets whether the server automatically saves the world periodically", + unwrap: true, + brackets: true, + args: [ + { + name: "save", + description: "Whether to enable auto-saving the world", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + } + ], + async execute(ctx, [save]) { + await ctx.client.minecraft.server?.settings().setAutoSave(save).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setAutoSave.js.map \ No newline at end of file diff --git a/dist/native/management/setAutoSave.js.map b/dist/native/management/setAutoSave.js.map new file mode 100644 index 0000000..026a01f --- /dev/null +++ b/dist/native/management/setAutoSave.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setAutoSave.js","sourceRoot":"","sources":["../../../src/native/management/setAutoSave.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,oEAAoE;IACjF,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QACrB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC/E,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setDifficulty.d.ts b/dist/native/management/setDifficulty.d.ts new file mode 100644 index 0000000..cd25eaa --- /dev/null +++ b/dist/native/management/setDifficulty.d.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { Difficulty } from "../../types"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Enum; + enum: typeof Difficulty; +}], true>; +export default _default; +//# sourceMappingURL=setDifficulty.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setDifficulty.d.ts.map b/dist/native/management/setDifficulty.d.ts.map new file mode 100644 index 0000000..f2d34f2 --- /dev/null +++ b/dist/native/management/setDifficulty.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setDifficulty.d.ts","sourceRoot":"","sources":["../../../src/native/management/setDifficulty.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE/D,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAA;;;;;;;;;AAGxC,wBAoBE"} \ No newline at end of file diff --git a/dist/native/management/setDifficulty.js b/dist/native/management/setDifficulty.js new file mode 100644 index 0000000..f18c094 --- /dev/null +++ b/dist/native/management/setDifficulty.js @@ -0,0 +1,31 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const mc_server_management_1 = require("mc-server-management"); +const types_1 = require("../../types"); +const transformEnum_1 = __importDefault(require("../../functions/transformEnum")); +exports.default = new forgescript_1.NativeFunction({ + name: "$setDifficulty", + version: "1.0.0", + description: "Sets the difficulty level of the world", + unwrap: true, + brackets: true, + args: [ + { + name: "difficulty", + description: "The difficulty level to set", + rest: false, + required: true, + type: forgescript_1.ArgType.Enum, + enum: types_1.Difficulty + } + ], + async execute(ctx, [diff]) { + await ctx.client.minecraft.server?.settings().setDifficulty((0, transformEnum_1.default)(diff, mc_server_management_1.Difficulty)).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setDifficulty.js.map \ No newline at end of file diff --git a/dist/native/management/setDifficulty.js.map b/dist/native/management/setDifficulty.js.map new file mode 100644 index 0000000..0491111 --- /dev/null +++ b/dist/native/management/setDifficulty.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setDifficulty.js","sourceRoot":"","sources":["../../../src/native/management/setDifficulty.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,+DAAmE;AACnE,uCAAwC;AACxC,kFAAyD;AAEzD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,wCAAwC;IACrD,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,kBAAU;SACnB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QACrB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,aAAa,CAAC,IAAA,uBAAa,EAAC,IAAI,EAAE,iCAAc,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAChH,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setEnforceAllowList.d.ts b/dist/native/management/setEnforceAllowList.d.ts new file mode 100644 index 0000000..1e6de78 --- /dev/null +++ b/dist/native/management/setEnforceAllowList.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}], true>; +export default _default; +//# sourceMappingURL=setEnforceAllowList.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setEnforceAllowList.d.ts.map b/dist/native/management/setEnforceAllowList.d.ts.map new file mode 100644 index 0000000..bbc32cc --- /dev/null +++ b/dist/native/management/setEnforceAllowList.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setEnforceAllowList.d.ts","sourceRoot":"","sources":["../../../src/native/management/setEnforceAllowList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setEnforceAllowList.js b/dist/native/management/setEnforceAllowList.js new file mode 100644 index 0000000..7e3ade7 --- /dev/null +++ b/dist/native/management/setEnforceAllowList.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setEnforceAllowList", + version: "1.0.0", + description: "Sets whether the server immediately kicks players when they are removed from the allow list", + unwrap: true, + brackets: true, + args: [ + { + name: "enforce", + description: "Whether to enable enforcement", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + } + ], + async execute(ctx, [enforce]) { + await ctx.client.minecraft.server?.settings().setEnforceAllowList(enforce).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setEnforceAllowList.js.map \ No newline at end of file diff --git a/dist/native/management/setEnforceAllowList.js.map b/dist/native/management/setEnforceAllowList.js.map new file mode 100644 index 0000000..e40550e --- /dev/null +++ b/dist/native/management/setEnforceAllowList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setEnforceAllowList.js","sourceRoot":"","sources":["../../../src/native/management/setEnforceAllowList.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,sBAAsB;IAC5B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,6FAA6F;IAC1G,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;QACxB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,mBAAmB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC1F,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setEntityBroadcastRange.d.ts b/dist/native/management/setEntityBroadcastRange.d.ts new file mode 100644 index 0000000..8b5cc2f --- /dev/null +++ b/dist/native/management/setEntityBroadcastRange.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=setEntityBroadcastRange.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setEntityBroadcastRange.d.ts.map b/dist/native/management/setEntityBroadcastRange.d.ts.map new file mode 100644 index 0000000..20875ef --- /dev/null +++ b/dist/native/management/setEntityBroadcastRange.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setEntityBroadcastRange.d.ts","sourceRoot":"","sources":["../../../src/native/management/setEntityBroadcastRange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setEntityBroadcastRange.js b/dist/native/management/setEntityBroadcastRange.js new file mode 100644 index 0000000..dd5900c --- /dev/null +++ b/dist/native/management/setEntityBroadcastRange.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setEntityBroadcastRange", + version: "1.0.0", + description: "Sets the range in chunks around each player in which entities are updated to the players, in percentage", + unwrap: true, + brackets: true, + args: [ + { + name: "percentage", + description: "The entity broadcast range percentage (min 10, max 1000)", + rest: false, + required: true, + type: forgescript_1.ArgType.Number, + } + ], + async execute(ctx, [percentage]) { + await ctx.client.minecraft.server?.settings().setEntityBroadcastRange(percentage).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setEntityBroadcastRange.js.map \ No newline at end of file diff --git a/dist/native/management/setEntityBroadcastRange.js.map b/dist/native/management/setEntityBroadcastRange.js.map new file mode 100644 index 0000000..722b547 --- /dev/null +++ b/dist/native/management/setEntityBroadcastRange.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setEntityBroadcastRange.js","sourceRoot":"","sources":["../../../src/native/management/setEntityBroadcastRange.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,0BAA0B;IAChC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,yGAAyG;IACtH,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,YAAY;YAClB,WAAW,EAAE,0DAA0D;YACvE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,UAAU,CAAC;QAC3B,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,uBAAuB,CAAC,UAAU,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACjG,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setForceGameMode.d.ts b/dist/native/management/setForceGameMode.d.ts new file mode 100644 index 0000000..ecaae0a --- /dev/null +++ b/dist/native/management/setForceGameMode.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}], true>; +export default _default; +//# sourceMappingURL=setForceGameMode.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setForceGameMode.d.ts.map b/dist/native/management/setForceGameMode.d.ts.map new file mode 100644 index 0000000..dfd2a76 --- /dev/null +++ b/dist/native/management/setForceGameMode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setForceGameMode.d.ts","sourceRoot":"","sources":["../../../src/native/management/setForceGameMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setForceGameMode.js b/dist/native/management/setForceGameMode.js new file mode 100644 index 0000000..0d4d29b --- /dev/null +++ b/dist/native/management/setForceGameMode.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setForceGameMode", + version: "1.0.0", + description: "Sets whether players are forced to use the server's game mode when they join", + unwrap: true, + brackets: true, + args: [ + { + name: "force", + description: "Whether to force the server's game mode", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + } + ], + async execute(ctx, [force]) { + await ctx.client.minecraft.server?.settings().setForceGameMode(force).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setForceGameMode.js.map \ No newline at end of file diff --git a/dist/native/management/setForceGameMode.js.map b/dist/native/management/setForceGameMode.js.map new file mode 100644 index 0000000..7409b68 --- /dev/null +++ b/dist/native/management/setForceGameMode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setForceGameMode.js","sourceRoot":"","sources":["../../../src/native/management/setForceGameMode.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,8EAA8E;IAC3F,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,yCAAyC;YACtD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;QACtB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACrF,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setGameMode.d.ts b/dist/native/management/setGameMode.d.ts new file mode 100644 index 0000000..1964103 --- /dev/null +++ b/dist/native/management/setGameMode.d.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +import { GameMode } from "../../types"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Enum; + enum: typeof GameMode; +}], true>; +export default _default; +//# sourceMappingURL=setGameMode.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setGameMode.d.ts.map b/dist/native/management/setGameMode.d.ts.map new file mode 100644 index 0000000..26579f6 --- /dev/null +++ b/dist/native/management/setGameMode.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setGameMode.d.ts","sourceRoot":"","sources":["../../../src/native/management/setGameMode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAA;;;;;;;;;AAGtC,wBAoBE"} \ No newline at end of file diff --git a/dist/native/management/setGameMode.js b/dist/native/management/setGameMode.js new file mode 100644 index 0000000..a5c6f6f --- /dev/null +++ b/dist/native/management/setGameMode.js @@ -0,0 +1,31 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +const mc_server_management_1 = require("mc-server-management"); +const types_1 = require("../../types"); +const transformEnum_1 = __importDefault(require("../../functions/transformEnum")); +exports.default = new forgescript_1.NativeFunction({ + name: "$setGameMode", + version: "1.0.0", + description: "Sets the default game mode for players when they join the server for the first time", + unwrap: true, + brackets: true, + args: [ + { + name: "mode", + description: "The default game mode to set", + rest: false, + required: true, + type: forgescript_1.ArgType.Enum, + enum: types_1.GameMode, + } + ], + async execute(ctx, [mode]) { + await ctx.client.minecraft.server?.settings().setGameMode((0, transformEnum_1.default)(mode, mc_server_management_1.GameMode)).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setGameMode.js.map \ No newline at end of file diff --git a/dist/native/management/setGameMode.js.map b/dist/native/management/setGameMode.js.map new file mode 100644 index 0000000..70ac893 --- /dev/null +++ b/dist/native/management/setGameMode.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setGameMode.js","sourceRoot":"","sources":["../../../src/native/management/setGameMode.ts"],"names":[],"mappings":";;;;;AAAA,uDAA+D;AAC/D,+DAA+D;AAC/D,uCAAsC;AACtC,kFAAyD;AAEzD,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,cAAc;IACpB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,qFAAqF;IAClG,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,8BAA8B;YAC3C,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,IAAI;YAClB,IAAI,EAAE,gBAAQ;SACjB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QACrB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,WAAW,CAAC,IAAA,uBAAa,EAAC,IAAI,EAAE,+BAAY,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC5G,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setHideOnlinePlayers.d.ts b/dist/native/management/setHideOnlinePlayers.d.ts new file mode 100644 index 0000000..538f588 --- /dev/null +++ b/dist/native/management/setHideOnlinePlayers.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}], true>; +export default _default; +//# sourceMappingURL=setHideOnlinePlayers.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setHideOnlinePlayers.d.ts.map b/dist/native/management/setHideOnlinePlayers.d.ts.map new file mode 100644 index 0000000..ad6ac2f --- /dev/null +++ b/dist/native/management/setHideOnlinePlayers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setHideOnlinePlayers.d.ts","sourceRoot":"","sources":["../../../src/native/management/setHideOnlinePlayers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setHideOnlinePlayers.js b/dist/native/management/setHideOnlinePlayers.js new file mode 100644 index 0000000..bbb05ac --- /dev/null +++ b/dist/native/management/setHideOnlinePlayers.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setHideOnlinePlayers", + version: "1.0.0", + description: "Sets whether the server hides the list of online players from the server list", + unwrap: true, + brackets: true, + args: [ + { + name: "hide", + description: "Whether to hide the list of online players", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + } + ], + async execute(ctx, [hide]) { + await ctx.client.minecraft.server?.settings().setHideOnlinePlayers(hide).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setHideOnlinePlayers.js.map \ No newline at end of file diff --git a/dist/native/management/setHideOnlinePlayers.js.map b/dist/native/management/setHideOnlinePlayers.js.map new file mode 100644 index 0000000..b158228 --- /dev/null +++ b/dist/native/management/setHideOnlinePlayers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setHideOnlinePlayers.js","sourceRoot":"","sources":["../../../src/native/management/setHideOnlinePlayers.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,uBAAuB;IAC7B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,+EAA+E;IAC5F,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,4CAA4C;YACzD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QACrB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACxF,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setMOTD.d.ts b/dist/native/management/setMOTD.d.ts new file mode 100644 index 0000000..08b923f --- /dev/null +++ b/dist/native/management/setMOTD.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=setMOTD.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setMOTD.d.ts.map b/dist/native/management/setMOTD.d.ts.map new file mode 100644 index 0000000..fc44321 --- /dev/null +++ b/dist/native/management/setMOTD.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setMOTD.d.ts","sourceRoot":"","sources":["../../../src/native/management/setMOTD.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setMOTD.js b/dist/native/management/setMOTD.js new file mode 100644 index 0000000..fdca0e1 --- /dev/null +++ b/dist/native/management/setMOTD.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setMOTD", + version: "1.0.0", + description: "Sets the message of the day (MOTD) for this server", + unwrap: true, + brackets: true, + args: [ + { + name: "motd", + description: "The MOTD to set", + rest: false, + required: true, + type: forgescript_1.ArgType.String, + } + ], + async execute(ctx, [motd]) { + await ctx.client.minecraft.server?.settings().setMOTD(motd).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setMOTD.js.map \ No newline at end of file diff --git a/dist/native/management/setMOTD.js.map b/dist/native/management/setMOTD.js.map new file mode 100644 index 0000000..362b18d --- /dev/null +++ b/dist/native/management/setMOTD.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setMOTD.js","sourceRoot":"","sources":["../../../src/native/management/setMOTD.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,UAAU;IAChB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,oDAAoD;IACjE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,MAAM;YACZ,WAAW,EAAE,iBAAiB;YAC9B,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC;QACrB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC3E,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setMaxPlayers.d.ts b/dist/native/management/setMaxPlayers.d.ts new file mode 100644 index 0000000..1c5186d --- /dev/null +++ b/dist/native/management/setMaxPlayers.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=setMaxPlayers.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setMaxPlayers.d.ts.map b/dist/native/management/setMaxPlayers.d.ts.map new file mode 100644 index 0000000..742ea88 --- /dev/null +++ b/dist/native/management/setMaxPlayers.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setMaxPlayers.d.ts","sourceRoot":"","sources":["../../../src/native/management/setMaxPlayers.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setMaxPlayers.js b/dist/native/management/setMaxPlayers.js new file mode 100644 index 0000000..cd58b62 --- /dev/null +++ b/dist/native/management/setMaxPlayers.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setMaxPlayers", + version: "1.0.0", + description: "Sets the maximum number of players that can join the server", + unwrap: true, + brackets: true, + args: [ + { + name: "max", + description: "The maximum number of players", + rest: false, + required: true, + type: forgescript_1.ArgType.Number, + } + ], + async execute(ctx, [max]) { + await ctx.client.minecraft.server?.settings().setMaxPlayers(max).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setMaxPlayers.js.map \ No newline at end of file diff --git a/dist/native/management/setMaxPlayers.js.map b/dist/native/management/setMaxPlayers.js.map new file mode 100644 index 0000000..727ae8f --- /dev/null +++ b/dist/native/management/setMaxPlayers.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setMaxPlayers.js","sourceRoot":"","sources":["../../../src/native/management/setMaxPlayers.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,gBAAgB;IACtB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,6DAA6D;IAC1E,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,+BAA+B;YAC5C,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,CAAC;QACpB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAChF,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setOperatorUserPermissionLevel.d.ts b/dist/native/management/setOperatorUserPermissionLevel.d.ts new file mode 100644 index 0000000..834eaf0 --- /dev/null +++ b/dist/native/management/setOperatorUserPermissionLevel.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=setOperatorUserPermissionLevel.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setOperatorUserPermissionLevel.d.ts.map b/dist/native/management/setOperatorUserPermissionLevel.d.ts.map new file mode 100644 index 0000000..9ec8742 --- /dev/null +++ b/dist/native/management/setOperatorUserPermissionLevel.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setOperatorUserPermissionLevel.d.ts","sourceRoot":"","sources":["../../../src/native/management/setOperatorUserPermissionLevel.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setOperatorUserPermissionLevel.js b/dist/native/management/setOperatorUserPermissionLevel.js new file mode 100644 index 0000000..e2e3402 --- /dev/null +++ b/dist/native/management/setOperatorUserPermissionLevel.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setOperatorUserPermissionLevel", + version: "1.0.0", + description: "Sets the permission level granted to new operators", + unwrap: true, + brackets: true, + args: [ + { + name: "level", + description: "The operator user permission level (from 1 to 4, with 4 being the highest)", + rest: false, + required: true, + type: forgescript_1.ArgType.Number, + } + ], + async execute(ctx, [level]) { + await ctx.client.minecraft.server?.settings().setOperatorUserPermissionLevel(level).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setOperatorUserPermissionLevel.js.map \ No newline at end of file diff --git a/dist/native/management/setOperatorUserPermissionLevel.js.map b/dist/native/management/setOperatorUserPermissionLevel.js.map new file mode 100644 index 0000000..3cd29f8 --- /dev/null +++ b/dist/native/management/setOperatorUserPermissionLevel.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setOperatorUserPermissionLevel.js","sourceRoot":"","sources":["../../../src/native/management/setOperatorUserPermissionLevel.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,iCAAiC;IACvC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,oDAAoD;IACjE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,4EAA4E;YACzF,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;QACtB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,8BAA8B,CAAC,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACnG,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setPauseWhenEmptySeconds.d.ts b/dist/native/management/setPauseWhenEmptySeconds.d.ts new file mode 100644 index 0000000..6fdc9ff --- /dev/null +++ b/dist/native/management/setPauseWhenEmptySeconds.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=setPauseWhenEmptySeconds.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setPauseWhenEmptySeconds.d.ts.map b/dist/native/management/setPauseWhenEmptySeconds.d.ts.map new file mode 100644 index 0000000..7cc901d --- /dev/null +++ b/dist/native/management/setPauseWhenEmptySeconds.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setPauseWhenEmptySeconds.d.ts","sourceRoot":"","sources":["../../../src/native/management/setPauseWhenEmptySeconds.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setPauseWhenEmptySeconds.js b/dist/native/management/setPauseWhenEmptySeconds.js new file mode 100644 index 0000000..4357f9f --- /dev/null +++ b/dist/native/management/setPauseWhenEmptySeconds.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setPauseWhenEmptySeconds", + version: "1.0.0", + description: "Sets the number of seconds before pausing server when no players are online", + unwrap: true, + brackets: true, + args: [ + { + name: "seconds", + description: "The number of seconds before pausing when empty", + rest: false, + required: true, + type: forgescript_1.ArgType.Number, + } + ], + async execute(ctx, [seconds]) { + await ctx.client.minecraft.server?.settings().setPauseWhenEmptySeconds(seconds).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setPauseWhenEmptySeconds.js.map \ No newline at end of file diff --git a/dist/native/management/setPauseWhenEmptySeconds.js.map b/dist/native/management/setPauseWhenEmptySeconds.js.map new file mode 100644 index 0000000..150b2c5 --- /dev/null +++ b/dist/native/management/setPauseWhenEmptySeconds.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setPauseWhenEmptySeconds.js","sourceRoot":"","sources":["../../../src/native/management/setPauseWhenEmptySeconds.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,2BAA2B;IACjC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,6EAA6E;IAC1F,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,iDAAiD;YAC9D,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;QACxB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,wBAAwB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC/F,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setPlayerIdleTimeout.d.ts b/dist/native/management/setPlayerIdleTimeout.d.ts new file mode 100644 index 0000000..1c46e12 --- /dev/null +++ b/dist/native/management/setPlayerIdleTimeout.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=setPlayerIdleTimeout.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setPlayerIdleTimeout.d.ts.map b/dist/native/management/setPlayerIdleTimeout.d.ts.map new file mode 100644 index 0000000..c5a6348 --- /dev/null +++ b/dist/native/management/setPlayerIdleTimeout.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setPlayerIdleTimeout.d.ts","sourceRoot":"","sources":["../../../src/native/management/setPlayerIdleTimeout.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setPlayerIdleTimeout.js b/dist/native/management/setPlayerIdleTimeout.js new file mode 100644 index 0000000..3ac3b8b --- /dev/null +++ b/dist/native/management/setPlayerIdleTimeout.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setPlayerIdleTimeout", + version: "1.0.0", + description: "Sets the number of minutes a player can be idle before being kicked", + unwrap: true, + brackets: true, + args: [ + { + name: "minutes", + description: "The number of minutes before kicking idle players", + rest: false, + required: true, + type: forgescript_1.ArgType.Number, + } + ], + async execute(ctx, [minutes]) { + await ctx.client.minecraft.server?.settings().setPlayerIdleTimeout(minutes).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setPlayerIdleTimeout.js.map \ No newline at end of file diff --git a/dist/native/management/setPlayerIdleTimeout.js.map b/dist/native/management/setPlayerIdleTimeout.js.map new file mode 100644 index 0000000..57eb078 --- /dev/null +++ b/dist/native/management/setPlayerIdleTimeout.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setPlayerIdleTimeout.js","sourceRoot":"","sources":["../../../src/native/management/setPlayerIdleTimeout.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,uBAAuB;IAC7B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,qEAAqE;IAClF,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,mDAAmD;YAChE,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;QACxB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,oBAAoB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC3F,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setSimulationDistance.d.ts b/dist/native/management/setSimulationDistance.d.ts new file mode 100644 index 0000000..eb8a7bc --- /dev/null +++ b/dist/native/management/setSimulationDistance.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=setSimulationDistance.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setSimulationDistance.d.ts.map b/dist/native/management/setSimulationDistance.d.ts.map new file mode 100644 index 0000000..c747aab --- /dev/null +++ b/dist/native/management/setSimulationDistance.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setSimulationDistance.d.ts","sourceRoot":"","sources":["../../../src/native/management/setSimulationDistance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setSimulationDistance.js b/dist/native/management/setSimulationDistance.js new file mode 100644 index 0000000..977c542 --- /dev/null +++ b/dist/native/management/setSimulationDistance.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setSimulationDistance", + version: "1.0.0", + description: "Sets the simulation distance of the server in chunks", + unwrap: true, + brackets: true, + args: [ + { + name: "chunks", + description: "The simulation distance in chunks", + rest: false, + required: true, + type: forgescript_1.ArgType.Number, + } + ], + async execute(ctx, [chunks]) { + await ctx.client.minecraft.server?.settings().setSimulationDistance(chunks).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setSimulationDistance.js.map \ No newline at end of file diff --git a/dist/native/management/setSimulationDistance.js.map b/dist/native/management/setSimulationDistance.js.map new file mode 100644 index 0000000..608543b --- /dev/null +++ b/dist/native/management/setSimulationDistance.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setSimulationDistance.js","sourceRoot":"","sources":["../../../src/native/management/setSimulationDistance.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,wBAAwB;IAC9B,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,sDAAsD;IACnE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,mCAAmC;YAChD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;QACvB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC3F,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setSpawnProtectionRadius.d.ts b/dist/native/management/setSpawnProtectionRadius.d.ts new file mode 100644 index 0000000..ec6ccbf --- /dev/null +++ b/dist/native/management/setSpawnProtectionRadius.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=setSpawnProtectionRadius.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setSpawnProtectionRadius.d.ts.map b/dist/native/management/setSpawnProtectionRadius.d.ts.map new file mode 100644 index 0000000..241bef5 --- /dev/null +++ b/dist/native/management/setSpawnProtectionRadius.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setSpawnProtectionRadius.d.ts","sourceRoot":"","sources":["../../../src/native/management/setSpawnProtectionRadius.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setSpawnProtectionRadius.js b/dist/native/management/setSpawnProtectionRadius.js new file mode 100644 index 0000000..7758046 --- /dev/null +++ b/dist/native/management/setSpawnProtectionRadius.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setSpawnProtectionRadius", + version: "1.0.0", + description: "Sets the radius around the world spawn point that is protected from non-operator players", + unwrap: true, + brackets: true, + args: [ + { + name: "radius", + description: "The spawn protection radius to set", + rest: false, + required: true, + type: forgescript_1.ArgType.Number, + } + ], + async execute(ctx, [radius]) { + await ctx.client.minecraft.server?.settings().setSpawnProtectionRadius(radius).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setSpawnProtectionRadius.js.map \ No newline at end of file diff --git a/dist/native/management/setSpawnProtectionRadius.js.map b/dist/native/management/setSpawnProtectionRadius.js.map new file mode 100644 index 0000000..d827cdd --- /dev/null +++ b/dist/native/management/setSpawnProtectionRadius.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setSpawnProtectionRadius.js","sourceRoot":"","sources":["../../../src/native/management/setSpawnProtectionRadius.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,2BAA2B;IACjC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,0FAA0F;IACvG,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,oCAAoC;YACjD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;QACvB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QAC9F,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setStatusHeartbeatInterval.d.ts b/dist/native/management/setStatusHeartbeatInterval.d.ts new file mode 100644 index 0000000..90ab27e --- /dev/null +++ b/dist/native/management/setStatusHeartbeatInterval.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=setStatusHeartbeatInterval.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setStatusHeartbeatInterval.d.ts.map b/dist/native/management/setStatusHeartbeatInterval.d.ts.map new file mode 100644 index 0000000..63b8190 --- /dev/null +++ b/dist/native/management/setStatusHeartbeatInterval.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setStatusHeartbeatInterval.d.ts","sourceRoot":"","sources":["../../../src/native/management/setStatusHeartbeatInterval.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setStatusHeartbeatInterval.js b/dist/native/management/setStatusHeartbeatInterval.js new file mode 100644 index 0000000..c43a2ea --- /dev/null +++ b/dist/native/management/setStatusHeartbeatInterval.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setStatusHeartbeatInterval", + version: "1.0.0", + description: "Sets the interval in seconds between status heartbeats sent to server management clients", + unwrap: true, + brackets: true, + args: [ + { + name: "seconds", + description: "The status heartbeat interval in seconds", + rest: false, + required: true, + type: forgescript_1.ArgType.Number, + } + ], + async execute(ctx, [seconds]) { + await ctx.client.minecraft.server?.settings().setStatusHeartbeatInterval(seconds).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setStatusHeartbeatInterval.js.map \ No newline at end of file diff --git a/dist/native/management/setStatusHeartbeatInterval.js.map b/dist/native/management/setStatusHeartbeatInterval.js.map new file mode 100644 index 0000000..7e7e7b1 --- /dev/null +++ b/dist/native/management/setStatusHeartbeatInterval.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setStatusHeartbeatInterval.js","sourceRoot":"","sources":["../../../src/native/management/setStatusHeartbeatInterval.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,6BAA6B;IACnC,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,0FAA0F;IACvG,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,0CAA0C;YACvD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;QACxB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,0BAA0B,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACjG,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setStatusReplies.d.ts b/dist/native/management/setStatusReplies.d.ts new file mode 100644 index 0000000..de22c7d --- /dev/null +++ b/dist/native/management/setStatusReplies.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}], true>; +export default _default; +//# sourceMappingURL=setStatusReplies.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setStatusReplies.d.ts.map b/dist/native/management/setStatusReplies.d.ts.map new file mode 100644 index 0000000..5bed02f --- /dev/null +++ b/dist/native/management/setStatusReplies.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setStatusReplies.d.ts","sourceRoot":"","sources":["../../../src/native/management/setStatusReplies.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setStatusReplies.js b/dist/native/management/setStatusReplies.js new file mode 100644 index 0000000..688303b --- /dev/null +++ b/dist/native/management/setStatusReplies.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setStatusReplies", + version: "1.0.0", + description: "Sets whether the server responds to status requests in the multiplayer server list", + unwrap: true, + brackets: true, + args: [ + { + name: "respond", + description: "Whether to respond to status requests", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + } + ], + async execute(ctx, [respond]) { + await ctx.client.minecraft.server?.settings().setStatusReplies(respond).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setStatusReplies.js.map \ No newline at end of file diff --git a/dist/native/management/setStatusReplies.js.map b/dist/native/management/setStatusReplies.js.map new file mode 100644 index 0000000..a7fb23b --- /dev/null +++ b/dist/native/management/setStatusReplies.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setStatusReplies.js","sourceRoot":"","sources":["../../../src/native/management/setStatusReplies.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,mBAAmB;IACzB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,oFAAoF;IACjG,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,SAAS;YACf,WAAW,EAAE,uCAAuC;YACpD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC;QACxB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,gBAAgB,CAAC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACvF,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setUseAllowList.d.ts b/dist/native/management/setUseAllowList.d.ts new file mode 100644 index 0000000..c48bda7 --- /dev/null +++ b/dist/native/management/setUseAllowList.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Boolean; +}], true>; +export default _default; +//# sourceMappingURL=setUseAllowList.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setUseAllowList.d.ts.map b/dist/native/management/setUseAllowList.d.ts.map new file mode 100644 index 0000000..19dc98b --- /dev/null +++ b/dist/native/management/setUseAllowList.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setUseAllowList.d.ts","sourceRoot":"","sources":["../../../src/native/management/setUseAllowList.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setUseAllowList.js b/dist/native/management/setUseAllowList.js new file mode 100644 index 0000000..a0f87a9 --- /dev/null +++ b/dist/native/management/setUseAllowList.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setUseAllowList", + version: "1.0.0", + description: "Sets whether the server uses the allow list", + unwrap: true, + brackets: true, + args: [ + { + name: "enable", + description: "Whether to enable the allow list", + rest: false, + required: true, + type: forgescript_1.ArgType.Boolean, + } + ], + async execute(ctx, [enable]) { + await ctx.client.minecraft.server?.settings().setUseAllowList(enable).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setUseAllowList.js.map \ No newline at end of file diff --git a/dist/native/management/setUseAllowList.js.map b/dist/native/management/setUseAllowList.js.map new file mode 100644 index 0000000..aeea2fc --- /dev/null +++ b/dist/native/management/setUseAllowList.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setUseAllowList.js","sourceRoot":"","sources":["../../../src/native/management/setUseAllowList.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,6CAA6C;IAC1D,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,kCAAkC;YAC/C,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,OAAO;SACxB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;QACvB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACrF,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/setViewDistance.d.ts b/dist/native/management/setViewDistance.d.ts new file mode 100644 index 0000000..4bd3ffd --- /dev/null +++ b/dist/native/management/setViewDistance.d.ts @@ -0,0 +1,10 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.Number; +}], true>; +export default _default; +//# sourceMappingURL=setViewDistance.d.ts.map \ No newline at end of file diff --git a/dist/native/management/setViewDistance.d.ts.map b/dist/native/management/setViewDistance.d.ts.map new file mode 100644 index 0000000..82db48c --- /dev/null +++ b/dist/native/management/setViewDistance.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"setViewDistance.d.ts","sourceRoot":"","sources":["../../../src/native/management/setViewDistance.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;AAE/D,wBAmBE"} \ No newline at end of file diff --git a/dist/native/management/setViewDistance.js b/dist/native/management/setViewDistance.js new file mode 100644 index 0000000..453fa9e --- /dev/null +++ b/dist/native/management/setViewDistance.js @@ -0,0 +1,24 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$setViewDistance", + version: "1.0.0", + description: "Sets the view distance of the server in chunks", + unwrap: true, + brackets: true, + args: [ + { + name: "chunks", + description: "The view distance in chunks", + rest: false, + required: true, + type: forgescript_1.ArgType.Number, + } + ], + async execute(ctx, [chunks]) { + await ctx.client.minecraft.server?.settings().setViewDistance(chunks).catch(ctx.noop); + return this.success(); + } +}); +//# sourceMappingURL=setViewDistance.js.map \ No newline at end of file diff --git a/dist/native/management/setViewDistance.js.map b/dist/native/management/setViewDistance.js.map new file mode 100644 index 0000000..b93b307 --- /dev/null +++ b/dist/native/management/setViewDistance.js.map @@ -0,0 +1 @@ +{"version":3,"file":"setViewDistance.js","sourceRoot":"","sources":["../../../src/native/management/setViewDistance.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,kBAAkB;IACxB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,gDAAgD;IAC7D,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,6BAA6B;YAC1C,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,MAAM,CAAC;QACvB,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,QAAQ,EAAE,CAAC,eAAe,CAAC,MAAM,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;QACrF,OAAO,IAAI,CAAC,OAAO,EAAE,CAAA;IACzB,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/stopServer.d.ts b/dist/native/management/stopServer.d.ts new file mode 100644 index 0000000..1c2078e --- /dev/null +++ b/dist/native/management/stopServer.d.ts @@ -0,0 +1,4 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction>[], false>; +export default _default; +//# sourceMappingURL=stopServer.d.ts.map \ No newline at end of file diff --git a/dist/native/management/stopServer.d.ts.map b/dist/native/management/stopServer.d.ts.map new file mode 100644 index 0000000..ce0c06a --- /dev/null +++ b/dist/native/management/stopServer.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"stopServer.d.ts","sourceRoot":"","sources":["../../../src/native/management/stopServer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;AAE/D,wBASE"} \ No newline at end of file diff --git a/dist/native/management/stopServer.js b/dist/native/management/stopServer.js new file mode 100644 index 0000000..9c797da --- /dev/null +++ b/dist/native/management/stopServer.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$stopServer", + version: "1.0.0", + description: "Stops the minecraft server, returns bool", + unwrap: false, + output: forgescript_1.ArgType.Boolean, + async execute(ctx) { + return this.success(!!(await ctx.client.minecraft.server?.stop().catch(ctx.noop))); + } +}); +//# sourceMappingURL=stopServer.js.map \ No newline at end of file diff --git a/dist/native/management/stopServer.js.map b/dist/native/management/stopServer.js.map new file mode 100644 index 0000000..ce06a75 --- /dev/null +++ b/dist/native/management/stopServer.js.map @@ -0,0 +1 @@ +{"version":3,"file":"stopServer.js","sourceRoot":"","sources":["../../../src/native/management/stopServer.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,aAAa;IACnB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,0CAA0C;IACvD,MAAM,EAAE,KAAK;IACb,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG;QACb,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACtF,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/native/management/updateGameRule.d.ts b/dist/native/management/updateGameRule.d.ts new file mode 100644 index 0000000..2615144 --- /dev/null +++ b/dist/native/management/updateGameRule.d.ts @@ -0,0 +1,16 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript"; +declare const _default: NativeFunction<[{ + name: string; + description: string; + rest: false; + required: true; + type: ArgType.String; +}, { + name: string; + description: string; + rest: false; + required: true; + type: ArgType.String; +}], true>; +export default _default; +//# sourceMappingURL=updateGameRule.d.ts.map \ No newline at end of file diff --git a/dist/native/management/updateGameRule.d.ts.map b/dist/native/management/updateGameRule.d.ts.map new file mode 100644 index 0000000..07ac973 --- /dev/null +++ b/dist/native/management/updateGameRule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"updateGameRule.d.ts","sourceRoot":"","sources":["../../../src/native/management/updateGameRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;;;;;;;;;;;;;;AAE/D,wBA0BE"} \ No newline at end of file diff --git a/dist/native/management/updateGameRule.js b/dist/native/management/updateGameRule.js new file mode 100644 index 0000000..d648a57 --- /dev/null +++ b/dist/native/management/updateGameRule.js @@ -0,0 +1,31 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +const forgescript_1 = require("@tryforge/forgescript"); +exports.default = new forgescript_1.NativeFunction({ + name: "$updateGameRule", + version: "1.0.0", + description: "Updates a game rule of the minecraft server, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "key", + description: "The key of the game rule to update", + rest: false, + required: true, + type: forgescript_1.ArgType.String, + }, + { + name: "value", + description: "The new value for the game rule", + rest: false, + required: true, + type: forgescript_1.ArgType.String, + }, + ], + output: forgescript_1.ArgType.Boolean, + async execute(ctx, [key, value]) { + return this.success(!!(await ctx.client.minecraft.server?.updateGameRule(key, value).catch(ctx.noop))); + } +}); +//# sourceMappingURL=updateGameRule.js.map \ No newline at end of file diff --git a/dist/native/management/updateGameRule.js.map b/dist/native/management/updateGameRule.js.map new file mode 100644 index 0000000..c70e3e0 --- /dev/null +++ b/dist/native/management/updateGameRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"updateGameRule.js","sourceRoot":"","sources":["../../../src/native/management/updateGameRule.ts"],"names":[],"mappings":";;AAAA,uDAA+D;AAE/D,kBAAe,IAAI,4BAAc,CAAC;IAC9B,IAAI,EAAE,iBAAiB;IACvB,OAAO,EAAE,OAAO;IAChB,WAAW,EAAE,2DAA2D;IACxE,MAAM,EAAE,IAAI;IACZ,QAAQ,EAAE,IAAI;IACd,IAAI,EAAE;QACF;YACI,IAAI,EAAE,KAAK;YACX,WAAW,EAAE,oCAAoC;YACjD,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;QACD;YACI,IAAI,EAAE,OAAO;YACb,WAAW,EAAE,iCAAiC;YAC9C,IAAI,EAAE,KAAK;YACX,QAAQ,EAAE,IAAI;YACd,IAAI,EAAE,qBAAO,CAAC,MAAM;SACvB;KACJ;IACD,MAAM,EAAE,qBAAO,CAAC,OAAO;IACvB,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,MAAM,CAAC,SAAS,CAAC,MAAM,EAAE,cAAc,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IAC1G,CAAC;CACJ,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/properties/ban.d.ts b/dist/properties/ban.d.ts new file mode 100644 index 0000000..d2e7bf0 --- /dev/null +++ b/dist/properties/ban.d.ts @@ -0,0 +1,17 @@ +import { IPBan, UserBan } from "mc-server-management"; +export declare enum UserBanProperty { + reason = "reason", + source = "source", + playerID = "playerID", + playerName = "playerName", + expiresTimestamp = "expiresTimestamp" +} +export declare const UserBanProperties: import("../functions/defineProperties").Properties; +export declare enum IPBanProperty { + ip = "ip", + reason = "reason", + source = "source", + expiresTimestamp = "expiresTimestamp" +} +export declare const IPBanProperties: import("../functions/defineProperties").Properties; +//# sourceMappingURL=ban.d.ts.map \ No newline at end of file diff --git a/dist/properties/ban.d.ts.map b/dist/properties/ban.d.ts.map new file mode 100644 index 0000000..8bf8de1 --- /dev/null +++ b/dist/properties/ban.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"ban.d.ts","sourceRoot":"","sources":["../../src/properties/ban.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAGrD,oBAAY,eAAe;IACvB,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,QAAQ,aAAa;IACrB,UAAU,eAAe;IACzB,gBAAgB,qBAAqB;CACxC;AAED,eAAO,MAAM,iBAAiB,qFAM5B,CAAA;AAEF,oBAAY,aAAa;IACrB,EAAE,OAAO;IACT,MAAM,WAAW;IACjB,MAAM,WAAW;IACjB,gBAAgB,qBAAqB;CACxC;AAED,eAAO,MAAM,eAAe,iFAK1B,CAAA"} \ No newline at end of file diff --git a/dist/properties/ban.js b/dist/properties/ban.js new file mode 100644 index 0000000..15da6cd --- /dev/null +++ b/dist/properties/ban.js @@ -0,0 +1,36 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.IPBanProperties = exports.IPBanProperty = exports.UserBanProperties = exports.UserBanProperty = void 0; +const defineProperties_1 = __importDefault(require("../functions/defineProperties")); +var UserBanProperty; +(function (UserBanProperty) { + UserBanProperty["reason"] = "reason"; + UserBanProperty["source"] = "source"; + UserBanProperty["playerID"] = "playerID"; + UserBanProperty["playerName"] = "playerName"; + UserBanProperty["expiresTimestamp"] = "expiresTimestamp"; +})(UserBanProperty || (exports.UserBanProperty = UserBanProperty = {})); +exports.UserBanProperties = (0, defineProperties_1.default)({ + reason: (i) => i?.reason, + source: (i) => i?.source, + playerID: (i) => i?.player.id, + playerName: (i) => i?.player.name, + expiresTimestamp: (i) => i?.expires, +}); +var IPBanProperty; +(function (IPBanProperty) { + IPBanProperty["ip"] = "ip"; + IPBanProperty["reason"] = "reason"; + IPBanProperty["source"] = "source"; + IPBanProperty["expiresTimestamp"] = "expiresTimestamp"; +})(IPBanProperty || (exports.IPBanProperty = IPBanProperty = {})); +exports.IPBanProperties = (0, defineProperties_1.default)({ + ip: (i) => i?.ip, + reason: (i) => i?.reason, + source: (i) => i?.source, + expiresTimestamp: (i) => i?.expires, +}); +//# sourceMappingURL=ban.js.map \ No newline at end of file diff --git a/dist/properties/ban.js.map b/dist/properties/ban.js.map new file mode 100644 index 0000000..b5d1c6e --- /dev/null +++ b/dist/properties/ban.js.map @@ -0,0 +1 @@ +{"version":3,"file":"ban.js","sourceRoot":"","sources":["../../src/properties/ban.ts"],"names":[],"mappings":";;;;;;AACA,qFAA4D;AAE5D,IAAY,eAMX;AAND,WAAY,eAAe;IACvB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;IACrB,4CAAyB,CAAA;IACzB,wDAAqC,CAAA;AACzC,CAAC,EANW,eAAe,+BAAf,eAAe,QAM1B;AAEY,QAAA,iBAAiB,GAAG,IAAA,0BAAgB,EAAkC;IAC/E,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM;IACxB,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM;IACxB,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE;IAC7B,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI;IACjC,gBAAgB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO;CACtC,CAAC,CAAA;AAEF,IAAY,aAKX;AALD,WAAY,aAAa;IACrB,0BAAS,CAAA;IACT,kCAAiB,CAAA;IACjB,kCAAiB,CAAA;IACjB,sDAAqC,CAAA;AACzC,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB;AAEY,QAAA,eAAe,GAAG,IAAA,0BAAgB,EAA8B;IACzE,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM;IACxB,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM;IACxB,gBAAgB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO;CACtC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/properties/gameRule.d.ts b/dist/properties/gameRule.d.ts new file mode 100644 index 0000000..e0598e1 --- /dev/null +++ b/dist/properties/gameRule.d.ts @@ -0,0 +1,8 @@ +import { GameRuleType as BaseGameRuleType, TypedGameRule } from "mc-server-management"; +export declare enum GameRuleProperty { + key = "key", + value = "value", + type = "type" +} +export declare const GameRuleProperties: import("../functions/defineProperties").Properties>; +//# sourceMappingURL=gameRule.d.ts.map \ No newline at end of file diff --git a/dist/properties/gameRule.d.ts.map b/dist/properties/gameRule.d.ts.map new file mode 100644 index 0000000..cf666fc --- /dev/null +++ b/dist/properties/gameRule.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"gameRule.d.ts","sourceRoot":"","sources":["../../src/properties/gameRule.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,IAAI,gBAAgB,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AAKtF,oBAAY,gBAAgB;IACxB,GAAG,QAAQ;IACX,KAAK,UAAU;IACf,IAAI,SAAS;CAChB;AAED,eAAO,MAAM,kBAAkB,8GAI7B,CAAA"} \ No newline at end of file diff --git a/dist/properties/gameRule.js b/dist/properties/gameRule.js new file mode 100644 index 0000000..7b2c7a0 --- /dev/null +++ b/dist/properties/gameRule.js @@ -0,0 +1,21 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.GameRuleProperties = exports.GameRuleProperty = void 0; +const defineProperties_1 = __importDefault(require("../functions/defineProperties")); +const convertEnum_1 = __importDefault(require("../functions/convertEnum")); +const types_1 = require("../types"); +var GameRuleProperty; +(function (GameRuleProperty) { + GameRuleProperty["key"] = "key"; + GameRuleProperty["value"] = "value"; + GameRuleProperty["type"] = "type"; +})(GameRuleProperty || (exports.GameRuleProperty = GameRuleProperty = {})); +exports.GameRuleProperties = (0, defineProperties_1.default)({ + key: (i) => i?.key, + value: (i) => i?.value, + type: (i) => i?.type ? (0, convertEnum_1.default)(types_1.GameRuleType, i.type) : null, +}); +//# sourceMappingURL=gameRule.js.map \ No newline at end of file diff --git a/dist/properties/gameRule.js.map b/dist/properties/gameRule.js.map new file mode 100644 index 0000000..c3a108b --- /dev/null +++ b/dist/properties/gameRule.js.map @@ -0,0 +1 @@ +{"version":3,"file":"gameRule.js","sourceRoot":"","sources":["../../src/properties/gameRule.ts"],"names":[],"mappings":";;;;;;AACA,qFAA4D;AAC5D,2EAAkD;AAClD,oCAAuC;AAEvC,IAAY,gBAIX;AAJD,WAAY,gBAAgB;IACxB,+BAAW,CAAA;IACX,mCAAe,CAAA;IACf,iCAAa,CAAA;AACjB,CAAC,EAJW,gBAAgB,gCAAhB,gBAAgB,QAI3B;AAEY,QAAA,kBAAkB,GAAG,IAAA,0BAAgB,EAA2D;IACzG,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG;IAClB,KAAK,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,KAAK;IACtB,IAAI,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC,CAAC,IAAA,qBAAW,EAAC,oBAAY,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI;CAClE,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/properties/operator.d.ts b/dist/properties/operator.d.ts new file mode 100644 index 0000000..aaa1ff2 --- /dev/null +++ b/dist/properties/operator.d.ts @@ -0,0 +1,9 @@ +import { Operator } from "mc-server-management"; +export declare enum OperatorProperty { + permissionLevel = "permissionLevel", + bypassesPlayerLimit = "bypassesPlayerLimit", + playerName = "playerName", + playerID = "playerID" +} +export declare const OperatorProperties: import("../functions/defineProperties").Properties; +//# sourceMappingURL=operator.d.ts.map \ No newline at end of file diff --git a/dist/properties/operator.d.ts.map b/dist/properties/operator.d.ts.map new file mode 100644 index 0000000..884c210 --- /dev/null +++ b/dist/properties/operator.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"operator.d.ts","sourceRoot":"","sources":["../../src/properties/operator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAG/C,oBAAY,gBAAgB;IACxB,eAAe,oBAAoB;IACnC,mBAAmB,wBAAwB;IAC3C,UAAU,eAAe;IACzB,QAAQ,aAAa;CACxB;AAED,eAAO,MAAM,kBAAkB,uFAK7B,CAAA"} \ No newline at end of file diff --git a/dist/properties/operator.js b/dist/properties/operator.js new file mode 100644 index 0000000..673a64f --- /dev/null +++ b/dist/properties/operator.js @@ -0,0 +1,21 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.OperatorProperties = exports.OperatorProperty = void 0; +const defineProperties_1 = __importDefault(require("../functions/defineProperties")); +var OperatorProperty; +(function (OperatorProperty) { + OperatorProperty["permissionLevel"] = "permissionLevel"; + OperatorProperty["bypassesPlayerLimit"] = "bypassesPlayerLimit"; + OperatorProperty["playerName"] = "playerName"; + OperatorProperty["playerID"] = "playerID"; +})(OperatorProperty || (exports.OperatorProperty = OperatorProperty = {})); +exports.OperatorProperties = (0, defineProperties_1.default)({ + permissionLevel: (i) => i?.permissionLevel, + bypassesPlayerLimit: (i) => !!i?.bypassesPlayerLimit, + playerName: (i) => i?.player.name, + playerID: (i) => i?.player.id +}); +//# sourceMappingURL=operator.js.map \ No newline at end of file diff --git a/dist/properties/operator.js.map b/dist/properties/operator.js.map new file mode 100644 index 0000000..abef474 --- /dev/null +++ b/dist/properties/operator.js.map @@ -0,0 +1 @@ +{"version":3,"file":"operator.js","sourceRoot":"","sources":["../../src/properties/operator.ts"],"names":[],"mappings":";;;;;;AACA,qFAA4D;AAE5D,IAAY,gBAKX;AALD,WAAY,gBAAgB;IACxB,uDAAmC,CAAA;IACnC,+DAA2C,CAAA;IAC3C,6CAAyB,CAAA;IACzB,yCAAqB,CAAA;AACzB,CAAC,EALW,gBAAgB,gCAAhB,gBAAgB,QAK3B;AAEY,QAAA,kBAAkB,GAAG,IAAA,0BAAgB,EAAoC;IAClF,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,eAAe;IAC1C,mBAAmB,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,mBAAmB;IACpD,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,IAAI;IACjC,QAAQ,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,MAAM,CAAC,EAAE;CAChC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/properties/serverState.d.ts b/dist/properties/serverState.d.ts new file mode 100644 index 0000000..c3351c5 --- /dev/null +++ b/dist/properties/serverState.d.ts @@ -0,0 +1,10 @@ +import { ServerState } from "mc-server-management"; +export declare enum ServerStateProperty { + hasStarted = "hasStarted", + playerIDs = "playerIDs", + playerNames = "playerNames", + versionName = "versionName", + versionProtocol = "versionProtocol" +} +export declare const ServerStateProperties: import("../functions/defineProperties").Properties; +//# sourceMappingURL=serverState.d.ts.map \ No newline at end of file diff --git a/dist/properties/serverState.d.ts.map b/dist/properties/serverState.d.ts.map new file mode 100644 index 0000000..b1fa96a --- /dev/null +++ b/dist/properties/serverState.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"serverState.d.ts","sourceRoot":"","sources":["../../src/properties/serverState.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAA;AAGlD,oBAAY,mBAAmB;IAC3B,UAAU,eAAe;IACzB,SAAS,cAAc;IACvB,WAAW,gBAAgB;IAC3B,WAAW,gBAAgB;IAC3B,eAAe,oBAAoB;CACtC;AAED,eAAO,MAAM,qBAAqB,6FAMhC,CAAA"} \ No newline at end of file diff --git a/dist/properties/serverState.js b/dist/properties/serverState.js new file mode 100644 index 0000000..f21d7ee --- /dev/null +++ b/dist/properties/serverState.js @@ -0,0 +1,23 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.ServerStateProperties = exports.ServerStateProperty = void 0; +const defineProperties_1 = __importDefault(require("../functions/defineProperties")); +var ServerStateProperty; +(function (ServerStateProperty) { + ServerStateProperty["hasStarted"] = "hasStarted"; + ServerStateProperty["playerIDs"] = "playerIDs"; + ServerStateProperty["playerNames"] = "playerNames"; + ServerStateProperty["versionName"] = "versionName"; + ServerStateProperty["versionProtocol"] = "versionProtocol"; +})(ServerStateProperty || (exports.ServerStateProperty = ServerStateProperty = {})); +exports.ServerStateProperties = (0, defineProperties_1.default)({ + hasStarted: (i) => i?.started, + playerIDs: (i, sep) => i?.players.map((x) => x.id).join(sep ?? ", "), + playerNames: (i, sep) => i?.players.map((x) => x.name).join(sep ?? ", "), + versionName: (i) => i?.version.name, + versionProtocol: (i) => i?.version.protocol, +}); +//# sourceMappingURL=serverState.js.map \ No newline at end of file diff --git a/dist/properties/serverState.js.map b/dist/properties/serverState.js.map new file mode 100644 index 0000000..7095562 --- /dev/null +++ b/dist/properties/serverState.js.map @@ -0,0 +1 @@ +{"version":3,"file":"serverState.js","sourceRoot":"","sources":["../../src/properties/serverState.ts"],"names":[],"mappings":";;;;;;AACA,qFAA4D;AAE5D,IAAY,mBAMX;AAND,WAAY,mBAAmB;IAC3B,gDAAyB,CAAA;IACzB,8CAAuB,CAAA;IACvB,kDAA2B,CAAA;IAC3B,kDAA2B,CAAA;IAC3B,0DAAmC,CAAA;AACvC,CAAC,EANW,mBAAmB,mCAAnB,mBAAmB,QAM9B;AAEY,QAAA,qBAAqB,GAAG,IAAA,0BAAgB,EAA0C;IAC3F,UAAU,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO;IAC7B,SAAS,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC;IACpE,WAAW,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,CAAC;IACxE,WAAW,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,IAAI;IACnC,eAAe,EAAE,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,OAAO,CAAC,QAAQ;CAC9C,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/structures/Context.d.ts b/dist/structures/Context.d.ts new file mode 100644 index 0000000..65032fd --- /dev/null +++ b/dist/structures/Context.d.ts @@ -0,0 +1,43 @@ +import { Context as BaseContext, IContextCache, IRunnable, Sendable } from "@tryforge/forgescript"; +import { GameRuleType, IPBan, Operator, Player, ServerState, TypedGameRule, UserBan } from "mc-server-management"; +import { ForgeMinecraft } from ".."; +export type ExtendedSendable = Sendable | Player | Operator | ServerState | TypedGameRule | UserBan | IPBan; +export interface IExtendedRunnable extends IRunnable { + obj: ExtendedSendable; +} +export interface IExtendedContextCache extends IContextCache { + player: Player | null; + operator: Operator | null; + serverState: ServerState | null; + gameRule: TypedGameRule | null; + userBan: UserBan | null; + ipBan: IPBan | null; +} +export declare class Context extends BaseContext { + #private; + readonly runtime: IExtendedRunnable; + constructor(runtime: IExtendedRunnable); + get obj(): ExtendedSendable; + get player(): Player | null; + get operator(): Operator | null; + get serverState(): ServerState | null; + get gameRule(): TypedGameRule | null; + get userBan(): UserBan | null; + get ipBan(): IPBan | null; + get noop(): (...args: any[]) => void; +} +declare module "@tryforge/forgescript" { + interface Context { + noop: (...args: any[]) => void; + player: Player | null; + operator: Operator | null; + serverState: ServerState | null; + gameRule: TypedGameRule | null; + userBan: UserBan | null; + ipBan: IPBan | null; + } + interface ForgeClient { + minecraft: ForgeMinecraft; + } +} +//# sourceMappingURL=Context.d.ts.map \ No newline at end of file diff --git a/dist/structures/Context.d.ts.map b/dist/structures/Context.d.ts.map new file mode 100644 index 0000000..2dab769 --- /dev/null +++ b/dist/structures/Context.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Context.d.ts","sourceRoot":"","sources":["../../src/structures/Context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,aAAa,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAClG,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,WAAW,EAAE,aAAa,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACjH,OAAO,EAAE,cAAc,EAAE,MAAM,IAAI,CAAA;AAGnC,MAAM,MAAM,gBAAgB,GACtB,QAAQ,GACR,MAAM,GACN,QAAQ,GACR,WAAW,GACX,aAAa,CAAC,YAAY,CAAC,GAC3B,OAAO,GACP,KAAK,CAAA;AAEX,MAAM,WAAW,iBAAkB,SAAQ,SAAS;IAChD,GAAG,EAAE,gBAAgB,CAAA;CACxB;AAED,MAAM,WAAW,qBAAsB,SAAQ,aAAa;IACxD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;IACzB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAA;IAC/B,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,IAAI,CAAA;IAC5C,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;IACvB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;CACtB;AAED,qBAAa,OAAQ,SAAQ,WAAW;;aAGD,OAAO,EAAE,iBAAiB;gBAA1B,OAAO,EAAE,iBAAiB;IAI7D,IAAW,GAAG,qBAEb;IAED,IAAW,MAAM,kBAEhB;IAED,IAAW,QAAQ,oBAElB;IAED,IAAW,WAAW,uBAErB;IAED,IAAW,QAAQ,uCAElB;IAED,IAAW,OAAO,mBAEjB;IAED,IAAW,KAAK,iBAEf;IAED,IAAW,IAAI,IAAI,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAE1C;CACJ;AAED,OAAO,QAAQ,uBAAuB,CAAC;IACnC,UAAU,OAAO;QACb,IAAI,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,IAAI,CAAA;QAC9B,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;QACrB,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAA;QACzB,WAAW,EAAE,WAAW,GAAG,IAAI,CAAA;QAC/B,QAAQ,EAAE,aAAa,CAAC,YAAY,CAAC,GAAG,IAAI,CAAA;QAC5C,OAAO,EAAE,OAAO,GAAG,IAAI,CAAA;QACvB,KAAK,EAAE,KAAK,GAAG,IAAI,CAAA;KACtB;IACD,UAAU,WAAW;QACjB,SAAS,EAAE,cAAc,CAAA;KAC5B;CACJ"} \ No newline at end of file diff --git a/dist/structures/Context.js b/dist/structures/Context.js new file mode 100644 index 0000000..976aaa8 --- /dev/null +++ b/dist/structures/Context.js @@ -0,0 +1,43 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Context = void 0; +const forgescript_1 = require("@tryforge/forgescript"); +const mc_server_management_1 = require("mc-server-management"); +const contextNoop_1 = __importDefault(require("../functions/contextNoop")); +class Context extends forgescript_1.Context { + runtime; + #cache = {}; + constructor(runtime) { + super(runtime); + this.runtime = runtime; + } + get obj() { + return this.runtime.obj; + } + get player() { + return this.#cache.player ??= this.obj instanceof mc_server_management_1.Player ? this.obj : null; + } + get operator() { + return this.#cache.operator ??= this.obj instanceof mc_server_management_1.Operator ? this.obj : null; + } + get serverState() { + return this.#cache.serverState ??= this.obj instanceof mc_server_management_1.ServerState ? this.obj : null; + } + get gameRule() { + return this.#cache.gameRule ??= this.obj instanceof mc_server_management_1.TypedGameRule ? this.obj : null; + } + get userBan() { + return this.#cache.userBan ??= this.obj instanceof mc_server_management_1.UserBan ? this.obj : null; + } + get ipBan() { + return this.#cache.ipBan ??= this.obj instanceof mc_server_management_1.IPBan ? this.obj : null; + } + get noop() { + return contextNoop_1.default.bind(this); + } +} +exports.Context = Context; +//# sourceMappingURL=Context.js.map \ No newline at end of file diff --git a/dist/structures/Context.js.map b/dist/structures/Context.js.map new file mode 100644 index 0000000..a368e29 --- /dev/null +++ b/dist/structures/Context.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Context.js","sourceRoot":"","sources":["../../src/structures/Context.ts"],"names":[],"mappings":";;;;;;AAAA,uDAAkG;AAClG,+DAAiH;AAEjH,2EAAkD;AAwBlD,MAAa,OAAQ,SAAQ,qBAAW;IAGD;IAFnC,MAAM,GAAmC,EAAE,CAAA;IAE3C,YAAmC,OAA0B;QACzD,KAAK,CAAC,OAAO,CAAC,CAAA;QADiB,YAAO,GAAP,OAAO,CAAmB;IAE7D,CAAC;IAED,IAAW,GAAG;QACV,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAA;IAC3B,CAAC;IAED,IAAW,MAAM;QACb,OAAO,IAAI,CAAC,MAAM,CAAC,MAAM,KAAK,IAAI,CAAC,GAAG,YAAY,6BAAM,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;IAC9E,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC,GAAG,YAAY,+BAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;IAClF,CAAC;IAED,IAAW,WAAW;QAClB,OAAO,IAAI,CAAC,MAAM,CAAC,WAAW,KAAK,IAAI,CAAC,GAAG,YAAY,kCAAW,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;IACxF,CAAC;IAED,IAAW,QAAQ;QACf,OAAO,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,IAAI,CAAC,GAAG,YAAY,oCAAa,CAAC,CAAC,CAAC,IAAI,CAAC,GAAkC,CAAC,CAAC,CAAC,IAAI,CAAA;IACtH,CAAC;IAED,IAAW,OAAO;QACd,OAAO,IAAI,CAAC,MAAM,CAAC,OAAO,KAAK,IAAI,CAAC,GAAG,YAAY,8BAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;IAChF,CAAC;IAED,IAAW,KAAK;QACZ,OAAO,IAAI,CAAC,MAAM,CAAC,KAAK,KAAK,IAAI,CAAC,GAAG,YAAY,4BAAK,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,CAAA;IAC5E,CAAC;IAED,IAAW,IAAI;QACX,OAAO,qBAAW,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjC,CAAC;CACJ;AAtCD,0BAsCC"} \ No newline at end of file diff --git a/dist/structures/index.d.ts b/dist/structures/index.d.ts new file mode 100644 index 0000000..c74e03a --- /dev/null +++ b/dist/structures/index.d.ts @@ -0,0 +1,2 @@ +export * from "./Context"; +//# sourceMappingURL=index.d.ts.map \ No newline at end of file diff --git a/dist/structures/index.d.ts.map b/dist/structures/index.d.ts.map new file mode 100644 index 0000000..4279753 --- /dev/null +++ b/dist/structures/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/structures/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAA"} \ No newline at end of file diff --git a/dist/structures/index.js b/dist/structures/index.js new file mode 100644 index 0000000..f0388f9 --- /dev/null +++ b/dist/structures/index.js @@ -0,0 +1,18 @@ +"use strict"; +var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + var desc = Object.getOwnPropertyDescriptor(m, k); + if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { + desc = { enumerable: true, get: function() { return m[k]; } }; + } + Object.defineProperty(o, k2, desc); +}) : (function(o, m, k, k2) { + if (k2 === undefined) k2 = k; + o[k2] = m[k]; +})); +var __exportStar = (this && this.__exportStar) || function(m, exports) { + for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p); +}; +Object.defineProperty(exports, "__esModule", { value: true }); +__exportStar(require("./Context"), exports); +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/structures/index.js.map b/dist/structures/index.js.map new file mode 100644 index 0000000..a67a6a3 --- /dev/null +++ b/dist/structures/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/structures/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAAyB"} \ No newline at end of file diff --git a/dist/types.d.ts b/dist/types.d.ts new file mode 100644 index 0000000..88faf18 --- /dev/null +++ b/dist/types.d.ts @@ -0,0 +1,17 @@ +export declare enum GameRuleType { + Boolean = "boolean", + Integer = "integer" +} +export declare enum GameMode { + Survival = "survival", + Creative = "creative", + Spectator = "spectator", + Adventure = "adventure" +} +export declare enum Difficulty { + Peaceful = "peaceful", + Easy = "easy", + Normal = "normal", + Hard = "hard" +} +//# sourceMappingURL=types.d.ts.map \ No newline at end of file diff --git a/dist/types.d.ts.map b/dist/types.d.ts.map new file mode 100644 index 0000000..b16b0cb --- /dev/null +++ b/dist/types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,oBAAY,YAAY;IACpB,OAAO,YAAY;IACnB,OAAO,YAAY;CACtB;AAED,oBAAY,QAAQ;IAChB,QAAQ,aAAa;IACrB,QAAQ,aAAa;IACrB,SAAS,cAAc;IACvB,SAAS,cAAc;CAC1B;AAED,oBAAY,UAAU;IAClB,QAAQ,aAAa;IACrB,IAAI,SAAS;IACb,MAAM,WAAW;IACjB,IAAI,SAAS;CAChB"} \ No newline at end of file diff --git a/dist/types.js b/dist/types.js new file mode 100644 index 0000000..3186d9c --- /dev/null +++ b/dist/types.js @@ -0,0 +1,23 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.Difficulty = exports.GameMode = exports.GameRuleType = void 0; +var GameRuleType; +(function (GameRuleType) { + GameRuleType["Boolean"] = "boolean"; + GameRuleType["Integer"] = "integer"; +})(GameRuleType || (exports.GameRuleType = GameRuleType = {})); +var GameMode; +(function (GameMode) { + GameMode["Survival"] = "survival"; + GameMode["Creative"] = "creative"; + GameMode["Spectator"] = "spectator"; + GameMode["Adventure"] = "adventure"; +})(GameMode || (exports.GameMode = GameMode = {})); +var Difficulty; +(function (Difficulty) { + Difficulty["Peaceful"] = "peaceful"; + Difficulty["Easy"] = "easy"; + Difficulty["Normal"] = "normal"; + Difficulty["Hard"] = "hard"; +})(Difficulty || (exports.Difficulty = Difficulty = {})); +//# sourceMappingURL=types.js.map \ No newline at end of file diff --git a/dist/types.js.map b/dist/types.js.map new file mode 100644 index 0000000..c465c06 --- /dev/null +++ b/dist/types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";;;AAAA,IAAY,YAGX;AAHD,WAAY,YAAY;IACpB,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;AACvB,CAAC,EAHW,YAAY,4BAAZ,YAAY,QAGvB;AAED,IAAY,QAKX;AALD,WAAY,QAAQ;IAChB,iCAAqB,CAAA;IACrB,iCAAqB,CAAA;IACrB,mCAAuB,CAAA;IACvB,mCAAuB,CAAA;AAC3B,CAAC,EALW,QAAQ,wBAAR,QAAQ,QAKnB;AAED,IAAY,UAKX;AALD,WAAY,UAAU;IAClB,mCAAqB,CAAA;IACrB,2BAAa,CAAA;IACb,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACjB,CAAC,EALW,UAAU,0BAAV,UAAU,QAKrB"} \ No newline at end of file diff --git a/docs/.nojekyll b/docs/.nojekyll new file mode 100644 index 0000000..e2ac661 --- /dev/null +++ b/docs/.nojekyll @@ -0,0 +1 @@ +TypeDoc added this file to prevent GitHub Pages from using Jekyll. You can turn off this behavior by setting the `githubPages` option to false. \ No newline at end of file diff --git a/docs/assets/hierarchy.js b/docs/assets/hierarchy.js new file mode 100644 index 0000000..fb85f0a --- /dev/null +++ b/docs/assets/hierarchy.js @@ -0,0 +1 @@ +window.hierarchyData = "eJyrVirKzy8pVrKKjtVRKkpNy0lNLsnMzytWsqqurQUAmx4Kpg==" \ No newline at end of file diff --git a/docs/assets/highlight.css b/docs/assets/highlight.css new file mode 100644 index 0000000..a30230b --- /dev/null +++ b/docs/assets/highlight.css @@ -0,0 +1,78 @@ +:root { + --light-hl-0: #795E26; + --dark-hl-0: #DCDCAA; + --light-hl-1: #000000; + --dark-hl-1: #D4D4D4; + --light-hl-2: #A31515; + --dark-hl-2: #CE9178; + --light-hl-3: #0000FF; + --dark-hl-3: #569CD6; + --light-hl-4: #0070C1; + --dark-hl-4: #4FC1FF; + --light-hl-5: #001080; + --dark-hl-5: #9CDCFE; + --light-hl-6: #008000; + --dark-hl-6: #6A9955; + --light-hl-7: #098658; + --dark-hl-7: #B5CEA8; + --light-code-background: #FFFFFF; + --dark-code-background: #1E1E1E; +} + +@media (prefers-color-scheme: light) { :root { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --code-background: var(--light-code-background); +} } + +@media (prefers-color-scheme: dark) { :root { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --code-background: var(--dark-code-background); +} } + +:root[data-theme='light'] { + --hl-0: var(--light-hl-0); + --hl-1: var(--light-hl-1); + --hl-2: var(--light-hl-2); + --hl-3: var(--light-hl-3); + --hl-4: var(--light-hl-4); + --hl-5: var(--light-hl-5); + --hl-6: var(--light-hl-6); + --hl-7: var(--light-hl-7); + --code-background: var(--light-code-background); +} + +:root[data-theme='dark'] { + --hl-0: var(--dark-hl-0); + --hl-1: var(--dark-hl-1); + --hl-2: var(--dark-hl-2); + --hl-3: var(--dark-hl-3); + --hl-4: var(--dark-hl-4); + --hl-5: var(--dark-hl-5); + --hl-6: var(--dark-hl-6); + --hl-7: var(--dark-hl-7); + --code-background: var(--dark-code-background); +} + +.hl-0 { color: var(--hl-0); } +.hl-1 { color: var(--hl-1); } +.hl-2 { color: var(--hl-2); } +.hl-3 { color: var(--hl-3); } +.hl-4 { color: var(--hl-4); } +.hl-5 { color: var(--hl-5); } +.hl-6 { color: var(--hl-6); } +.hl-7 { color: var(--hl-7); } +pre, code { background: var(--code-background); } diff --git a/docs/assets/icons.js b/docs/assets/icons.js new file mode 100644 index 0000000..58882d7 --- /dev/null +++ b/docs/assets/icons.js @@ -0,0 +1,18 @@ +(function() { + addIcons(); + function addIcons() { + if (document.readyState === "loading") return document.addEventListener("DOMContentLoaded", addIcons); + const svg = document.body.appendChild(document.createElementNS("http://www.w3.org/2000/svg", "svg")); + svg.innerHTML = `MMNEPVFCICPMFPCPTTAAATR`; + svg.style.display = "none"; + if (location.protocol === "file:") updateUseElements(); + } + + function updateUseElements() { + document.querySelectorAll("use").forEach(el => { + if (el.getAttribute("href").includes("#icon-")) { + el.setAttribute("href", el.getAttribute("href").replace(/.*#/, "#")); + } + }); + } +})() \ No newline at end of file diff --git a/docs/assets/icons.svg b/docs/assets/icons.svg new file mode 100644 index 0000000..50ad579 --- /dev/null +++ b/docs/assets/icons.svg @@ -0,0 +1 @@ +MMNEPVFCICPMFPCPTTAAATR \ No newline at end of file diff --git a/docs/assets/main.js b/docs/assets/main.js new file mode 100644 index 0000000..64b80ab --- /dev/null +++ b/docs/assets/main.js @@ -0,0 +1,60 @@ +"use strict"; +window.translations={"copy":"Copy","copied":"Copied!","normally_hidden":"This member is normally hidden due to your filter settings.","hierarchy_expand":"Expand","hierarchy_collapse":"Collapse","folder":"Folder","search_index_not_available":"The search index is not available","search_no_results_found_for_0":"No results found for {0}","kind_1":"Project","kind_2":"Module","kind_4":"Namespace","kind_8":"Enumeration","kind_16":"Enumeration Member","kind_32":"Variable","kind_64":"Function","kind_128":"Class","kind_256":"Interface","kind_512":"Constructor","kind_1024":"Property","kind_2048":"Method","kind_4096":"Call Signature","kind_8192":"Index Signature","kind_16384":"Constructor Signature","kind_32768":"Parameter","kind_65536":"Type Literal","kind_131072":"Type Parameter","kind_262144":"Accessor","kind_524288":"Get Signature","kind_1048576":"Set Signature","kind_2097152":"Type Alias","kind_4194304":"Reference","kind_8388608":"Document"}; +"use strict";(()=>{var Ke=Object.create;var he=Object.defineProperty;var Ge=Object.getOwnPropertyDescriptor;var Ze=Object.getOwnPropertyNames;var Xe=Object.getPrototypeOf,Ye=Object.prototype.hasOwnProperty;var et=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var tt=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of Ze(e))!Ye.call(t,i)&&i!==n&&he(t,i,{get:()=>e[i],enumerable:!(r=Ge(e,i))||r.enumerable});return t};var nt=(t,e,n)=>(n=t!=null?Ke(Xe(t)):{},tt(e||!t||!t.__esModule?he(n,"default",{value:t,enumerable:!0}):n,t));var ye=et((me,ge)=>{(function(){var t=function(e){var n=new t.Builder;return n.pipeline.add(t.trimmer,t.stopWordFilter,t.stemmer),n.searchPipeline.add(t.stemmer),e.call(n,n),n.build()};t.version="2.3.9";t.utils={},t.utils.warn=(function(e){return function(n){e.console&&console.warn&&console.warn(n)}})(this),t.utils.asString=function(e){return e==null?"":e.toString()},t.utils.clone=function(e){if(e==null)return e;for(var n=Object.create(null),r=Object.keys(e),i=0;i0){var d=t.utils.clone(n)||{};d.position=[a,l],d.index=s.length,s.push(new t.Token(r.slice(a,o),d))}a=o+1}}return s},t.tokenizer.separator=/[\s\-]+/;t.Pipeline=function(){this._stack=[]},t.Pipeline.registeredFunctions=Object.create(null),t.Pipeline.registerFunction=function(e,n){n in this.registeredFunctions&&t.utils.warn("Overwriting existing registered function: "+n),e.label=n,t.Pipeline.registeredFunctions[e.label]=e},t.Pipeline.warnIfFunctionNotRegistered=function(e){var n=e.label&&e.label in this.registeredFunctions;n||t.utils.warn(`Function is not registered with pipeline. This may cause problems when serialising the index. +`,e)},t.Pipeline.load=function(e){var n=new t.Pipeline;return e.forEach(function(r){var i=t.Pipeline.registeredFunctions[r];if(i)n.add(i);else throw new Error("Cannot load unregistered function: "+r)}),n},t.Pipeline.prototype.add=function(){var e=Array.prototype.slice.call(arguments);e.forEach(function(n){t.Pipeline.warnIfFunctionNotRegistered(n),this._stack.push(n)},this)},t.Pipeline.prototype.after=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");r=r+1,this._stack.splice(r,0,n)},t.Pipeline.prototype.before=function(e,n){t.Pipeline.warnIfFunctionNotRegistered(n);var r=this._stack.indexOf(e);if(r==-1)throw new Error("Cannot find existingFn");this._stack.splice(r,0,n)},t.Pipeline.prototype.remove=function(e){var n=this._stack.indexOf(e);n!=-1&&this._stack.splice(n,1)},t.Pipeline.prototype.run=function(e){for(var n=this._stack.length,r=0;r1&&(oe&&(r=s),o!=e);)i=r-n,s=n+Math.floor(i/2),o=this.elements[s*2];if(o==e||o>e)return s*2;if(oc?d+=2:a==c&&(n+=r[l+1]*i[d+1],l+=2,d+=2);return n},t.Vector.prototype.similarity=function(e){return this.dot(e)/this.magnitude()||0},t.Vector.prototype.toArray=function(){for(var e=new Array(this.elements.length/2),n=1,r=0;n0){var o=s.str.charAt(0),a;o in s.node.edges?a=s.node.edges[o]:(a=new t.TokenSet,s.node.edges[o]=a),s.str.length==1&&(a.final=!0),i.push({node:a,editsRemaining:s.editsRemaining,str:s.str.slice(1)})}if(s.editsRemaining!=0){if("*"in s.node.edges)var c=s.node.edges["*"];else{var c=new t.TokenSet;s.node.edges["*"]=c}if(s.str.length==0&&(c.final=!0),i.push({node:c,editsRemaining:s.editsRemaining-1,str:s.str}),s.str.length>1&&i.push({node:s.node,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)}),s.str.length==1&&(s.node.final=!0),s.str.length>=1){if("*"in s.node.edges)var l=s.node.edges["*"];else{var l=new t.TokenSet;s.node.edges["*"]=l}s.str.length==1&&(l.final=!0),i.push({node:l,editsRemaining:s.editsRemaining-1,str:s.str.slice(1)})}if(s.str.length>1){var d=s.str.charAt(0),f=s.str.charAt(1),p;f in s.node.edges?p=s.node.edges[f]:(p=new t.TokenSet,s.node.edges[f]=p),s.str.length==1&&(p.final=!0),i.push({node:p,editsRemaining:s.editsRemaining-1,str:d+s.str.slice(2)})}}}return r},t.TokenSet.fromString=function(e){for(var n=new t.TokenSet,r=n,i=0,s=e.length;i=e;n--){var r=this.uncheckedNodes[n],i=r.child.toString();i in this.minimizedNodes?r.parent.edges[r.char]=this.minimizedNodes[i]:(r.child._str=i,this.minimizedNodes[i]=r.child),this.uncheckedNodes.pop()}};t.Index=function(e){this.invertedIndex=e.invertedIndex,this.fieldVectors=e.fieldVectors,this.tokenSet=e.tokenSet,this.fields=e.fields,this.pipeline=e.pipeline},t.Index.prototype.search=function(e){return this.query(function(n){var r=new t.QueryParser(e,n);r.parse()})},t.Index.prototype.query=function(e){for(var n=new t.Query(this.fields),r=Object.create(null),i=Object.create(null),s=Object.create(null),o=Object.create(null),a=Object.create(null),c=0;c1?this._b=1:this._b=e},t.Builder.prototype.k1=function(e){this._k1=e},t.Builder.prototype.add=function(e,n){var r=e[this._ref],i=Object.keys(this._fields);this._documents[r]=n||{},this.documentCount+=1;for(var s=0;s=this.length)return t.QueryLexer.EOS;var e=this.str.charAt(this.pos);return this.pos+=1,e},t.QueryLexer.prototype.width=function(){return this.pos-this.start},t.QueryLexer.prototype.ignore=function(){this.start==this.pos&&(this.pos+=1),this.start=this.pos},t.QueryLexer.prototype.backup=function(){this.pos-=1},t.QueryLexer.prototype.acceptDigitRun=function(){var e,n;do e=this.next(),n=e.charCodeAt(0);while(n>47&&n<58);e!=t.QueryLexer.EOS&&this.backup()},t.QueryLexer.prototype.more=function(){return this.pos1&&(e.backup(),e.emit(t.QueryLexer.TERM)),e.ignore(),e.more())return t.QueryLexer.lexText},t.QueryLexer.lexEditDistance=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.EDIT_DISTANCE),t.QueryLexer.lexText},t.QueryLexer.lexBoost=function(e){return e.ignore(),e.acceptDigitRun(),e.emit(t.QueryLexer.BOOST),t.QueryLexer.lexText},t.QueryLexer.lexEOS=function(e){e.width()>0&&e.emit(t.QueryLexer.TERM)},t.QueryLexer.termSeparator=t.tokenizer.separator,t.QueryLexer.lexText=function(e){for(;;){var n=e.next();if(n==t.QueryLexer.EOS)return t.QueryLexer.lexEOS;if(n.charCodeAt(0)==92){e.escapeCharacter();continue}if(n==":")return t.QueryLexer.lexField;if(n=="~")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexEditDistance;if(n=="^")return e.backup(),e.width()>0&&e.emit(t.QueryLexer.TERM),t.QueryLexer.lexBoost;if(n=="+"&&e.width()===1||n=="-"&&e.width()===1)return e.emit(t.QueryLexer.PRESENCE),t.QueryLexer.lexText;if(n.match(t.QueryLexer.termSeparator))return t.QueryLexer.lexTerm}},t.QueryParser=function(e,n){this.lexer=new t.QueryLexer(e),this.query=n,this.currentClause={},this.lexemeIdx=0},t.QueryParser.prototype.parse=function(){this.lexer.run(),this.lexemes=this.lexer.lexemes;for(var e=t.QueryParser.parseClause;e;)e=e(this);return this.query},t.QueryParser.prototype.peekLexeme=function(){return this.lexemes[this.lexemeIdx]},t.QueryParser.prototype.consumeLexeme=function(){var e=this.peekLexeme();return this.lexemeIdx+=1,e},t.QueryParser.prototype.nextClause=function(){var e=this.currentClause;this.query.clause(e),this.currentClause={}},t.QueryParser.parseClause=function(e){var n=e.peekLexeme();if(n!=null)switch(n.type){case t.QueryLexer.PRESENCE:return t.QueryParser.parsePresence;case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expected either a field or a term, found "+n.type;throw n.str.length>=1&&(r+=" with value '"+n.str+"'"),new t.QueryParseError(r,n.start,n.end)}},t.QueryParser.parsePresence=function(e){var n=e.consumeLexeme();if(n!=null){switch(n.str){case"-":e.currentClause.presence=t.Query.presence.PROHIBITED;break;case"+":e.currentClause.presence=t.Query.presence.REQUIRED;break;default:var r="unrecognised presence operator'"+n.str+"'";throw new t.QueryParseError(r,n.start,n.end)}var i=e.peekLexeme();if(i==null){var r="expecting term or field, found nothing";throw new t.QueryParseError(r,n.start,n.end)}switch(i.type){case t.QueryLexer.FIELD:return t.QueryParser.parseField;case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var r="expecting term or field, found '"+i.type+"'";throw new t.QueryParseError(r,i.start,i.end)}}},t.QueryParser.parseField=function(e){var n=e.consumeLexeme();if(n!=null){if(e.query.allFields.indexOf(n.str)==-1){var r=e.query.allFields.map(function(o){return"'"+o+"'"}).join(", "),i="unrecognised field '"+n.str+"', possible fields: "+r;throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.fields=[n.str];var s=e.peekLexeme();if(s==null){var i="expecting term, found nothing";throw new t.QueryParseError(i,n.start,n.end)}switch(s.type){case t.QueryLexer.TERM:return t.QueryParser.parseTerm;default:var i="expecting term, found '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseTerm=function(e){var n=e.consumeLexeme();if(n!=null){e.currentClause.term=n.str.toLowerCase(),n.str.indexOf("*")!=-1&&(e.currentClause.usePipeline=!1);var r=e.peekLexeme();if(r==null){e.nextClause();return}switch(r.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+r.type+"'";throw new t.QueryParseError(i,r.start,r.end)}}},t.QueryParser.parseEditDistance=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="edit distance must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.editDistance=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},t.QueryParser.parseBoost=function(e){var n=e.consumeLexeme();if(n!=null){var r=parseInt(n.str,10);if(isNaN(r)){var i="boost must be numeric";throw new t.QueryParseError(i,n.start,n.end)}e.currentClause.boost=r;var s=e.peekLexeme();if(s==null){e.nextClause();return}switch(s.type){case t.QueryLexer.TERM:return e.nextClause(),t.QueryParser.parseTerm;case t.QueryLexer.FIELD:return e.nextClause(),t.QueryParser.parseField;case t.QueryLexer.EDIT_DISTANCE:return t.QueryParser.parseEditDistance;case t.QueryLexer.BOOST:return t.QueryParser.parseBoost;case t.QueryLexer.PRESENCE:return e.nextClause(),t.QueryParser.parsePresence;default:var i="Unexpected lexeme type '"+s.type+"'";throw new t.QueryParseError(i,s.start,s.end)}}},(function(e,n){typeof define=="function"&&define.amd?define(n):typeof me=="object"?ge.exports=n():e.lunr=n()})(this,function(){return t})})()});var M,G={getItem(){return null},setItem(){}},K;try{K=localStorage,M=K}catch{K=G,M=G}var S={getItem:t=>M.getItem(t),setItem:(t,e)=>M.setItem(t,e),disableWritingLocalStorage(){M=G},disable(){localStorage.clear(),M=G},enable(){M=K}};window.TypeDoc||={disableWritingLocalStorage(){S.disableWritingLocalStorage()},disableLocalStorage:()=>{S.disable()},enableLocalStorage:()=>{S.enable()}};window.translations||={copy:"Copy",copied:"Copied!",normally_hidden:"This member is normally hidden due to your filter settings.",hierarchy_expand:"Expand",hierarchy_collapse:"Collapse",search_index_not_available:"The search index is not available",search_no_results_found_for_0:"No results found for {0}",folder:"Folder",kind_1:"Project",kind_2:"Module",kind_4:"Namespace",kind_8:"Enumeration",kind_16:"Enumeration Member",kind_32:"Variable",kind_64:"Function",kind_128:"Class",kind_256:"Interface",kind_512:"Constructor",kind_1024:"Property",kind_2048:"Method",kind_4096:"Call Signature",kind_8192:"Index Signature",kind_16384:"Constructor Signature",kind_32768:"Parameter",kind_65536:"Type Literal",kind_131072:"Type Parameter",kind_262144:"Accessor",kind_524288:"Get Signature",kind_1048576:"Set Signature",kind_2097152:"Type Alias",kind_4194304:"Reference",kind_8388608:"Document"};var pe=[];function X(t,e){pe.push({selector:e,constructor:t})}var Z=class{alwaysVisibleMember=null;constructor(){this.createComponents(document.body),this.ensureFocusedElementVisible(),this.listenForCodeCopies(),window.addEventListener("hashchange",()=>this.ensureFocusedElementVisible()),document.body.style.display||(this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}createComponents(e){pe.forEach(n=>{e.querySelectorAll(n.selector).forEach(r=>{r.dataset.hasInstance||(new n.constructor({el:r,app:this}),r.dataset.hasInstance=String(!0))})})}filterChanged(){this.ensureFocusedElementVisible()}showPage(){document.body.style.display&&(document.body.style.removeProperty("display"),this.ensureFocusedElementVisible(),this.updateIndexVisibility(),this.scrollToHash())}scrollToHash(){if(location.hash){let e=document.getElementById(location.hash.substring(1));if(!e)return;e.scrollIntoView({behavior:"instant",block:"start"})}}ensureActivePageVisible(){let e=document.querySelector(".tsd-navigation .current"),n=e?.parentElement;for(;n&&!n.classList.contains(".tsd-navigation");)n instanceof HTMLDetailsElement&&(n.open=!0),n=n.parentElement;if(e&&!rt(e)){let r=e.getBoundingClientRect().top-document.documentElement.clientHeight/4;document.querySelector(".site-menu").scrollTop=r,document.querySelector(".col-sidebar").scrollTop=r}}updateIndexVisibility(){let e=document.querySelector(".tsd-index-content"),n=e?.open;e&&(e.open=!0),document.querySelectorAll(".tsd-index-section").forEach(r=>{r.style.display="block";let i=Array.from(r.querySelectorAll(".tsd-index-link")).every(s=>s.offsetParent==null);r.style.display=i?"none":"block"}),e&&(e.open=n)}ensureFocusedElementVisible(){if(this.alwaysVisibleMember&&(this.alwaysVisibleMember.classList.remove("always-visible"),this.alwaysVisibleMember.firstElementChild.remove(),this.alwaysVisibleMember=null),!location.hash)return;let e=document.getElementById(location.hash.substring(1));if(!e)return;let n=e.parentElement;for(;n&&n.tagName!=="SECTION";)n=n.parentElement;if(!n)return;let r=n.offsetParent==null,i=n;for(;i!==document.body;)i instanceof HTMLDetailsElement&&(i.open=!0),i=i.parentElement;if(n.offsetParent==null){this.alwaysVisibleMember=n,n.classList.add("always-visible");let s=document.createElement("p");s.classList.add("warning"),s.textContent=window.translations.normally_hidden,n.prepend(s)}r&&e.scrollIntoView()}listenForCodeCopies(){document.querySelectorAll("pre > button").forEach(e=>{let n;e.addEventListener("click",()=>{e.previousElementSibling instanceof HTMLElement&&navigator.clipboard.writeText(e.previousElementSibling.innerText.trim()),e.textContent=window.translations.copied,e.classList.add("visible"),clearTimeout(n),n=setTimeout(()=>{e.classList.remove("visible"),n=setTimeout(()=>{e.textContent=window.translations.copy},100)},1e3)})})}};function rt(t){let e=t.getBoundingClientRect(),n=Math.max(document.documentElement.clientHeight,window.innerHeight);return!(e.bottom<0||e.top-n>=0)}var fe=(t,e=100)=>{let n;return()=>{clearTimeout(n),n=setTimeout(()=>t(),e)}};var Ie=nt(ye(),1);async function R(t){let e=Uint8Array.from(atob(t),s=>s.charCodeAt(0)),r=new Blob([e]).stream().pipeThrough(new DecompressionStream("deflate")),i=await new Response(r).text();return JSON.parse(i)}var Y="closing",ae="tsd-overlay";function it(){let t=Math.abs(window.innerWidth-document.documentElement.clientWidth);document.body.style.overflow="hidden",document.body.style.paddingRight=`${t}px`}function st(){document.body.style.removeProperty("overflow"),document.body.style.removeProperty("padding-right")}function xe(t,e){t.addEventListener("animationend",()=>{t.classList.contains(Y)&&(t.classList.remove(Y),document.getElementById(ae)?.remove(),t.close(),st())}),t.addEventListener("cancel",n=>{n.preventDefault(),ve(t)}),e?.closeOnClick&&document.addEventListener("click",n=>{t.open&&!t.contains(n.target)&&ve(t)},!0)}function Ee(t){if(t.open)return;let e=document.createElement("div");e.id=ae,document.body.appendChild(e),t.showModal(),it()}function ve(t){if(!t.open)return;document.getElementById(ae)?.classList.add(Y),t.classList.add(Y)}var I=class{el;app;constructor(e){this.el=e.el,this.app=e.app}};var be=document.head.appendChild(document.createElement("style"));be.dataset.for="filters";var le={};function we(t){for(let e of t.split(/\s+/))if(le.hasOwnProperty(e)&&!le[e])return!0;return!1}var ee=class extends I{key;value;constructor(e){super(e),this.key=`filter-${this.el.name}`,this.value=this.el.checked,this.el.addEventListener("change",()=>{this.setLocalStorage(this.el.checked)}),this.setLocalStorage(this.fromLocalStorage()),be.innerHTML+=`html:not(.${this.key}) .tsd-is-${this.el.name} { display: none; } +`,this.app.updateIndexVisibility()}fromLocalStorage(){let e=S.getItem(this.key);return e?e==="true":this.el.checked}setLocalStorage(e){S.setItem(this.key,e.toString()),this.value=e,this.handleValueChange()}handleValueChange(){this.el.checked=this.value,document.documentElement.classList.toggle(this.key,this.value),le[`tsd-is-${this.el.name}`]=this.value,this.app.filterChanged(),this.app.updateIndexVisibility()}};var Le=0;async function Se(t,e){if(!window.searchData)return;let n=await R(window.searchData);t.data=n,t.index=Ie.Index.load(n.index),e.innerHTML=""}function _e(){let t=document.getElementById("tsd-search-trigger"),e=document.getElementById("tsd-search"),n=document.getElementById("tsd-search-input"),r=document.getElementById("tsd-search-results"),i=document.getElementById("tsd-search-script"),s=document.getElementById("tsd-search-status");if(!(t&&e&&n&&r&&i&&s))throw new Error("Search controls missing");let o={base:document.documentElement.dataset.base};o.base.endsWith("/")||(o.base+="/"),i.addEventListener("error",()=>{let a=window.translations.search_index_not_available;Pe(s,a)}),i.addEventListener("load",()=>{Se(o,s)}),Se(o,s),ot({trigger:t,searchEl:e,results:r,field:n,status:s},o)}function ot(t,e){let{field:n,results:r,searchEl:i,status:s,trigger:o}=t;xe(i,{closeOnClick:!0});function a(){Ee(i),n.setSelectionRange(0,n.value.length)}o.addEventListener("click",a),n.addEventListener("input",fe(()=>{at(r,n,s,e)},200)),n.addEventListener("keydown",l=>{if(r.childElementCount===0||l.ctrlKey||l.metaKey||l.altKey)return;let d=n.getAttribute("aria-activedescendant"),f=d?document.getElementById(d):null;if(f){let p=!1,v=!1;switch(l.key){case"Home":case"End":case"ArrowLeft":case"ArrowRight":v=!0;break;case"ArrowDown":case"ArrowUp":p=l.shiftKey;break}(p||v)&&ke(n)}if(!l.shiftKey)switch(l.key){case"Enter":f?.querySelector("a")?.click();break;case"ArrowUp":Te(r,n,f,-1),l.preventDefault();break;case"ArrowDown":Te(r,n,f,1),l.preventDefault();break}});function c(){ke(n)}n.addEventListener("change",c),n.addEventListener("blur",c),n.addEventListener("click",c),document.body.addEventListener("keydown",l=>{if(l.altKey||l.metaKey||l.shiftKey)return;let d=l.ctrlKey&&l.key==="k",f=!l.ctrlKey&&!ut()&&l.key==="/";(d||f)&&(l.preventDefault(),a())})}function at(t,e,n,r){if(!r.index||!r.data)return;t.innerHTML="",n.innerHTML="",Le+=1;let i=e.value.trim(),s;if(i){let a=i.split(" ").map(c=>c.length?`*${c}*`:"").join(" ");s=r.index.search(a).filter(({ref:c})=>{let l=r.data.rows[Number(c)].classes;return!l||!we(l)})}else s=[];if(s.length===0&&i){let a=window.translations.search_no_results_found_for_0.replace("{0}",` "${te(i)}" `);Pe(n,a);return}for(let a=0;ac.score-a.score);let o=Math.min(10,s.length);for(let a=0;a`,f=Ce(c.name,i);globalThis.DEBUG_SEARCH_WEIGHTS&&(f+=` (score: ${s[a].score.toFixed(2)})`),c.parent&&(f=` + ${Ce(c.parent,i)}.${f}`);let p=document.createElement("li");p.id=`tsd-search:${Le}-${a}`,p.role="option",p.ariaSelected="false",p.classList.value=c.classes??"";let v=document.createElement("a");v.tabIndex=-1,v.href=r.base+c.url,v.innerHTML=d+`${f}`,p.append(v),t.appendChild(p)}}function Te(t,e,n,r){let i;if(r===1?i=n?.nextElementSibling||t.firstElementChild:i=n?.previousElementSibling||t.lastElementChild,i!==n){if(!i||i.role!=="option"){console.error("Option missing");return}i.ariaSelected="true",i.scrollIntoView({behavior:"smooth",block:"nearest"}),e.setAttribute("aria-activedescendant",i.id),n?.setAttribute("aria-selected","false")}}function ke(t){let e=t.getAttribute("aria-activedescendant");(e?document.getElementById(e):null)?.setAttribute("aria-selected","false"),t.setAttribute("aria-activedescendant","")}function Ce(t,e){if(e==="")return t;let n=t.toLocaleLowerCase(),r=e.toLocaleLowerCase(),i=[],s=0,o=n.indexOf(r);for(;o!=-1;)i.push(te(t.substring(s,o)),`${te(t.substring(o,o+r.length))}`),s=o+r.length,o=n.indexOf(r,s);return i.push(te(t.substring(s))),i.join("")}var lt={"&":"&","<":"<",">":">","'":"'",'"':"""};function te(t){return t.replace(/[&<>"'"]/g,e=>lt[e])}function Pe(t,e){t.innerHTML=e?`
${e}
`:""}var ct=["button","checkbox","file","hidden","image","radio","range","reset","submit"];function ut(){let t=document.activeElement;return t?t.isContentEditable||t.tagName==="TEXTAREA"||t.tagName==="SEARCH"?!0:t.tagName==="INPUT"&&!ct.includes(t.type):!1}var D="mousedown",Me="mousemove",$="mouseup",ne={x:0,y:0},Qe=!1,ce=!1,dt=!1,F=!1,Oe=/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);document.documentElement.classList.add(Oe?"is-mobile":"not-mobile");Oe&&"ontouchstart"in document.documentElement&&(dt=!0,D="touchstart",Me="touchmove",$="touchend");document.addEventListener(D,t=>{ce=!0,F=!1;let e=D=="touchstart"?t.targetTouches[0]:t;ne.y=e.pageY||0,ne.x=e.pageX||0});document.addEventListener(Me,t=>{if(ce&&!F){let e=D=="touchstart"?t.targetTouches[0]:t,n=ne.x-(e.pageX||0),r=ne.y-(e.pageY||0);F=Math.sqrt(n*n+r*r)>10}});document.addEventListener($,()=>{ce=!1});document.addEventListener("click",t=>{Qe&&(t.preventDefault(),t.stopImmediatePropagation(),Qe=!1)});var re=class extends I{active;className;constructor(e){super(e),this.className=this.el.dataset.toggle||"",this.el.addEventListener($,n=>this.onPointerUp(n)),this.el.addEventListener("click",n=>n.preventDefault()),document.addEventListener(D,n=>this.onDocumentPointerDown(n)),document.addEventListener($,n=>this.onDocumentPointerUp(n))}setActive(e){if(this.active==e)return;this.active=e,document.documentElement.classList.toggle("has-"+this.className,e),this.el.classList.toggle("active",e);let n=(this.active?"to-has-":"from-has-")+this.className;document.documentElement.classList.add(n),setTimeout(()=>document.documentElement.classList.remove(n),500)}onPointerUp(e){F||(this.setActive(!0),e.preventDefault())}onDocumentPointerDown(e){if(this.active){if(e.target.closest(".col-sidebar, .tsd-filter-group"))return;this.setActive(!1)}}onDocumentPointerUp(e){if(!F&&this.active&&e.target.closest(".col-sidebar")){let n=e.target.closest("a");if(n){let r=window.location.href;r.indexOf("#")!=-1&&(r=r.substring(0,r.indexOf("#"))),n.href.substring(0,r.length)==r&&setTimeout(()=>this.setActive(!1),250)}}}};var ue=new Map,de=class{open;accordions=[];key;constructor(e,n){this.key=e,this.open=n}add(e){this.accordions.push(e),e.open=this.open,e.addEventListener("toggle",()=>{this.toggle(e.open)})}toggle(e){for(let n of this.accordions)n.open=e;S.setItem(this.key,e.toString())}},ie=class extends I{constructor(e){super(e);let n=this.el.querySelector("summary"),r=n.querySelector("a");r&&r.addEventListener("click",()=>{location.assign(r.href)});let i=`tsd-accordion-${n.dataset.key??n.textContent.trim().replace(/\s+/g,"-").toLowerCase()}`,s;if(ue.has(i))s=ue.get(i);else{let o=S.getItem(i),a=o?o==="true":this.el.open;s=new de(i,a),ue.set(i,s)}s.add(this.el)}};function He(t){let e=S.getItem("tsd-theme")||"os";t.value=e,Ae(e),t.addEventListener("change",()=>{S.setItem("tsd-theme",t.value),Ae(t.value)})}function Ae(t){document.documentElement.dataset.theme=t}var se;function Ne(){let t=document.getElementById("tsd-nav-script");t&&(t.addEventListener("load",Re),Re())}async function Re(){let t=document.getElementById("tsd-nav-container");if(!t||!window.navigationData)return;let e=await R(window.navigationData);se=document.documentElement.dataset.base,se.endsWith("/")||(se+="/"),t.innerHTML="";for(let n of e)Be(n,t,[]);window.app.createComponents(t),window.app.showPage(),window.app.ensureActivePageVisible()}function Be(t,e,n){let r=e.appendChild(document.createElement("li"));if(t.children){let i=[...n,t.text],s=r.appendChild(document.createElement("details"));s.className=t.class?`${t.class} tsd-accordion`:"tsd-accordion";let o=s.appendChild(document.createElement("summary"));o.className="tsd-accordion-summary",o.dataset.key=i.join("$"),o.innerHTML='',De(t,o);let a=s.appendChild(document.createElement("div"));a.className="tsd-accordion-details";let c=a.appendChild(document.createElement("ul"));c.className="tsd-nested-navigation";for(let l of t.children)Be(l,c,i)}else De(t,r,t.class)}function De(t,e,n){if(t.path){let r=e.appendChild(document.createElement("a"));if(r.href=se+t.path,n&&(r.className=n),location.pathname===r.pathname&&!r.href.includes("#")&&(r.classList.add("current"),r.ariaCurrent="page"),t.kind){let i=window.translations[`kind_${t.kind}`].replaceAll('"',""");r.innerHTML=``}r.appendChild(Fe(t.text,document.createElement("span")))}else{let r=e.appendChild(document.createElement("span")),i=window.translations.folder.replaceAll('"',""");r.innerHTML=``,r.appendChild(Fe(t.text,document.createElement("span")))}}function Fe(t,e){let n=t.split(/(?<=[^A-Z])(?=[A-Z])|(?<=[A-Z])(?=[A-Z][a-z])|(?<=[_-])(?=[^_-])/);for(let r=0;r{let i=r.target;for(;i.parentElement&&i.parentElement.tagName!="LI";)i=i.parentElement;i.dataset.dropdown&&(i.dataset.dropdown=String(i.dataset.dropdown!=="true"))});let t=new Map,e=new Set;for(let r of document.querySelectorAll(".tsd-full-hierarchy [data-refl]")){let i=r.querySelector("ul");t.has(r.dataset.refl)?e.add(r.dataset.refl):i&&t.set(r.dataset.refl,i)}for(let r of e)n(r);function n(r){let i=t.get(r).cloneNode(!0);i.querySelectorAll("[id]").forEach(s=>{s.removeAttribute("id")}),i.querySelectorAll("[data-dropdown]").forEach(s=>{s.dataset.dropdown="false"});for(let s of document.querySelectorAll(`[data-refl="${r}"]`)){let o=gt(),a=s.querySelector("ul");s.insertBefore(o,a),o.dataset.dropdown=String(!!a),a||s.appendChild(i.cloneNode(!0))}}}function pt(){let t=document.getElementById("tsd-hierarchy-script");t&&(t.addEventListener("load",Ve),Ve())}async function Ve(){let t=document.querySelector(".tsd-panel.tsd-hierarchy:has(h4 a)");if(!t||!window.hierarchyData)return;let e=+t.dataset.refl,n=await R(window.hierarchyData),r=t.querySelector("ul"),i=document.createElement("ul");if(i.classList.add("tsd-hierarchy"),ft(i,n,e),r.querySelectorAll("li").length==i.querySelectorAll("li").length)return;let s=document.createElement("span");s.classList.add("tsd-hierarchy-toggle"),s.textContent=window.translations.hierarchy_expand,t.querySelector("h4 a")?.insertAdjacentElement("afterend",s),s.insertAdjacentText("beforebegin",", "),s.addEventListener("click",()=>{s.textContent===window.translations.hierarchy_expand?(r.insertAdjacentElement("afterend",i),r.remove(),s.textContent=window.translations.hierarchy_collapse):(i.insertAdjacentElement("afterend",r),i.remove(),s.textContent=window.translations.hierarchy_expand)})}function ft(t,e,n){let r=e.roots.filter(i=>mt(e,i,n));for(let i of r)t.appendChild(je(e,i,n))}function je(t,e,n,r=new Set){if(r.has(e))return;r.add(e);let i=t.reflections[e],s=document.createElement("li");if(s.classList.add("tsd-hierarchy-item"),e===n){let o=s.appendChild(document.createElement("span"));o.textContent=i.name,o.classList.add("tsd-hierarchy-target")}else{for(let a of i.uniqueNameParents||[]){let c=t.reflections[a],l=s.appendChild(document.createElement("a"));l.textContent=c.name,l.href=oe+c.url,l.className=c.class+" tsd-signature-type",s.append(document.createTextNode("."))}let o=s.appendChild(document.createElement("a"));o.textContent=t.reflections[e].name,o.href=oe+i.url,o.className=i.class+" tsd-signature-type"}if(i.children){let o=s.appendChild(document.createElement("ul"));o.classList.add("tsd-hierarchy");for(let a of i.children){let c=je(t,a,n,r);c&&o.appendChild(c)}}return r.delete(e),s}function mt(t,e,n){if(e===n)return!0;let r=new Set,i=[t.reflections[e]];for(;i.length;){let s=i.pop();if(!r.has(s)){r.add(s);for(let o of s.children||[]){if(o===n)return!0;i.push(t.reflections[o])}}}return!1}function gt(){let t=document.createElementNS("http://www.w3.org/2000/svg","svg");return t.setAttribute("width","20"),t.setAttribute("height","20"),t.setAttribute("viewBox","0 0 24 24"),t.setAttribute("fill","none"),t.innerHTML='',t}X(re,"a[data-toggle]");X(ie,".tsd-accordion");X(ee,".tsd-filter-item input[type=checkbox]");var qe=document.getElementById("tsd-theme");qe&&He(qe);var yt=new Z;Object.defineProperty(window,"app",{value:yt});_e();Ne();$e();"virtualKeyboard"in navigator&&(navigator.virtualKeyboard.overlaysContent=!0);})(); +/*! Bundled license information: + +lunr/lunr.js: + (** + * lunr - http://lunrjs.com - A bit like Solr, but much smaller and not as bright - 2.3.9 + * Copyright (C) 2020 Oliver Nightingale + * @license MIT + *) + (*! + * lunr.utils + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Set + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.tokenizer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Pipeline + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Vector + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.stemmer + * Copyright (C) 2020 Oliver Nightingale + * Includes code from - http://tartarus.org/~martin/PorterStemmer/js.txt + *) + (*! + * lunr.stopWordFilter + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.trimmer + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.TokenSet + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Index + * Copyright (C) 2020 Oliver Nightingale + *) + (*! + * lunr.Builder + * Copyright (C) 2020 Oliver Nightingale + *) +*/ diff --git a/docs/assets/navigation.js b/docs/assets/navigation.js new file mode 100644 index 0000000..1e4d9d5 --- /dev/null +++ b/docs/assets/navigation.js @@ -0,0 +1 @@ +window.navigationData = "eJyNlMtuwjAQRf/Fa9SUVPTBspS+JFoJ2FVdTO0JWMSTyHYiUMW/V0ADsUlMdlHm3ONJZpKvX2ZxbdmQPckkkbxI7Yb1WA52yYYMqVAmOlWullalrMdWkgQb3m97x/QLKJxkAv1sdT+cnBYpzjd5Y7qqtRtGGe2vjmGegjFoov+Cm+zH9exzphc4kYRcQ9KgcOsh0xEaZUoBiQkQLFCfK1vAjm4i5FZm1EXvsZ1OGJdI9hVIpEF5HQt53x5R6IyvZqhL1J/5rh1z8kqyqBPgaKJG0lXHg9u6+vSA+25atD4VVI7XFkmg+N+cEfAlNmubyE7qaUEEP+kFbUUFle5yBl9uIxqUv0MJHaZ2hgWlh01USLaDugUOH+AsaJvYhULCah4zJOFOzW5yNJFf91zXD3f9QVzzzTWQSTKt/P4OOq98yeZOtf5NfoCq9VqClrvu/P+Zn3DPu4m3339t+yIK" \ No newline at end of file diff --git a/docs/assets/search.js b/docs/assets/search.js new file mode 100644 index 0000000..9aa4fcd --- /dev/null +++ b/docs/assets/search.js @@ -0,0 +1 @@ +window.searchData = "eJytnNuO20YSht+Fc6vY00eSc2d7vZsESTaws3sjGAuOxBnTliiBoiY2Bn73RfNYxS6SRY2ubIy6/qru/rr6QLKfg+Lw9ym4Wz8HX7N8G9xFqyBP9mlwF/wje3jINudd+T1YBediF9wFaX7en173P7z6XO53wSrY7JLTKT0Fd0HwY9UqCdtJvU9OMyI3aV0EKK2CY1KkeYlDIfV/TortjP7nushl+n8cin2ym/GQt4Uu8/FnmmzSh/Ocl2NfbIGfvlf/lezT3w/bdOCm/TO3R99sn9K8PBeTOjcJKEVH24VDenlXpEmZPU072fSFLvHx8ZhuyqQ8FJNOTqDURV7OxVP25DE0cNIXYvvAPfvhvEv/+n6kGqz9idvDbw+HXZrkc0o391258Zi7sEhPv+Rl+phS7Y89ZV25ZZ5k30bvDnmZfis7V43Q6+bvk21jhOx0Nof8VBbnDcSG0rrBBem426BAyLdSd76Kc15m+3TaT1+o91Getj9lp5+y/HNaZGW6nfYprRS69/rYNOa0W1eqqEtx6zbwkx3fAshIJ9nxfoKvWQ/54XCcdtCUuFD/cP9lWr4ucKn6MS2SWcxAqQv9HHfJ93TGS1fmQh+ntHhKi49lUs5gVRc8NQUv9HY+pcUsW67QMrpgOvnnoXhMf8/ydFMkD35WwT9fJbkQkqwcM4h0JNVsDvt9km9PTLdd4Zf43KanTZEdy+zgdxXlFpd/iefqH47LpuBLfB2qgHkN25d9icd6DLEcdkVf4s8NWG4f9mUXepS3uh99j2n5Nt0Wh81Xl1LOvMZ9TMv72ujUGr0whl+Tp2RZAF+Sp+Qq3rM8Y2Wdm6bg0v4Fqa77/V097H9P8uSR4Guk3PSqE3L0Ocm3u7T4gxqcU+I3jeHkYB2rxWyd8zzduFHJqPag6FXS/ow8awqYqM3odNAWvCSg3vRa8YyktLlYZtIbKw407JrKXdooL2wRCtD3bp/9cz0AxsOCpSaxRLUt0sfsVC7SvQE2M1VFkYMIDNgftlm+6sd/D2ZStyssHpJNenpNFlyQeQ6ncpnsTWNC15GOe8T58VAsdd6YXOYcNXDPW9UddOMOC/EbtuE+3fJ1b6DNSA29qMdWmNnpkggGZi8MokjblJg/LghiYLY8CNTP77+Vab5Nt82u5l2y+ZySwVAF+f3tnR2wpOcPE+j4R4LABwu8CKZPGha59/btvAhmN/KLghhs6nkhzOzyFwVA7fh5UXCOABaFMjwO4IUxdz4wFwI5/D6c8zy5nxkfbSH+sIMHUbOKk6dSfqQjNcJbh6mpmSzJr1uzZ1sofdObjVSUrsBIEOn45DgRQ2d1jRDc1nFpAI3NNdwPVuDMAGYW4LMhIOSq7fbsStArdYVlIK05swb0w126ABxxO736m3KLmrPeYOzTvJxv1JGyV2jaKeWZBh6rwEgI++Tbh3ZN9aYs0/1xZERPhrRPvnUrs6RXuU6IoyRMhjTNw8IQusotjwOaXjkY96CwgA9RlweV9RLXCa48fE3pRcVkQK3ZxUHgQYx20yM84zL8QZvsdoe/f8tO5ZvtdmQDRWnfVHa77FQmjd1YXQfBz4XxId0fni4KpOgsXxbKfZIvbIv7JL9OK9wn+eL63yf5tWo+vY8mvTP20Ezns/t40j9vG88MIS2KkS0d6bst/jKn7Xb6P8dtsqjq7Yb63Bm+LJBqS72Q/GpLfR32K/eL6a8CuBb/7fZ8YSO0Ztdph1ZtcVO0htdqjfqk4NdDli+Jorb60lpdI4Tf0oeRlcp4ALva5mXuZ0/1yAB4h3rMEOrN1ZtNmT1l4FXN2SBqu6S3u0YYH5NFQDaHPMk1YOwCWNQVXQTX64qPZVIsStPdUVdxjSTdH7md+QtBcNw28VB6aQiH4/GSzujtFochb+NQmP6ZanuO9THNt+jErfx+TE+vhz/PPBTD2n8VSX56OBT7waK7lh78OqmselF8FAIfjqEH4k9JkbmAh0/7hwaU20+rIMu36bfg7rl7aeMukK/UqzhYBQ9Zutu6F8Lb12Pcaz6u3VfB9rA5V//91BT7b+oeOLvCdenXt8FqfbvS8tVtHH76tFq3xtUP1R9ajf4vlaEIVmtBGQrPUCBDGazWkjKUnqFEhipYrRVlqDxDhQx1sFprylB7hhoZmmC1NpSh8QwNMrTBam0pQ+sZWmQYBqt1SBmGnmGIDKNgtY4ow8gzjJBhHKzWMWUYe4YxBsDxIEh2hA+PGNBT4UPzQwCECRKOC0EyJHyIBKZIODYEyZHwQRKYJOH4EHql1CsrNTb2YRKYJuEYESRPwgdKYKKE40TYlbKv4ijCxj5UAlMlHCsiJI19sAQmSzheBMmW8OESmC7hmBEx6dkHTGDCpGNG3lLG0idMYsKkY0YK0tgnTA5yVJWkJGlMpClMmHTMSEUa+4RJTJh0zEgyW0mfMIkJk2YUT+kTJjFh0jEjSTylT5jEhEnHjCRTnvQJk5gw6ZiRZNqTPmESEyYdM5LEU/qESUyYqgiLqQZTPmEKE6YcM4pMgMonTGHClGNGkQlQ+YSpwUxYTYVkAlTEZIgJU44ZRU+kPmEKE6YcM4rEU/mEKUyYcswokjDlE6YwYcoxo0jClE+YwoSpaHRgKJ8whQlTjhlF4ql8whQmTI8Tpn3CNCZMV4SRbGufMI0J0xVh5NSufcI0Jkw7ZjTJtvYJ04P1VrXgItnWxJILE6YdM1qSDeYTpjFh2jGjFWnsE6YxYdoxo+mFok+YxoRpx4w2VNLXPmEaE6YdM5qc3LVPmMaEGceMJid34xNmMGHGMaNJwoxPmMGEGTm6JjE+YQYTZtTomsT4hBlMmNGjKwPjE2YGq3ozujIwxMIeE2bs6MrA+IQZTJgJR1cGxifMYMJMRRg5no1PmMGEmfF1mPEJM5gw65gxZDKwPmEWE2YdM4ZMBtYnzGLCrGPGkBOd9QmzmDDrmDHkRGd9wiwmzOrRvG19wiwmzFYbRzKTWJ8wO9g72tEEaIntIybMhqMJ0PqEWUyYdcwYcn62PmEWE2bj8bB9wiwmLKwIIyf30CcsxISFYrTOoU9YiAkLK8LoLbdPWIgJCyvCyOwZ+oSFmLDQMWPI8Rz6hIWYsNAxY8khGfqEhZiwsDqeIIdk6BMWDk4oHDOWHJIhcUiBCQsdM5YckqFPWIgJCx0zlhxVoU9YiAmLbkfn58gnLMKERWJ0fo58wiJMWOSYseSoinzCIkxY5Jix5MCIfMIiTFjkmLEk25FPWIQJiyrC6CMln7AIExZVhJFsRz5hESYsqg7BSLYjn7BocA7mmAlJtiPiKAwTFjlmQpLtyCcswoTF4+uw2CcsxoTFjpmQHBixT1iMCYsdMyE5MGKfsBgTFjtmQhLP2CcsxoTFjpmQxDP2CYsxYbFjJiTxjH3CYkxY7JgJSTxjn7AYExZXhNGnnj5hMSYsro5aSTxjn7B4cNrqmIlIPGPiwLX+U3X8/5S6Z02/1I8B1usAXNTxHPyveTzQvWD0HNjg7vnHj/5hwN3zD/A8wP3mXA3f+AFSotcKF4p1T6uBnARyIUuufwsByCggE3FlqHg0EIp5Qu2byb2KAY1kBU+lvXyjVxFARfBU+i+5exlpehnJ67Huvb9eRUW9iuYG072s0+toEI2Oasvodole9SUiCCzsBRWvx9A3lqC9Qd8LXdtKU/+reFBt2ltJgCpAUyieSncPTi8DaskbJujrekADyAWSqQSuj+qFbnsdXvfh17cAESAiHTdE8Airr5oCbQ2amidQv9YFxj/AM5I8jeahMRj+IKlZpkjz/PrUPd4GXR/3cjGvyx7cs+R9f50F6H8AudQXiFXVRV9o9+IR6ICYNxbdm2376hYr0H69imGL1N+bARYAVsLWhobXGa1cWd2/BCQB84IHvffiHkANBBjxEoN/5QHIg6DtFbOe+AIDoAUAVrzQRohQoC8Vb/Kp73cDxAJgeQLVVwYgwQAF3eRz2xBheZRmbbNX77V013oAH6D1NW9YZf185qcQDYap5o35rM0hzSS0qb8JBZpgCje8/NhpFt2HbkAP5CXDmx8znEuIhjRgjFneGMsqiMd6xoCWtLx0ku27l/bHZQHYlll5nEORnAXVDplRVjeBgKEGFhqKiWB7DxvIcWCwCN54a761BRpgsSLCJvXy0gh8yRi0DhCMmFU7jizwwSCIeA1df3UHuh40tOVVi/7KCEiCuSDkUd/B1Kz59+19JoAIgL7i1RWotsmJEgbhKl52ItcPSBNkE80DbzjZSICJ5I3J+sI4gC7AQ3Al6ttCQVVA67Akqi94QRCgKUSzIja8iar/6hw0C8gt8raR442iwevuYBiBECPevO69sw5WuCDCiMcTkZIl6DvJa67+DlYwrQEOeSLNZ/YgErAakKJpcd4AxO/UgyYCkhEPTPh2PBACCT5itlL1QSJoIQC4bhdSTZ4PeQsL8G0hyIJwk8tLAfgFfBAikDIN8zEvsRJfGIIQAWMhb3D3N+iA8ADwminT3gsK8gRYgwgeXu0H3IBVMJJV01K6+dfyBsDwAwQAGyAl5pGBviQASmBYxjw28BcBQAo0W8xr/MGL/UALzITxktZq7sMA/QD3ObLJGbzMil/5B8GBQRAv4aN/cR+IAfJjZlz9VcvgjACkH55Kd5dyLwJPRFgizVe6YCADiZDXcWX7IYC/fI/AeI551eruIwEIgNEiVYMAbzrs7mEEqxAQk2KMvU+r4Jgd012Wp8Hd+tOPH/8HCR7dOg=="; \ No newline at end of file diff --git a/docs/assets/style.css b/docs/assets/style.css new file mode 100644 index 0000000..44328e9 --- /dev/null +++ b/docs/assets/style.css @@ -0,0 +1,1633 @@ +@layer typedoc { + :root { + --dim-toolbar-contents-height: 2.5rem; + --dim-toolbar-border-bottom-width: 1px; + --dim-header-height: calc( + var(--dim-toolbar-border-bottom-width) + + var(--dim-toolbar-contents-height) + ); + + /* 0rem For mobile; unit is required for calculation in `calc` */ + --dim-container-main-margin-y: 0rem; + + --dim-footer-height: 3.5rem; + + --modal-animation-duration: 0.2s; + } + + :root { + /* Light */ + --light-color-background: #f2f4f8; + --light-color-background-secondary: #eff0f1; + /* Not to be confused with [:active](https://developer.mozilla.org/en-US/docs/Web/CSS/:active) */ + --light-color-background-active: #d6d8da; + --light-color-background-warning: #e6e600; + --light-color-warning-text: #222; + --light-color-accent: #c5c7c9; + --light-color-active-menu-item: var(--light-color-background-active); + --light-color-text: #222; + --light-color-contrast-text: #000; + --light-color-text-aside: #5e5e5e; + + --light-color-icon-background: var(--light-color-background); + --light-color-icon-text: var(--light-color-text); + + --light-color-comment-tag-text: var(--light-color-text); + --light-color-comment-tag: var(--light-color-background); + + --light-color-link: #1f70c2; + --light-color-focus-outline: #3584e4; + + --light-color-ts-keyword: #056bd6; + --light-color-ts-project: #b111c9; + --light-color-ts-module: var(--light-color-ts-project); + --light-color-ts-namespace: var(--light-color-ts-project); + --light-color-ts-enum: #7e6f15; + --light-color-ts-enum-member: var(--light-color-ts-enum); + --light-color-ts-variable: #4760ec; + --light-color-ts-function: #572be7; + --light-color-ts-class: #1f70c2; + --light-color-ts-interface: #108024; + --light-color-ts-constructor: var(--light-color-ts-class); + --light-color-ts-property: #9f5f30; + --light-color-ts-method: #be3989; + --light-color-ts-reference: #ff4d82; + --light-color-ts-call-signature: var(--light-color-ts-method); + --light-color-ts-index-signature: var(--light-color-ts-property); + --light-color-ts-constructor-signature: var( + --light-color-ts-constructor + ); + --light-color-ts-parameter: var(--light-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --light-color-ts-type-parameter: #a55c0e; + --light-color-ts-accessor: #c73c3c; + --light-color-ts-get-signature: var(--light-color-ts-accessor); + --light-color-ts-set-signature: var(--light-color-ts-accessor); + --light-color-ts-type-alias: #d51270; + /* reference not included as links will be colored with the kind that it points to */ + --light-color-document: #000000; + + --light-color-alert-note: #0969d9; + --light-color-alert-tip: #1a7f37; + --light-color-alert-important: #8250df; + --light-color-alert-warning: #9a6700; + --light-color-alert-caution: #cf222e; + + --light-external-icon: url("data:image/svg+xml;utf8,"); + --light-color-scheme: light; + } + + :root { + /* Dark */ + --dark-color-background: #2b2e33; + --dark-color-background-secondary: #1e2024; + /* Not to be confused with [:active](https://developer.mozilla.org/en-US/docs/Web/CSS/:active) */ + --dark-color-background-active: #5d5d6a; + --dark-color-background-warning: #bebe00; + --dark-color-warning-text: #222; + --dark-color-accent: #9096a2; + --dark-color-active-menu-item: var(--dark-color-background-active); + --dark-color-text: #f5f5f5; + --dark-color-contrast-text: #ffffff; + --dark-color-text-aside: #dddddd; + + --dark-color-icon-background: var(--dark-color-background-secondary); + --dark-color-icon-text: var(--dark-color-text); + + --dark-color-comment-tag-text: var(--dark-color-text); + --dark-color-comment-tag: var(--dark-color-background); + + --dark-color-link: #00aff4; + --dark-color-focus-outline: #4c97f2; + + --dark-color-ts-keyword: #3399ff; + --dark-color-ts-project: #e358ff; + --dark-color-ts-module: var(--dark-color-ts-project); + --dark-color-ts-namespace: var(--dark-color-ts-project); + --dark-color-ts-enum: #f4d93e; + --dark-color-ts-enum-member: var(--dark-color-ts-enum); + --dark-color-ts-variable: #798dff; + --dark-color-ts-function: #a280ff; + --dark-color-ts-class: #8ac4ff; + --dark-color-ts-interface: #6cff87; + --dark-color-ts-constructor: var(--dark-color-ts-class); + --dark-color-ts-property: #ff984d; + --dark-color-ts-method: #ff4db8; + --dark-color-ts-reference: #ff4d82; + --dark-color-ts-call-signature: var(--dark-color-ts-method); + --dark-color-ts-index-signature: var(--dark-color-ts-property); + --dark-color-ts-constructor-signature: var(--dark-color-ts-constructor); + --dark-color-ts-parameter: var(--dark-color-ts-variable); + /* type literal not included as links will never be generated to it */ + --dark-color-ts-type-parameter: #e07d13; + --dark-color-ts-accessor: #ff6060; + --dark-color-ts-get-signature: var(--dark-color-ts-accessor); + --dark-color-ts-set-signature: var(--dark-color-ts-accessor); + --dark-color-ts-type-alias: #ff6492; + /* reference not included as links will be colored with the kind that it points to */ + --dark-color-document: #ffffff; + + --dark-color-alert-note: #0969d9; + --dark-color-alert-tip: #1a7f37; + --dark-color-alert-important: #8250df; + --dark-color-alert-warning: #9a6700; + --dark-color-alert-caution: #cf222e; + + --dark-external-icon: url("data:image/svg+xml;utf8,"); + --dark-color-scheme: dark; + } + + @media (prefers-color-scheme: light) { + :root { + --color-background: var(--light-color-background); + --color-background-secondary: var( + --light-color-background-secondary + ); + --color-background-active: var(--light-color-background-active); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-contrast-text: var(--light-color-contrast-text); + --color-text-aside: var(--light-color-text-aside); + + --color-icon-background: var(--light-color-icon-background); + --color-icon-text: var(--light-color-icon-text); + + --color-comment-tag-text: var(--light-color-text); + --color-comment-tag: var(--light-color-background); + + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-project: var(--light-color-ts-project); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-reference: var(--light-color-ts-reference); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); + + --color-alert-note: var(--light-color-alert-note); + --color-alert-tip: var(--light-color-alert-tip); + --color-alert-important: var(--light-color-alert-important); + --color-alert-warning: var(--light-color-alert-warning); + --color-alert-caution: var(--light-color-alert-caution); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); + } + } + + @media (prefers-color-scheme: dark) { + :root { + --color-background: var(--dark-color-background); + --color-background-secondary: var( + --dark-color-background-secondary + ); + --color-background-active: var(--dark-color-background-active); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-contrast-text: var(--dark-color-contrast-text); + --color-text-aside: var(--dark-color-text-aside); + + --color-icon-background: var(--dark-color-icon-background); + --color-icon-text: var(--dark-color-icon-text); + + --color-comment-tag-text: var(--dark-color-text); + --color-comment-tag: var(--dark-color-background); + + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-project: var(--dark-color-ts-project); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-reference: var(--dark-color-ts-reference); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); + + --color-alert-note: var(--dark-color-alert-note); + --color-alert-tip: var(--dark-color-alert-tip); + --color-alert-important: var(--dark-color-alert-important); + --color-alert-warning: var(--dark-color-alert-warning); + --color-alert-caution: var(--dark-color-alert-caution); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); + } + } + + :root[data-theme="light"] { + --color-background: var(--light-color-background); + --color-background-secondary: var(--light-color-background-secondary); + --color-background-active: var(--light-color-background-active); + --color-background-warning: var(--light-color-background-warning); + --color-warning-text: var(--light-color-warning-text); + --color-icon-background: var(--light-color-icon-background); + --color-accent: var(--light-color-accent); + --color-active-menu-item: var(--light-color-active-menu-item); + --color-text: var(--light-color-text); + --color-contrast-text: var(--light-color-contrast-text); + --color-text-aside: var(--light-color-text-aside); + --color-icon-text: var(--light-color-icon-text); + + --color-comment-tag-text: var(--light-color-text); + --color-comment-tag: var(--light-color-background); + + --color-link: var(--light-color-link); + --color-focus-outline: var(--light-color-focus-outline); + + --color-ts-keyword: var(--light-color-ts-keyword); + --color-ts-project: var(--light-color-ts-project); + --color-ts-module: var(--light-color-ts-module); + --color-ts-namespace: var(--light-color-ts-namespace); + --color-ts-enum: var(--light-color-ts-enum); + --color-ts-enum-member: var(--light-color-ts-enum-member); + --color-ts-variable: var(--light-color-ts-variable); + --color-ts-function: var(--light-color-ts-function); + --color-ts-class: var(--light-color-ts-class); + --color-ts-interface: var(--light-color-ts-interface); + --color-ts-constructor: var(--light-color-ts-constructor); + --color-ts-property: var(--light-color-ts-property); + --color-ts-method: var(--light-color-ts-method); + --color-ts-reference: var(--light-color-ts-reference); + --color-ts-call-signature: var(--light-color-ts-call-signature); + --color-ts-index-signature: var(--light-color-ts-index-signature); + --color-ts-constructor-signature: var( + --light-color-ts-constructor-signature + ); + --color-ts-parameter: var(--light-color-ts-parameter); + --color-ts-type-parameter: var(--light-color-ts-type-parameter); + --color-ts-accessor: var(--light-color-ts-accessor); + --color-ts-get-signature: var(--light-color-ts-get-signature); + --color-ts-set-signature: var(--light-color-ts-set-signature); + --color-ts-type-alias: var(--light-color-ts-type-alias); + --color-document: var(--light-color-document); + + --color-note: var(--light-color-note); + --color-tip: var(--light-color-tip); + --color-important: var(--light-color-important); + --color-warning: var(--light-color-warning); + --color-caution: var(--light-color-caution); + + --external-icon: var(--light-external-icon); + --color-scheme: var(--light-color-scheme); + } + + :root[data-theme="dark"] { + --color-background: var(--dark-color-background); + --color-background-secondary: var(--dark-color-background-secondary); + --color-background-active: var(--dark-color-background-active); + --color-background-warning: var(--dark-color-background-warning); + --color-warning-text: var(--dark-color-warning-text); + --color-icon-background: var(--dark-color-icon-background); + --color-accent: var(--dark-color-accent); + --color-active-menu-item: var(--dark-color-active-menu-item); + --color-text: var(--dark-color-text); + --color-contrast-text: var(--dark-color-contrast-text); + --color-text-aside: var(--dark-color-text-aside); + --color-icon-text: var(--dark-color-icon-text); + + --color-comment-tag-text: var(--dark-color-text); + --color-comment-tag: var(--dark-color-background); + + --color-link: var(--dark-color-link); + --color-focus-outline: var(--dark-color-focus-outline); + + --color-ts-keyword: var(--dark-color-ts-keyword); + --color-ts-project: var(--dark-color-ts-project); + --color-ts-module: var(--dark-color-ts-module); + --color-ts-namespace: var(--dark-color-ts-namespace); + --color-ts-enum: var(--dark-color-ts-enum); + --color-ts-enum-member: var(--dark-color-ts-enum-member); + --color-ts-variable: var(--dark-color-ts-variable); + --color-ts-function: var(--dark-color-ts-function); + --color-ts-class: var(--dark-color-ts-class); + --color-ts-interface: var(--dark-color-ts-interface); + --color-ts-constructor: var(--dark-color-ts-constructor); + --color-ts-property: var(--dark-color-ts-property); + --color-ts-method: var(--dark-color-ts-method); + --color-ts-reference: var(--dark-color-ts-reference); + --color-ts-call-signature: var(--dark-color-ts-call-signature); + --color-ts-index-signature: var(--dark-color-ts-index-signature); + --color-ts-constructor-signature: var( + --dark-color-ts-constructor-signature + ); + --color-ts-parameter: var(--dark-color-ts-parameter); + --color-ts-type-parameter: var(--dark-color-ts-type-parameter); + --color-ts-accessor: var(--dark-color-ts-accessor); + --color-ts-get-signature: var(--dark-color-ts-get-signature); + --color-ts-set-signature: var(--dark-color-ts-set-signature); + --color-ts-type-alias: var(--dark-color-ts-type-alias); + --color-document: var(--dark-color-document); + + --color-note: var(--dark-color-note); + --color-tip: var(--dark-color-tip); + --color-important: var(--dark-color-important); + --color-warning: var(--dark-color-warning); + --color-caution: var(--dark-color-caution); + + --external-icon: var(--dark-external-icon); + --color-scheme: var(--dark-color-scheme); + } + + html { + color-scheme: var(--color-scheme); + @media (prefers-reduced-motion: no-preference) { + scroll-behavior: smooth; + } + } + + *:focus-visible, + .tsd-accordion-summary:focus-visible svg { + outline: 2px solid var(--color-focus-outline); + } + + .always-visible, + .always-visible .tsd-signatures { + display: inherit !important; + } + + h1, + h2, + h3, + h4, + h5, + h6 { + line-height: 1.2; + } + + h1 { + font-size: 1.875rem; + margin: 0.67rem 0; + } + + h2 { + font-size: 1.5rem; + margin: 0.83rem 0; + } + + h3 { + font-size: 1.25rem; + margin: 1rem 0; + } + + h4 { + font-size: 1.05rem; + margin: 1.33rem 0; + } + + h5 { + font-size: 1rem; + margin: 1.5rem 0; + } + + h6 { + font-size: 0.875rem; + margin: 2.33rem 0; + } + + dl, + menu, + ol, + ul { + margin: 1em 0; + } + + dd { + margin: 0 0 0 34px; + } + + .container { + max-width: 1700px; + padding: 0 2rem; + } + + /* Footer */ + footer { + border-top: 1px solid var(--color-accent); + padding-top: 1rem; + padding-bottom: 1rem; + max-height: var(--dim-footer-height); + } + footer > p { + margin: 0 1em; + } + + .container-main { + margin: var(--dim-container-main-margin-y) auto; + /* toolbar, footer, margin */ + min-height: calc( + 100svh - var(--dim-header-height) - var(--dim-footer-height) - + 2 * var(--dim-container-main-margin-y) + ); + } + + @keyframes fade-in { + from { + opacity: 0; + } + to { + opacity: 1; + } + } + @keyframes fade-out { + from { + opacity: 1; + visibility: visible; + } + to { + opacity: 0; + } + } + @keyframes pop-in-from-right { + from { + transform: translate(100%, 0); + } + to { + transform: translate(0, 0); + } + } + @keyframes pop-out-to-right { + from { + transform: translate(0, 0); + visibility: visible; + } + to { + transform: translate(100%, 0); + } + } + body { + background: var(--color-background); + font-family: + -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", + Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; + font-size: 16px; + color: var(--color-text); + margin: 0; + } + + a { + color: var(--color-link); + text-decoration: none; + } + a:hover { + text-decoration: underline; + } + a.external[target="_blank"] { + background-image: var(--external-icon); + background-position: top 3px right; + background-repeat: no-repeat; + padding-right: 13px; + } + a.tsd-anchor-link { + color: var(--color-text); + } + :target { + scroll-margin-block: calc(var(--dim-header-height) + 0.5rem); + } + + code, + pre { + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + padding: 0.2em; + margin: 0; + font-size: 0.875rem; + border-radius: 0.8em; + } + + pre { + position: relative; + white-space: pre-wrap; + word-wrap: break-word; + padding: 10px; + border: 1px solid var(--color-accent); + margin-bottom: 8px; + } + pre code { + padding: 0; + font-size: 100%; + } + pre > button { + position: absolute; + top: 10px; + right: 10px; + opacity: 0; + transition: opacity 0.1s; + box-sizing: border-box; + } + pre:hover > button, + pre > button.visible, + pre > button:focus-visible { + opacity: 1; + } + + blockquote { + margin: 1em 0; + padding-left: 1em; + border-left: 4px solid gray; + } + + img { + max-width: 100%; + } + + * { + scrollbar-width: thin; + scrollbar-color: var(--color-accent) var(--color-icon-background); + } + + *::-webkit-scrollbar { + width: 0.75rem; + } + + *::-webkit-scrollbar-track { + background: var(--color-icon-background); + } + + *::-webkit-scrollbar-thumb { + background-color: var(--color-accent); + border-radius: 999rem; + border: 0.25rem solid var(--color-icon-background); + } + + dialog { + border: none; + outline: none; + padding: 0; + background-color: var(--color-background); + } + dialog::backdrop { + display: none; + } + #tsd-overlay { + background-color: rgba(0, 0, 0, 0.5); + position: fixed; + z-index: 9999; + top: 0; + left: 0; + right: 0; + bottom: 0; + animation: fade-in var(--modal-animation-duration) forwards; + } + #tsd-overlay.closing { + animation-name: fade-out; + } + + .tsd-typography { + line-height: 1.333em; + } + .tsd-typography ul { + list-style: square; + padding: 0 0 0 20px; + margin: 0; + } + .tsd-typography .tsd-index-panel h3, + .tsd-index-panel .tsd-typography h3, + .tsd-typography h4, + .tsd-typography h5, + .tsd-typography h6 { + font-size: 1em; + } + .tsd-typography h5, + .tsd-typography h6 { + font-weight: normal; + } + .tsd-typography p, + .tsd-typography ul, + .tsd-typography ol { + margin: 1em 0; + } + .tsd-typography table { + border-collapse: collapse; + border: none; + } + .tsd-typography td, + .tsd-typography th { + padding: 6px 13px; + border: 1px solid var(--color-accent); + } + .tsd-typography thead, + .tsd-typography tr:nth-child(even) { + background-color: var(--color-background-secondary); + } + + .tsd-alert { + padding: 8px 16px; + margin-bottom: 16px; + border-left: 0.25em solid var(--alert-color); + } + .tsd-alert blockquote > :last-child, + .tsd-alert > :last-child { + margin-bottom: 0; + } + .tsd-alert-title { + color: var(--alert-color); + display: inline-flex; + align-items: center; + } + .tsd-alert-title span { + margin-left: 4px; + } + + .tsd-alert-note { + --alert-color: var(--color-alert-note); + } + .tsd-alert-tip { + --alert-color: var(--color-alert-tip); + } + .tsd-alert-important { + --alert-color: var(--color-alert-important); + } + .tsd-alert-warning { + --alert-color: var(--color-alert-warning); + } + .tsd-alert-caution { + --alert-color: var(--color-alert-caution); + } + + .tsd-breadcrumb { + margin: 0; + margin-top: 1rem; + padding: 0; + color: var(--color-text-aside); + } + .tsd-breadcrumb a { + color: var(--color-text-aside); + text-decoration: none; + } + .tsd-breadcrumb a:hover { + text-decoration: underline; + } + .tsd-breadcrumb li { + display: inline; + } + .tsd-breadcrumb li:after { + content: " / "; + } + + .tsd-comment-tags { + display: flex; + flex-direction: column; + } + dl.tsd-comment-tag-group { + display: flex; + align-items: center; + overflow: hidden; + margin: 0.5em 0; + } + dl.tsd-comment-tag-group dt { + display: flex; + margin-right: 0.5em; + font-size: 0.875em; + font-weight: normal; + } + dl.tsd-comment-tag-group dd { + margin: 0; + } + code.tsd-tag { + padding: 0.25em 0.4em; + border: 0.1em solid var(--color-accent); + margin-right: 0.25em; + font-size: 70%; + } + h1 code.tsd-tag:first-of-type { + margin-left: 0.25em; + } + + dl.tsd-comment-tag-group dd:before, + dl.tsd-comment-tag-group dd:after { + content: " "; + } + dl.tsd-comment-tag-group dd pre, + dl.tsd-comment-tag-group dd:after { + clear: both; + } + dl.tsd-comment-tag-group p { + margin: 0; + } + + .tsd-panel.tsd-comment .lead { + font-size: 1.1em; + line-height: 1.333em; + margin-bottom: 2em; + } + .tsd-panel.tsd-comment .lead:last-child { + margin-bottom: 0; + } + + .tsd-filter-visibility h4 { + font-size: 1rem; + padding-top: 0.75rem; + padding-bottom: 0.5rem; + margin: 0; + } + .tsd-filter-item:not(:last-child) { + margin-bottom: 0.5rem; + } + .tsd-filter-input { + display: flex; + width: -moz-fit-content; + width: fit-content; + align-items: center; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + cursor: pointer; + } + .tsd-filter-input input[type="checkbox"] { + cursor: pointer; + position: absolute; + width: 1.5em; + height: 1.5em; + opacity: 0; + } + .tsd-filter-input input[type="checkbox"]:disabled { + pointer-events: none; + } + .tsd-filter-input svg { + cursor: pointer; + width: 1.5em; + height: 1.5em; + margin-right: 0.5em; + border-radius: 0.33em; + /* Leaving this at full opacity breaks event listeners on Firefox. + Don't remove unless you know what you're doing. */ + opacity: 0.99; + } + .tsd-filter-input input[type="checkbox"]:focus-visible + svg { + outline: 2px solid var(--color-focus-outline); + } + .tsd-checkbox-background { + fill: var(--color-accent); + } + input[type="checkbox"]:checked ~ svg .tsd-checkbox-checkmark { + stroke: var(--color-text); + } + .tsd-filter-input input:disabled ~ svg > .tsd-checkbox-background { + fill: var(--color-background); + stroke: var(--color-accent); + stroke-width: 0.25rem; + } + .tsd-filter-input input:disabled ~ svg > .tsd-checkbox-checkmark { + stroke: var(--color-accent); + } + + .settings-label { + font-weight: bold; + text-transform: uppercase; + display: inline-block; + } + + .tsd-filter-visibility .settings-label { + margin: 0.75rem 0 0.5rem 0; + } + + .tsd-theme-toggle .settings-label { + margin: 0.75rem 0.75rem 0 0; + } + + .tsd-hierarchy h4 label:hover span { + text-decoration: underline; + } + + .tsd-hierarchy { + list-style: square; + margin: 0; + } + .tsd-hierarchy-target { + font-weight: bold; + } + .tsd-hierarchy-toggle { + color: var(--color-link); + cursor: pointer; + } + + .tsd-full-hierarchy:not(:last-child) { + margin-bottom: 1em; + padding-bottom: 1em; + border-bottom: 1px solid var(--color-accent); + } + .tsd-full-hierarchy, + .tsd-full-hierarchy ul { + list-style: none; + margin: 0; + padding: 0; + } + .tsd-full-hierarchy ul { + padding-left: 1.5rem; + } + .tsd-full-hierarchy a { + padding: 0.25rem 0 !important; + font-size: 1rem; + display: inline-flex; + align-items: center; + color: var(--color-text); + } + .tsd-full-hierarchy svg[data-dropdown] { + cursor: pointer; + } + .tsd-full-hierarchy svg[data-dropdown="false"] { + transform: rotate(-90deg); + } + .tsd-full-hierarchy svg[data-dropdown="false"] ~ ul { + display: none; + } + + .tsd-panel-group.tsd-index-group { + margin-bottom: 0; + } + .tsd-index-panel .tsd-index-list { + list-style: none; + line-height: 1.333em; + margin: 0; + padding: 0.25rem 0 0 0; + overflow: hidden; + display: grid; + grid-template-columns: repeat(3, 1fr); + column-gap: 1rem; + grid-template-rows: auto; + } + @media (max-width: 1024px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(2, 1fr); + } + } + @media (max-width: 768px) { + .tsd-index-panel .tsd-index-list { + grid-template-columns: repeat(1, 1fr); + } + } + .tsd-index-panel .tsd-index-list li { + -webkit-page-break-inside: avoid; + -moz-page-break-inside: avoid; + -ms-page-break-inside: avoid; + -o-page-break-inside: avoid; + page-break-inside: avoid; + } + + .tsd-flag { + display: inline-block; + padding: 0.25em 0.4em; + border-radius: 4px; + color: var(--color-comment-tag-text); + background-color: var(--color-comment-tag); + text-indent: 0; + font-size: 75%; + line-height: 1; + font-weight: normal; + } + + .tsd-anchor { + position: relative; + top: -100px; + } + + .tsd-member { + position: relative; + } + .tsd-member .tsd-anchor + h3 { + display: flex; + align-items: center; + margin-top: 0; + margin-bottom: 0; + border-bottom: none; + } + + .tsd-navigation.settings { + margin: 0; + margin-bottom: 1rem; + } + .tsd-navigation > a, + .tsd-navigation .tsd-accordion-summary { + width: calc(100% - 0.25rem); + display: flex; + align-items: center; + } + .tsd-navigation a, + .tsd-navigation summary > span, + .tsd-page-navigation a { + display: flex; + width: calc(100% - 0.25rem); + align-items: center; + padding: 0.25rem; + color: var(--color-text); + text-decoration: none; + box-sizing: border-box; + } + .tsd-navigation a.current, + .tsd-page-navigation a.current { + background: var(--color-active-menu-item); + color: var(--color-contrast-text); + } + .tsd-navigation a:hover, + .tsd-page-navigation a:hover { + text-decoration: underline; + } + .tsd-navigation ul, + .tsd-page-navigation ul { + margin-top: 0; + margin-bottom: 0; + padding: 0; + list-style: none; + } + .tsd-navigation li, + .tsd-page-navigation li { + padding: 0; + max-width: 100%; + } + .tsd-navigation .tsd-nav-link { + display: none; + } + .tsd-nested-navigation { + margin-left: 3rem; + } + .tsd-nested-navigation > li > details { + margin-left: -1.5rem; + } + .tsd-small-nested-navigation { + margin-left: 1.5rem; + } + .tsd-small-nested-navigation > li > details { + margin-left: -1.5rem; + } + + .tsd-page-navigation-section > summary { + padding: 0.25rem; + } + .tsd-page-navigation-section > summary > svg { + margin-right: 0.25rem; + } + .tsd-page-navigation-section > div { + margin-left: 30px; + } + .tsd-page-navigation ul { + padding-left: 1.75rem; + } + + #tsd-sidebar-links a { + margin-top: 0; + margin-bottom: 0.5rem; + line-height: 1.25rem; + } + #tsd-sidebar-links a:last-of-type { + margin-bottom: 0; + } + + a.tsd-index-link { + padding: 0.25rem 0 !important; + font-size: 1rem; + line-height: 1.25rem; + display: inline-flex; + align-items: center; + color: var(--color-text); + } + .tsd-accordion-summary { + list-style-type: none; /* hide marker on non-safari */ + outline: none; /* broken on safari, so just hide it */ + display: flex; + align-items: center; + gap: 0.25rem; + box-sizing: border-box; + } + .tsd-accordion-summary::-webkit-details-marker { + display: none; /* hide marker on safari */ + } + .tsd-accordion-summary, + .tsd-accordion-summary a { + -moz-user-select: none; + -webkit-user-select: none; + -ms-user-select: none; + user-select: none; + + cursor: pointer; + } + .tsd-accordion-summary a { + width: calc(100% - 1.5rem); + } + .tsd-accordion-summary > * { + margin-top: 0; + margin-bottom: 0; + padding-top: 0; + padding-bottom: 0; + } + /* + * We need to be careful to target the arrow indicating whether the accordion + * is open, but not any other SVGs included in the details element. + */ + .tsd-accordion:not([open]) > .tsd-accordion-summary > svg:first-child { + transform: rotate(-90deg); + } + .tsd-index-content > :not(:first-child) { + margin-top: 0.75rem; + } + .tsd-index-summary { + margin-top: 1.5rem; + margin-bottom: 0.75rem; + display: flex; + align-content: center; + } + + .tsd-no-select { + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + } + .tsd-kind-icon { + margin-right: 0.5rem; + width: 1.25rem; + height: 1.25rem; + min-width: 1.25rem; + min-height: 1.25rem; + } + .tsd-signature > .tsd-kind-icon { + margin-right: 0.8rem; + } + + .tsd-panel { + margin-bottom: 2.5rem; + } + .tsd-panel.tsd-member { + margin-bottom: 4rem; + } + .tsd-panel:empty { + display: none; + } + .tsd-panel > h1, + .tsd-panel > h2, + .tsd-panel > h3 { + margin: 1.5rem -1.5rem 0.75rem -1.5rem; + padding: 0 1.5rem 0.75rem 1.5rem; + } + .tsd-panel > h1.tsd-before-signature, + .tsd-panel > h2.tsd-before-signature, + .tsd-panel > h3.tsd-before-signature { + margin-bottom: 0; + border-bottom: none; + } + + .tsd-panel-group { + margin: 2rem 0; + } + .tsd-panel-group.tsd-index-group { + margin: 2rem 0; + } + .tsd-panel-group.tsd-index-group details { + margin: 2rem 0; + } + .tsd-panel-group > .tsd-accordion-summary { + margin-bottom: 1rem; + } + + #tsd-search[open] { + animation: fade-in var(--modal-animation-duration) ease-out forwards; + } + #tsd-search[open].closing { + animation-name: fade-out; + } + + /* Avoid setting `display` on closed dialog */ + #tsd-search[open] { + display: flex; + flex-direction: column; + padding: 1rem; + width: 32rem; + max-width: 90vw; + max-height: calc(100vh - env(keyboard-inset-height, 0px) - 25vh); + /* Anchor dialog to top */ + margin-top: 10vh; + border-radius: 6px; + will-change: max-height; + } + #tsd-search-input { + box-sizing: border-box; + width: 100%; + padding: 0 0.625rem; /* 10px */ + outline: 0; + border: 2px solid var(--color-accent); + background-color: transparent; + color: var(--color-text); + border-radius: 4px; + height: 2.5rem; + flex: 0 0 auto; + font-size: 0.875rem; + transition: border-color 0.2s, background-color 0.2s; + } + #tsd-search-input:focus-visible { + background-color: var(--color-background-active); + border-color: transparent; + color: var(--color-contrast-text); + } + #tsd-search-input::placeholder { + color: inherit; + opacity: 0.8; + } + #tsd-search-results { + margin: 0; + padding: 0; + list-style: none; + flex: 1 1 auto; + display: flex; + flex-direction: column; + overflow-y: auto; + } + #tsd-search-results:not(:empty) { + margin-top: 0.5rem; + } + #tsd-search-results > li { + background-color: var(--color-background); + line-height: 1.5; + box-sizing: border-box; + border-radius: 4px; + } + #tsd-search-results > li:nth-child(even) { + background-color: var(--color-background-secondary); + } + #tsd-search-results > li:is(:hover, [aria-selected="true"]) { + background-color: var(--color-background-active); + color: var(--color-contrast-text); + } + /* It's important that this takes full size of parent `li`, to capture a click on `li` */ + #tsd-search-results > li > a { + display: flex; + align-items: center; + padding: 0.5rem 0.25rem; + box-sizing: border-box; + width: 100%; + } + #tsd-search-results > li > a > .text { + flex: 1 1 auto; + min-width: 0; + overflow-wrap: anywhere; + } + #tsd-search-results > li > a .parent { + color: var(--color-text-aside); + } + #tsd-search-results > li > a mark { + color: inherit; + background-color: inherit; + font-weight: bold; + } + #tsd-search-status { + flex: 1; + display: grid; + place-content: center; + text-align: center; + overflow-wrap: anywhere; + } + #tsd-search-status:not(:empty) { + min-height: 6rem; + } + + .tsd-signature { + margin: 0 0 1rem 0; + padding: 1rem 0.5rem; + border: 1px solid var(--color-accent); + font-family: Menlo, Monaco, Consolas, "Courier New", monospace; + font-size: 14px; + overflow-x: auto; + } + + .tsd-signature-keyword { + color: var(--color-ts-keyword); + font-weight: normal; + } + + .tsd-signature-symbol { + color: var(--color-text-aside); + font-weight: normal; + } + + .tsd-signature-type { + font-style: italic; + font-weight: normal; + } + + .tsd-signatures { + padding: 0; + margin: 0 0 1em 0; + list-style-type: none; + } + .tsd-signatures .tsd-signature { + margin: 0; + border-color: var(--color-accent); + border-width: 1px 0; + transition: background-color 0.1s; + } + .tsd-signatures .tsd-index-signature:not(:last-child) { + margin-bottom: 1em; + } + .tsd-signatures .tsd-index-signature .tsd-signature { + border-width: 1px; + } + .tsd-description .tsd-signatures .tsd-signature { + border-width: 1px; + } + + ul.tsd-parameter-list, + ul.tsd-type-parameter-list { + list-style: square; + margin: 0; + padding-left: 20px; + } + ul.tsd-parameter-list > li.tsd-parameter-signature, + ul.tsd-type-parameter-list > li.tsd-parameter-signature { + list-style: none; + margin-left: -20px; + } + ul.tsd-parameter-list h5, + ul.tsd-type-parameter-list h5 { + font-size: 16px; + margin: 1em 0 0.5em 0; + } + .tsd-sources { + margin-top: 1rem; + font-size: 0.875em; + } + .tsd-sources a { + color: var(--color-text-aside); + text-decoration: underline; + } + .tsd-sources ul { + list-style: none; + padding: 0; + } + + .tsd-page-toolbar { + position: sticky; + z-index: 1; + top: 0; + left: 0; + width: 100%; + color: var(--color-text); + background: var(--color-background-secondary); + border-bottom: var(--dim-toolbar-border-bottom-width) + var(--color-accent) solid; + transition: transform 0.3s ease-in-out; + } + .tsd-page-toolbar a { + color: var(--color-text); + } + .tsd-toolbar-contents { + display: flex; + align-items: center; + height: var(--dim-toolbar-contents-height); + margin: 0 auto; + } + .tsd-toolbar-contents > .title { + font-weight: bold; + margin-right: auto; + } + #tsd-toolbar-links { + display: flex; + align-items: center; + gap: 1.5rem; + margin-right: 1rem; + } + + .tsd-widget { + box-sizing: border-box; + display: inline-block; + opacity: 0.8; + height: 2.5rem; + width: 2.5rem; + transition: opacity 0.1s, background-color 0.1s; + text-align: center; + cursor: pointer; + border: none; + background-color: transparent; + } + .tsd-widget:hover { + opacity: 0.9; + } + .tsd-widget:active { + opacity: 1; + background-color: var(--color-accent); + } + #tsd-toolbar-menu-trigger { + display: none; + } + + .tsd-member-summary-name { + display: inline-flex; + align-items: center; + padding: 0.25rem; + text-decoration: none; + } + + .tsd-anchor-icon { + display: inline-flex; + align-items: center; + margin-left: 0.5rem; + color: var(--color-text); + vertical-align: middle; + } + + .tsd-anchor-icon svg { + width: 1em; + height: 1em; + visibility: hidden; + } + + .tsd-member-summary-name:hover > .tsd-anchor-icon svg, + .tsd-anchor-link:hover > .tsd-anchor-icon svg, + .tsd-anchor-icon:focus-visible svg { + visibility: visible; + } + + .deprecated { + text-decoration: line-through !important; + } + + .warning { + padding: 1rem; + color: var(--color-warning-text); + background: var(--color-background-warning); + } + + .tsd-kind-project { + color: var(--color-ts-project); + } + .tsd-kind-module { + color: var(--color-ts-module); + } + .tsd-kind-namespace { + color: var(--color-ts-namespace); + } + .tsd-kind-enum { + color: var(--color-ts-enum); + } + .tsd-kind-enum-member { + color: var(--color-ts-enum-member); + } + .tsd-kind-variable { + color: var(--color-ts-variable); + } + .tsd-kind-function { + color: var(--color-ts-function); + } + .tsd-kind-class { + color: var(--color-ts-class); + } + .tsd-kind-interface { + color: var(--color-ts-interface); + } + .tsd-kind-constructor { + color: var(--color-ts-constructor); + } + .tsd-kind-property { + color: var(--color-ts-property); + } + .tsd-kind-method { + color: var(--color-ts-method); + } + .tsd-kind-reference { + color: var(--color-ts-reference); + } + .tsd-kind-call-signature { + color: var(--color-ts-call-signature); + } + .tsd-kind-index-signature { + color: var(--color-ts-index-signature); + } + .tsd-kind-constructor-signature { + color: var(--color-ts-constructor-signature); + } + .tsd-kind-parameter { + color: var(--color-ts-parameter); + } + .tsd-kind-type-parameter { + color: var(--color-ts-type-parameter); + } + .tsd-kind-accessor { + color: var(--color-ts-accessor); + } + .tsd-kind-get-signature { + color: var(--color-ts-get-signature); + } + .tsd-kind-set-signature { + color: var(--color-ts-set-signature); + } + .tsd-kind-type-alias { + color: var(--color-ts-type-alias); + } + + /* if we have a kind icon, don't color the text by kind */ + .tsd-kind-icon ~ span { + color: var(--color-text); + } + + /* mobile */ + @media (max-width: 769px) { + #tsd-toolbar-menu-trigger { + display: inline-block; + /* temporary fix to vertically align, for compatibility */ + line-height: 2.5; + } + #tsd-toolbar-links { + display: none; + } + + .container-main { + display: flex; + } + .col-content { + float: none; + max-width: 100%; + width: 100%; + } + .col-sidebar { + position: fixed !important; + overflow-y: auto; + -webkit-overflow-scrolling: touch; + z-index: 1024; + top: 0 !important; + bottom: 0 !important; + left: auto !important; + right: 0 !important; + padding: 1.5rem 1.5rem 0 0; + width: 75vw; + visibility: hidden; + background-color: var(--color-background); + transform: translate(100%, 0); + } + .col-sidebar > *:last-child { + padding-bottom: 20px; + } + .overlay { + content: ""; + display: block; + position: fixed; + z-index: 1023; + top: 0; + left: 0; + right: 0; + bottom: 0; + background-color: rgba(0, 0, 0, 0.75); + visibility: hidden; + } + + .to-has-menu .overlay { + animation: fade-in 0.4s; + } + + .to-has-menu .col-sidebar { + animation: pop-in-from-right 0.4s; + } + + .from-has-menu .overlay { + animation: fade-out 0.4s; + } + + .from-has-menu .col-sidebar { + animation: pop-out-to-right 0.4s; + } + + .has-menu body { + overflow: hidden; + } + .has-menu .overlay { + visibility: visible; + } + .has-menu .col-sidebar { + visibility: visible; + transform: translate(0, 0); + display: flex; + flex-direction: column; + gap: 1.5rem; + max-height: 100vh; + padding: 1rem 2rem; + } + .has-menu .tsd-navigation { + max-height: 100%; + } + .tsd-navigation .tsd-nav-link { + display: flex; + } + } + + /* one sidebar */ + @media (min-width: 770px) { + .container-main { + display: grid; + grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); + grid-template-areas: "sidebar content"; + --dim-container-main-margin-y: 2rem; + } + + .tsd-breadcrumb { + margin-top: 0; + } + + .col-sidebar { + grid-area: sidebar; + } + .col-content { + grid-area: content; + padding: 0 1rem; + } + } + @media (min-width: 770px) and (max-width: 1399px) { + .col-sidebar { + max-height: calc( + 100vh - var(--dim-header-height) - var(--dim-footer-height) - + 2 * var(--dim-container-main-margin-y) + ); + overflow: auto; + position: sticky; + top: calc( + var(--dim-header-height) + var(--dim-container-main-margin-y) + ); + } + .site-menu { + margin-top: 1rem; + } + } + + /* two sidebars */ + @media (min-width: 1200px) { + .container-main { + grid-template-columns: + minmax(0, 1fr) minmax(0, 2.5fr) minmax( + 0, + 20rem + ); + grid-template-areas: "sidebar content toc"; + } + + .col-sidebar { + display: contents; + } + + .page-menu { + grid-area: toc; + padding-left: 1rem; + } + .site-menu { + grid-area: sidebar; + } + + .site-menu { + margin-top: 0rem; + } + + .page-menu, + .site-menu { + max-height: calc( + 100vh - var(--dim-header-height) - var(--dim-footer-height) - + 2 * var(--dim-container-main-margin-y) + ); + overflow: auto; + position: sticky; + top: calc( + var(--dim-header-height) + var(--dim-container-main-margin-y) + ); + } + } +} diff --git a/docs/classes/Context.html b/docs/classes/Context.html new file mode 100644 index 0000000..63684fb --- /dev/null +++ b/docs/classes/Context.html @@ -0,0 +1,71 @@ +Context | @tryforge/forge.minecraft
@tryforge/forge.minecraft
    Preparing search index...

    Class Context

    Hierarchy

    • Context
      • Context

    Indexable

    • [props: string | number | symbol]: unknown
    Index

    Constructors

    Properties

    automodRule: Partial<IAutomodRuleOptions>
    calendar?: CalendarType
    component: Partial<IComponentOptions>
    container: Container
    executionTimestamp: number
    http: Partial<IHttpOptions>
    localFunctions: Map<string, ILocalFunctionData>
    timezone: string

    Accessors

    • get args(): string[]

      Returns string[]

    • get automod(): AutoModerationActionExecution | null

      Returns AutoModerationActionExecution | null

    • get channel(): | CategoryChannel
      | NewsChannel
      | StageChannel
      | TextChannel
      | PrivateThreadChannel
      | VoiceChannel
      | ForumChannel
      | MediaChannel
      | BaseChannel
      | PublicThreadChannel<boolean>
      | null

      Returns
          | CategoryChannel
          | NewsChannel
          | StageChannel
          | TextChannel
          | PrivateThreadChannel
          | VoiceChannel
          | ForumChannel
          | MediaChannel
          | BaseChannel
          | PublicThreadChannel<boolean>
          | null

    • get client(): ForgeClient

      Returns ForgeClient

    • get cmd(): BaseCommand<unknown> | null

      Returns BaseCommand<unknown> | null

    • get emoji(): Emoji | null

      Returns Emoji | null

    • get entitlement(): Entitlement | null

      Returns Entitlement | null

    • get gameRule(): TypedGameRule<GameRuleType> | null

      Returns TypedGameRule<GameRuleType> | null

    • get getExtension(): {
          <B extends boolean>(
              name: string,
              required?: B,
          ): B extends true ? ForgeExtension : ForgeExtension | null;
          <T extends ClassType, B_1 extends boolean>(
              type: string | T,
              required?: B_1,
          ): B_1 extends true ? ClassInstance<T> : ClassInstance<T> | null;
      }

      Returns {
          <B extends boolean>(
              name: string,
              required?: B,
          ): B extends true ? ForgeExtension : ForgeExtension | null;
          <T extends ClassType, B_1 extends boolean>(
              type: string | T,
              required?: B_1,
          ): B_1 extends true ? ClassInstance<T> : ClassInstance<T> | null;
      }

    • get guild(): Guild | null

      Returns Guild | null

    • get interaction(): Interaction | null

      Returns Interaction | null

    • get member(): GuildMember | null

      Returns GuildMember | null

    • get message(): Message<any> | null

      Returns Message<any> | null

    • get reaction(): MessageReaction | null

      Returns MessageReaction | null

    • get reason(): string | undefined

      Returns string | undefined

    • set reason(str: string | undefined): void

      Parameters

      • str: string | undefined

      Returns void

    • get role(): Role | null

      Returns Role | null

    • get sound(): SoundboardSound | null

      Returns SoundboardSound | null

    • get states(): States | undefined

      Returns States | undefined

    • get sticker(): Sticker | null

      Returns Sticker | null

    • get subscription(): Subscription | null

      Returns Subscription | null

    • get user(): User | null

      Returns User | null

    Methods

    • Parameters

      • content: string

      Returns Promise<unknown>

    • Returns void

    • Returns void

    • Returns void

    • Returns void

    • Clones keywords and environment vars

      +

      Parameters

      • Optionalprops: Partial<IRunnable>
      • OptionalsyncVars: boolean

      Returns Context

    • Returns Context

    • Returns IRunnable

    • Parameters

      • name: string

      Returns boolean

    • Parameters

      • name: string

      Returns boolean

    • Fetches all emojis of the application.

      +

      Parameters

      • Optionalonce: boolean

        Whether to fetch only when the collection is empty.

        +

      Returns Promise<void | Collection<string, ApplicationEmoji>>

    • Type Parameters

      • T

      Parameters

      • key: PropertyKey

      Returns T

    • Type Parameters

      • T extends ClassType

      Parameters

      • type: T
      • ...keys: string[]

      Returns ClassInstance<T> | null

    • Parameters

      • ...args: string[]

      Returns object | undefined

    • Type Parameters

      • K extends string
      • T extends ClassType

      Parameters

      • key: K
      • type: T

      Returns (Context & { [P in "bro" as K]: ClassInstance<T> })[K] | null

    • Parameters

      • name: string

      Returns unknown

    • Type Parameters

      • Args extends IArg<ArgType, boolean, boolean, EnumLike<any>>[]
      • Unwrap extends boolean

      Parameters

      Returns Promise<Return<ReturnType>>

    • Parameters

      • fn: CompiledFunction
      • rt: Return

      Returns boolean

    • Returns boolean | undefined

    • Type Parameters

      • K extends string
      • V extends ClassType

      Parameters

      • key: K
      • type: V

      Returns this is Context & { [P in "bro" as K]: ClassInstance<V> }

    • Parameters

      • name: string

      Returns boolean

    • Returns this is Context & { get interaction(): ChatInputCommandInteraction }

    • Returns this is Context & { get interaction(): ContextMenuCommandInteraction }

    • Returns this is Context & { get interaction(): AnySelectMenuInteraction }

    • Parameters

      • name: string
      • value: unknown

      Returns unknown

    • Parameters

      • name: string
      • value: unknown

      Returns unknown

    • Parameters

      • value: unknown
      • ...keys: string[]

      Returns boolean

    • Parameters

      • ...keys: string[]

      Returns boolean | any[]

    • Parameters

      • previous: object
      • ...args: string[]

      Returns object | undefined

    diff --git a/docs/classes/ForgeMinecraft.html b/docs/classes/ForgeMinecraft.html new file mode 100644 index 0000000..97ec6e8 --- /dev/null +++ b/docs/classes/ForgeMinecraft.html @@ -0,0 +1,24 @@ +ForgeMinecraft | @tryforge/forge.minecraft
    @tryforge/forge.minecraft
      Preparing search index...

      Class ForgeMinecraft

      Hierarchy

      • ForgeExtension
        • ForgeMinecraft
      Index

      Constructors

      Properties

      description: string = description
      name: string = "forge.minecraft"
      requireExtensions?: string[]

      A list of extension names this extension requires

      +
      server?: MinecraftServer
      targetVersions?: string[]

      Only the versions written here will be allowed

      +
      version: string = version

      Methods

      • Gets the status response of a Bedrock Minecraft server. Uses the bedrock client options if no parameters are provided.

        +

        Parameters

        • Optionalhost: string | null

          The host domain of the server.

          +
        • Optionalport: number

          The port for the host domain.

          +

        Returns Promise<BedrockStatusResponse | null>

      • Returns any

      • Gets the status response of a Java Minecraft server. Uses the java client options if no parameters are provided.

        +

        Parameters

        • Optionalhost: string | null

          The host domain of the server.

          +
        • Optionalport: number

          The port for the host domain.

          +

        Returns Promise<JavaStatusResponse | null>

      • Parameters

        • client: ForgeClient

        Returns Promise<void>

      • Parameters

        • path: string

        Returns void

      • Parameters

        • client: ForgeClient

        Returns void

      diff --git a/docs/classes/MinecraftCommandManager.html b/docs/classes/MinecraftCommandManager.html new file mode 100644 index 0000000..621f2db --- /dev/null +++ b/docs/classes/MinecraftCommandManager.html @@ -0,0 +1,25 @@ +MinecraftCommandManager | @tryforge/forge.minecraft
      @tryforge/forge.minecraft
        Preparing search index...

        Class MinecraftCommandManager

        Hierarchy

        Index

        Constructors

        • Parameters

          • client: ForgeClient

          Returns MinecraftCommandManager

        Properties

        handlerName: string = ForgeMinecraftEventHandlerName
        defaultMaxListeners: number

        Accessors

        • get count(): number

          Returns number

        Methods

        • Parameters

          Returns void

        • Type Parameters

          • U extends "update"

          Parameters

          Returns this

        • Type Parameters

          • U extends "update"

          Parameters

          Returns boolean

        • Type Parameters

          • U extends "update"

          Returns U[]

        • Returns number

        • Parameters

          • type: "update"

          Returns number

        • Type Parameters

          • U extends "update"

          Parameters

          • type: U

          Returns ICommandManagerEvents<keyof IMinecraftEvents>[U][]

        • Parameters

          • path: string

          Returns void

        • Type Parameters

          • U extends "update"

          Parameters

          Returns this

        • Type Parameters

          • U extends "update"

          Parameters

          Returns this

        • Type Parameters

          • U extends "update"

          Parameters

          Returns this

        • Type Parameters

          • U extends "update"

          Parameters

          Returns this

        • Type Parameters

          • U extends "update"

          Parameters

          Returns this

        • Type Parameters

          • U extends "update"

          Parameters

          • type: U

          Returns ICommandManagerEvents<keyof IMinecraftEvents>[U][]

        • Returns void

        • Parameters

          • Optionalevent: "update"

          Returns this

        • Type Parameters

          • U extends "update"

          Parameters

          Returns this

        • Parameters

          • n: number

          Returns this

        • Returns BaseCommand<keyof IMinecraftEvents>[]

        diff --git a/docs/classes/MinecraftConnectionManager.html b/docs/classes/MinecraftConnectionManager.html new file mode 100644 index 0000000..27ba3c8 --- /dev/null +++ b/docs/classes/MinecraftConnectionManager.html @@ -0,0 +1,21 @@ +MinecraftConnectionManager | @tryforge/forge.minecraft
        @tryforge/forge.minecraft
          Preparing search index...

          Class MinecraftConnectionManager

          Hierarchy

          Index

          Constructors

          Properties

          connection?: NodeWebSocketConnection
          server?: MinecraftServer
          defaultMaxListeners: number

          Methods

          • Type Parameters

            Returns U[]

          • Returns number

          • Parameters

            Returns number

          • Parameters

            • Optionalevent: keyof IConnectionEvents

            Returns this

          • Parameters

            • n: number

            Returns this

          diff --git a/docs/classes/MinecraftEventHandler.html b/docs/classes/MinecraftEventHandler.html new file mode 100644 index 0000000..a620258 --- /dev/null +++ b/docs/classes/MinecraftEventHandler.html @@ -0,0 +1,7 @@ +MinecraftEventHandler | @tryforge/forge.minecraft
          @tryforge/forge.minecraft
            Preparing search index...

            Class MinecraftEventHandler<T>

            Type Parameters

            Hierarchy

            Index

            Constructors

            Properties

            Accessors

            Methods

            Constructors

            Properties

            data: IEvent<IMinecraftEvents, T>

            Accessors

            • get description(): string

              Returns string

            • get listener(): (
                  this: ForgeClient,
                  ...args: AssertArgs<Events[T]>,
              ) => void | Promise<void>

              Returns (this: ForgeClient, ...args: AssertArgs<Events[T]>) => void | Promise<void>

            • get name(): T

              Returns T

            Methods

            diff --git a/docs/enums/Difficulty.html b/docs/enums/Difficulty.html new file mode 100644 index 0000000..bf995b2 --- /dev/null +++ b/docs/enums/Difficulty.html @@ -0,0 +1,5 @@ +Difficulty | @tryforge/forge.minecraft
            @tryforge/forge.minecraft
              Preparing search index...

              Enumeration Difficulty

              Index

              Enumeration Members

              Enumeration Members

              Easy: "easy"
              Hard: "hard"
              Normal: "normal"
              Peaceful: "peaceful"
              diff --git a/docs/enums/GameMode.html b/docs/enums/GameMode.html new file mode 100644 index 0000000..1d92dfe --- /dev/null +++ b/docs/enums/GameMode.html @@ -0,0 +1,5 @@ +GameMode | @tryforge/forge.minecraft
              @tryforge/forge.minecraft
                Preparing search index...

                Enumeration GameMode

                Index

                Enumeration Members

                Enumeration Members

                Adventure: "adventure"
                Creative: "creative"
                Spectator: "spectator"
                Survival: "survival"
                diff --git a/docs/enums/GameRuleType.html b/docs/enums/GameRuleType.html new file mode 100644 index 0000000..f707f75 --- /dev/null +++ b/docs/enums/GameRuleType.html @@ -0,0 +1,3 @@ +GameRuleType | @tryforge/forge.minecraft
                @tryforge/forge.minecraft
                  Preparing search index...

                  Enumeration GameRuleType

                  Index

                  Enumeration Members

                  Enumeration Members

                  Boolean: "boolean"
                  Integer: "integer"
                  diff --git a/docs/hierarchy.html b/docs/hierarchy.html new file mode 100644 index 0000000..7796f2a --- /dev/null +++ b/docs/hierarchy.html @@ -0,0 +1 @@ +@tryforge/forge.minecraft
                  @tryforge/forge.minecraft
                    Preparing search index...

                    @tryforge/forge.minecraft

                    Hierarchy Summary

                    diff --git a/docs/index.html b/docs/index.html new file mode 100644 index 0000000..d9edf7d --- /dev/null +++ b/docs/index.html @@ -0,0 +1,59 @@ +@tryforge/forge.minecraft
                    @tryforge/forge.minecraft
                      Preparing search index...

                      @tryforge/forge.minecraft

                      +ForgeMinecraft +

                      ForgeMinecraft

                      ForgeMinecraft is an extension that provides real-time Minecraft server management via the management server protocol, alongside various functions for retrieving status and metadata from Java and Bedrock servers.

                      +

                      @tryforge/forge.minecraft +@tryforge/forgescript +Discord

                      +
                      +
                      +
                        +
                      1. Installation
                      2. +
                      3. Management Server
                      4. +
                      5. Java & Bedrock Servers
                      6. +
                      7. Documentation
                      8. +
                      +

                      Installation


                      +
                        +
                      1. +

                        Run the following command to install the required npm packages:

                        +
                        npm i @tryforge/forge.minecraft
                        +
                        + +
                      2. +
                      3. +

                        Here’s an example of how your main file should look:

                        +
                        const { ForgeClient } = require("@tryforge/forgescript")
                        const { ForgeMinecraft } = require("@tryforge/forge.minecraft")

                        const minecraft = new ForgeMinecraft({
                        java: {
                        host: "0.0.0.0", // Default Java Server
                        port: 25565
                        },
                        bedrock: {
                        host: "0.0.0.0" // Default Bedrock Server
                        }
                        })

                        const client = new ForgeClient({
                        ...options, // The options you currently have
                        extensions: [
                        minecraft
                        ]
                        })

                        client.commands.load("commands")

                        client.login("YourToken") +
                        + +
                        +

                        💡 Tip
                        +View all available client options here.

                        +
                        +
                      4. +
                      +

                      Management Server


                      +

                      Minecraft’s management server protocol, introduced in 1.21.9, enables remote management and monitoring of your Minecraft server. It allows this extension to connect to the server, execute administrative actions, and receive real-time events such as player activity, server status changes, and configuration updates, making automation and server control easier.

                      +

                      To enable the management server protocol, set up management-server-enabled, management-server-port and management-server-host in the server.properties file of your Minecraft server:

                      +
                      management-server-enabled=true
                      management-server-port=25585
                      management-server-host=0.0.0.0
                      management-server-secret= +
                      + +

                      You can either set management-server-secret to a random 40 character long alphanumeric string or leave it empty and let the Minecraft server generate a random token on startup. You will need this token to connect to the server.

                      +

                      If you want to establish connections from a web browser, you need to set the allowed origins:

                      +
                      management-server-allowed-origins=http\://localhost\:63315
                      +
                      + +

                      By default, TLS is enabled, but the server will crash if you don't provide a certificate. If the management server protocol is not exposed to the internet, or you are using a reverse proxy, the easiest option would be to disable TLS:

                      +
                      management-server-tls-enabled=false
                      +
                      + +

                      Next, configure the ForgeMinecraft client. This is where you specify which server events you want to listen to and provide the management server connection details, such as host, port, and authentication token (secret). These options determine how ForgeMinecraft connects to your server and which real-time events the extension receives.

                      +
                      const minecraft = new ForgeMinecraft({
                      events: [
                      "playerJoined",
                      "serverStarted"
                      ],
                      server: {
                      host: "0.0.0.0",
                      port: 3000,
                      token: "YourAuthToken",
                      }
                      })

                      // ...

                      minecraft.commands.load("minecraft") // Load your server events folder

                      // ... +
                      + +
                      +

                      💡 Tip
                      +View all available server options here.

                      +
                      +

                      Java & Bedrock Servers


                      +

                      Desired Java and Bedrock functions let you fetch status and metadata from Minecraft servers on demand. You can call these functions with custom host and port arguments, or define default Java and Bedrock server settings in the client configuration to avoid passing arguments each time. The responses include various details such as server status, version, players, and more. Note that availability depends on the server, as not all servers allow full information to be queried.

                      +
                      diff --git a/docs/interfaces/IBedrockServerOptions.html b/docs/interfaces/IBedrockServerOptions.html new file mode 100644 index 0000000..3f57df4 --- /dev/null +++ b/docs/interfaces/IBedrockServerOptions.html @@ -0,0 +1,8 @@ +IBedrockServerOptions | @tryforge/forge.minecraft
                      @tryforge/forge.minecraft
                        Preparing search index...

                        Interface IBedrockServerOptions

                        interface IBedrockServerOptions {
                            host: string;
                            port?: number;
                        }
                        Index

                        Properties

                        Properties

                        host: string

                        The host domain of the server.

                        +
                        port?: number

                        The port for the host domain.

                        +
                        19132
                        +
                        + +
                        diff --git a/docs/interfaces/IConnectionEvents.html b/docs/interfaces/IConnectionEvents.html new file mode 100644 index 0000000..447132c --- /dev/null +++ b/docs/interfaces/IConnectionEvents.html @@ -0,0 +1,4 @@ +IConnectionEvents | @tryforge/forge.minecraft
                        @tryforge/forge.minecraft
                          Preparing search index...

                          Interface IConnectionEvents

                          interface IConnectionEvents {
                              connected: (server: MinecraftServer) => void;
                              disconnected: () => void;
                              reconnecting: () => void;
                          }
                          Index

                          Properties

                          connected: (server: MinecraftServer) => void
                          disconnected: () => void
                          reconnecting: () => void
                          diff --git a/docs/interfaces/IExtendedContextCache.html b/docs/interfaces/IExtendedContextCache.html new file mode 100644 index 0000000..b3b520a --- /dev/null +++ b/docs/interfaces/IExtendedContextCache.html @@ -0,0 +1,21 @@ +IExtendedContextCache | @tryforge/forge.minecraft
                          @tryforge/forge.minecraft
                            Preparing search index...

                            Interface IExtendedContextCache

                            interface IExtendedContextCache {
                                automod: AutoModerationActionExecution | null;
                                channel: BaseChannel | null;
                                emoji: Emoji | null;
                                entitlement: Entitlement | null;
                                gameRule: TypedGameRule<GameRuleType> | null;
                                guild: Guild | null;
                                interaction: Interaction | null;
                                ipBan: IPBan | null;
                                member: GuildMember | null;
                                message: Message<boolean> | null;
                                operator: Operator | null;
                                player: Player | null;
                                reaction: MessageReaction | null;
                                role: Role | null;
                                serverState: ServerState | null;
                                sound: SoundboardSound | null;
                                sticker: Sticker | null;
                                subscription: Subscription | null;
                                user: User | null;
                                userBan: UserBan | null;
                            }

                            Hierarchy

                            • IContextCache
                              • IExtendedContextCache
                            Index

                            Properties

                            automod: AutoModerationActionExecution | null
                            channel: BaseChannel | null
                            emoji: Emoji | null
                            entitlement: Entitlement | null
                            gameRule: TypedGameRule<GameRuleType> | null
                            guild: Guild | null
                            interaction: Interaction | null
                            ipBan: IPBan | null
                            member: GuildMember | null
                            message: Message<boolean> | null
                            operator: Operator | null
                            player: Player | null
                            reaction: MessageReaction | null
                            role: Role | null
                            serverState: ServerState | null
                            sound: SoundboardSound | null
                            sticker: Sticker | null
                            subscription: Subscription | null
                            user: User | null
                            userBan: UserBan | null
                            diff --git a/docs/interfaces/IExtendedRunnable.html b/docs/interfaces/IExtendedRunnable.html new file mode 100644 index 0000000..b649cb1 --- /dev/null +++ b/docs/interfaces/IExtendedRunnable.html @@ -0,0 +1,28 @@ +IExtendedRunnable | @tryforge/forge.minecraft
                            @tryforge/forge.minecraft
                              Preparing search index...

                              Interface IExtendedRunnable

                              interface IExtendedRunnable {
                                  allowTopLevelReturn?: boolean;
                                  args?: string[];
                                  client: ForgeClient;
                                  command: BaseCommand<unknown> | null;
                                  container?: Container;
                                  data: IExtendedCompilationResult;
                                  disableConsoleErrors?: boolean;
                                  doNotSend?: boolean;
                                  environment?: Record<string, unknown>;
                                  extras?: unknown;
                                  keywords?: Record<string, string>;
                                  obj: ExtendedSendable;
                                  redirectErrorsToConsole?: boolean;
                                  states?: States;
                              }

                              Hierarchy

                              • IRunnable
                                • IExtendedRunnable
                              Index

                              Properties

                              allowTopLevelReturn?: boolean
                              args?: string[]

                              The args used in the message command

                              +
                              client: ForgeClient

                              The available discord client

                              +
                              command: BaseCommand<unknown> | null

                              The command used for this execution

                              +
                              container?: Container

                              The container reference to use

                              +
                              data: IExtendedCompilationResult

                              The compiled data to execute

                              +
                              disableConsoleErrors?: boolean

                              Removes errors output to console

                              +
                              doNotSend?: boolean

                              Whether to suppress sending the response to discord.

                              +
                              environment?: Record<string, unknown>

                              The already existing env variables

                              +
                              extras?: unknown

                              Extras data

                              +
                              keywords?: Record<string, string>

                              The already existing variables defined with $let

                              +

                              The context this code will run in

                              +
                              redirectErrorsToConsole?: boolean

                              Whether to suppress errors from being sent to discord, and be sent to console instead

                              +
                              states?: States

                              The old and new states of an event

                              +
                              diff --git a/docs/interfaces/IForgeMinecraftOptions.html b/docs/interfaces/IForgeMinecraftOptions.html new file mode 100644 index 0000000..ccfb263 --- /dev/null +++ b/docs/interfaces/IForgeMinecraftOptions.html @@ -0,0 +1,9 @@ +IForgeMinecraftOptions | @tryforge/forge.minecraft
                              @tryforge/forge.minecraft
                                Preparing search index...

                                Interface IForgeMinecraftOptions

                                interface IForgeMinecraftOptions {
                                    bedrock?: IBedrockServerOptions;
                                    events?: (keyof IMinecraftEvents)[];
                                    java?: IJavaServerOptions;
                                    server?: IManagementServerOptions;
                                }
                                Index

                                Properties

                                Properties

                                The default Bedrock server options to use for bedrock functions.

                                +
                                events?: (keyof IMinecraftEvents)[]

                                The events to receive from the management server.

                                +

                                The default Java server options to use for java functions.

                                +

                                The management server options used to establish a connection.

                                +
                                diff --git a/docs/interfaces/IJavaServerOptions.html b/docs/interfaces/IJavaServerOptions.html new file mode 100644 index 0000000..f49612d --- /dev/null +++ b/docs/interfaces/IJavaServerOptions.html @@ -0,0 +1,8 @@ +IJavaServerOptions | @tryforge/forge.minecraft
                                @tryforge/forge.minecraft
                                  Preparing search index...

                                  Interface IJavaServerOptions

                                  interface IJavaServerOptions {
                                      host: string;
                                      port?: number;
                                  }
                                  Index

                                  Properties

                                  Properties

                                  host: string

                                  The host domain of the server.

                                  +
                                  port?: number

                                  The port for the host domain.

                                  +
                                  25565
                                  +
                                  + +
                                  diff --git a/docs/interfaces/IManagementServerOptions.html b/docs/interfaces/IManagementServerOptions.html new file mode 100644 index 0000000..de13148 --- /dev/null +++ b/docs/interfaces/IManagementServerOptions.html @@ -0,0 +1,22 @@ +IManagementServerOptions | @tryforge/forge.minecraft
                                  @tryforge/forge.minecraft
                                    Preparing search index...

                                    Interface IManagementServerOptions

                                    interface IManagementServerOptions {
                                        host: string;
                                        maxReconnectAttempts?: number;
                                        port: number;
                                        reconnect?: boolean;
                                        reconnectInterval?: number;
                                        token: string;
                                    }
                                    Index

                                    Properties

                                    host: string

                                    The host domain of the server.

                                    +
                                    maxReconnectAttempts?: number

                                    The maximum number of times to attempt to reconnect to the server. Set to 0 for infinite attempts.

                                    +
                                    5
                                    +
                                    + +
                                    port: number

                                    The port for the host connection.

                                    +
                                    reconnect?: boolean

                                    Whether to automatically reconnect to the server if the connection is lost.

                                    +
                                    true
                                    +
                                    + +
                                    reconnectInterval?: number

                                    The interval in ms used to reconnect to the server.

                                    +
                                    1000
                                    +
                                    + +
                                    token: string

                                    The token needed to connect to the server.

                                    +
                                    diff --git a/docs/interfaces/IMinecraftEvents.html b/docs/interfaces/IMinecraftEvents.html new file mode 100644 index 0000000..7f45ab9 --- /dev/null +++ b/docs/interfaces/IMinecraftEvents.html @@ -0,0 +1,22 @@ +IMinecraftEvents | @tryforge/forge.minecraft
                                    @tryforge/forge.minecraft
                                      Preparing search index...

                                      Interface IMinecraftEvents

                                      interface IMinecraftEvents {
                                          allowListAdded: [Player];
                                          allowListRemoved: [Player];
                                          banAdded: [UserBan];
                                          banRemoved: [Player];
                                          connected: [];
                                          disconnected: [];
                                          error: [Error];
                                          gameRuleUpdated: [TypedGameRule<GameRuleType>];
                                          ipBanAdded: [IPBan];
                                          ipBanRemoved: [string];
                                          operatorAdded: [Operator];
                                          operatorRemoved: [Operator];
                                          playerJoined: [Player];
                                          playerLeft: [Player];
                                          reconnecting: [];
                                          serverActivity: [];
                                          serverSaved: [];
                                          serverSaving: [];
                                          serverStarted: [];
                                          serverStatus: [ServerState];
                                          serverStopping: [];
                                      }
                                      Index

                                      Properties

                                      allowListAdded: [Player]
                                      allowListRemoved: [Player]
                                      banAdded: [UserBan]
                                      banRemoved: [Player]
                                      connected: []
                                      disconnected: []
                                      error: [Error]
                                      gameRuleUpdated: [TypedGameRule<GameRuleType>]
                                      ipBanAdded: [IPBan]
                                      ipBanRemoved: [string]
                                      operatorAdded: [Operator]
                                      operatorRemoved: [Operator]
                                      playerJoined: [Player]
                                      playerLeft: [Player]
                                      reconnecting: []
                                      serverActivity: []
                                      serverSaved: []
                                      serverSaving: []
                                      serverStarted: []
                                      serverStatus: [ServerState]
                                      serverStopping: []
                                      diff --git a/docs/modules.html b/docs/modules.html new file mode 100644 index 0000000..bfaffbf --- /dev/null +++ b/docs/modules.html @@ -0,0 +1 @@ +@tryforge/forge.minecraft
                                      @tryforge/forge.minecraft
                                        Preparing search index...
                                        diff --git a/docs/types/ExtendedSendable.html b/docs/types/ExtendedSendable.html new file mode 100644 index 0000000..5904c64 --- /dev/null +++ b/docs/types/ExtendedSendable.html @@ -0,0 +1 @@ +ExtendedSendable | @tryforge/forge.minecraft
                                        @tryforge/forge.minecraft
                                          Preparing search index...

                                          Type Alias ExtendedSendable

                                          ExtendedSendable:
                                              | Sendable
                                              | Player
                                              | Operator
                                              | ServerState
                                              | TypedGameRule<GameRuleType>
                                              | UserBan
                                              | IPBan
                                          diff --git a/docs/types/TransformEvents.html b/docs/types/TransformEvents.html new file mode 100644 index 0000000..ddb8e76 --- /dev/null +++ b/docs/types/TransformEvents.html @@ -0,0 +1 @@ +TransformEvents | @tryforge/forge.minecraft
                                          @tryforge/forge.minecraft
                                            Preparing search index...

                                            Type Alias TransformEvents<T>

                                            TransformEvents: {
                                                [P in keyof T]: T[P] extends any[] ? (...args: T[P]) => any : never
                                            }

                                            Type Parameters

                                            • T
                                            diff --git a/docs/variables/ForgeMinecraftEventHandlerName.html b/docs/variables/ForgeMinecraftEventHandlerName.html new file mode 100644 index 0000000..834cb53 --- /dev/null +++ b/docs/variables/ForgeMinecraftEventHandlerName.html @@ -0,0 +1 @@ +ForgeMinecraftEventHandlerName | @tryforge/forge.minecraft
                                            @tryforge/forge.minecraft
                                              Preparing search index...

                                              Variable ForgeMinecraftEventHandlerNameConst

                                              ForgeMinecraftEventHandlerName: "ForgeMinecraftEvents"
                                              diff --git a/metadata/changelogs.json b/metadata/changelogs.json new file mode 100644 index 0000000..821f06a --- /dev/null +++ b/metadata/changelogs.json @@ -0,0 +1 @@ +{"1.0.0":[{"message":"Init ForgeMinecraft","timestamp":"2025-12-26T16:12:57.600Z","author":"xNickyDev"}]} \ No newline at end of file diff --git a/metadata/enums.json b/metadata/enums.json new file mode 100644 index 0000000..1367587 --- /dev/null +++ b/metadata/enums.json @@ -0,0 +1 @@ +{"BedrockEdition":["MCPE","MCEE"],"GameMode":["Survival","Creative","Spectator","Adventure"],"MOTDProperty":["Raw","Clean","Html"],"VersionProperty":["name","protocol"],"GameRuleProperty":["key","value","type"],"IPBanProperty":["ip","reason","source","expiresTimestamp"],"OperatorProperty":["permissionLevel","bypassesPlayerLimit","playerName","playerID"],"PlayerProperty":["id","name"],"UserBanProperty":["reason","source","playerID","playerName","expiresTimestamp"],"ServerStateProperty":["hasStarted","playerIDs","playerNames","versionName","versionProtocol"],"JavaModProperty":["name","version"],"JavaPlayerProperty":["uuid","nameRaw","nameClean","nameHtml"],"JavaPluginProperty":["name","version"],"JavaVersionProperty":["nameRaw","nameClean","nameHtml","protocol"],"Difficulty":["Peaceful","Easy","Normal","Hard"]} \ No newline at end of file diff --git a/metadata/events.json b/metadata/events.json new file mode 100644 index 0000000..97b213a --- /dev/null +++ b/metadata/events.json @@ -0,0 +1 @@ +[{"name":"allowListAdded","version":"1.0.0","description":"This event is fired when a player was added to the allow list"},{"name":"allowListRemoved","version":"1.0.0","description":"This event is fired when a player was removed from the allow list"},{"name":"banAdded","version":"1.0.0","description":"This event is fired when a player was banned"},{"name":"banRemoved","version":"1.0.0","description":"This event is fired when a player was unbanned"},{"name":"connected","version":"1.0.0","description":"This event is fired when the management server has connected"},{"name":"disconnected","version":"1.0.0","description":"This event is fired when the management server has disconnected"},{"name":"error","version":"1.0.0","description":"This event is fired when an error occurred"},{"name":"gameRuleUpdated","version":"1.0.0","description":"This event is fired when a game rule was updated"},{"name":"ipBanAdded","version":"1.0.0","description":"This event is fired when an IP was banned"},{"name":"ipBanRemoved","version":"1.0.0","description":"This event is fired when an IP was unbanned"},{"name":"operatorAdded","version":"1.0.0","description":"This event is fired when an operator was added"},{"name":"operatorRemoved","version":"1.0.0","description":"This event is fired when an operator was removed"},{"name":"playerJoined","version":"1.0.0","description":"This event is fired when a player has joined the server"},{"name":"playerLeft","version":"1.0.0","description":"This event is fired when a player has left the server"},{"name":"reconnecting","version":"1.0.0","description":"This event is fired when the management server is reconnecting"},{"name":"serverActivity","version":"1.0.0","description":"This event is fired when a network connection to the server has been initiated"},{"name":"serverSaved","version":"1.0.0","description":"This event is fired when the server was saved"},{"name":"serverSaving","version":"1.0.0","description":"This event is fired when the server is saving"},{"name":"serverStarted","version":"1.0.0","description":"This event is fired when the server has started"},{"name":"serverStatus","version":"1.0.0","description":"This event is fired when the server status was received"},{"name":"serverStopping","version":"1.0.0","description":"This event is fired when the server is stopping"}] \ No newline at end of file diff --git a/metadata/functions.json b/metadata/functions.json new file mode 100644 index 0000000..970dce3 --- /dev/null +++ b/metadata/functions.json @@ -0,0 +1 @@ +[{"name":"$bedrockEdition","version":"1.0.0","description":"Returns the edition of a bedrock server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["BedrockEdition"],"category":"bedrock"},{"name":"$bedrockEulaBlocked","version":"1.0.0","description":"Returns whether a bedrock server has EULA blocked","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["Boolean"],"category":"bedrock"},{"name":"$bedrockGameMode","version":"1.0.0","description":"Returns the game mode of a bedrock server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["GameMode"],"category":"bedrock"},{"name":"$bedrockHost","version":"1.0.0","description":"Returns the host name of the bedrock server","unwrap":false,"output":["String"],"category":"bedrock"},{"name":"$bedrockIPAddress","version":"1.0.0","description":"Returns the IP address of a bedrock server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["String"],"category":"bedrock"},{"name":"$bedrockMOTD","version":"1.0.0","description":"Returns the message of the day (MOTD) from a bedrock server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["Raw","Clean","Html"],"enumName":"MOTDProperty"}],"output":["Json","Unknown"],"category":"bedrock"},{"name":"$bedrockMaxPlayers","version":"1.0.0","description":"Returns the maximum amount of allowed players on a bedrock server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["Number"],"category":"bedrock"},{"name":"$bedrockPlayerCount","version":"1.0.0","description":"Returns the online player count of a bedrock server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["Number"],"category":"bedrock"},{"name":"$bedrockPort","version":"1.0.0","description":"Returns the port of the bedrock server","unwrap":false,"output":["Number"],"category":"bedrock"},{"name":"$bedrockServerID","version":"1.0.0","description":"Returns the server ID of a bedrock server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["String"],"category":"bedrock"},{"name":"$bedrockServerOnline","version":"1.0.0","description":"Returns whether a bedrock server is online","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["Boolean"],"category":"bedrock"},{"name":"$bedrockVersion","version":"1.0.0","description":"Returns the version of a bedrock server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["name","protocol"],"enumName":"VersionProperty"}],"output":["Json","Unknown"],"category":"bedrock"},{"name":"$gameRule","version":"1.0.0","description":"Retrieves data from an event whose context was a game rule event","unwrap":true,"brackets":false,"args":[{"name":"property","description":"The property to pull","rest":false,"required":true,"type":"Enum","enum":["key","value","type"],"enumName":"GameRuleProperty"}],"output":["Json","Unknown"],"category":"event"},{"name":"$ipBan","version":"1.0.0","description":"Retrieves data from an event whose context was an IP ban event","unwrap":true,"brackets":false,"args":[{"name":"property","description":"The property to pull","rest":false,"required":true,"type":"Enum","enum":["ip","reason","source","expiresTimestamp"],"enumName":"IPBanProperty"}],"output":["Json","Unknown"],"category":"event"},{"name":"$operator","version":"1.0.0","description":"Retrieves data from an event whose context was an operator event","unwrap":true,"brackets":false,"args":[{"name":"property","description":"The property to pull","rest":false,"required":true,"type":"Enum","enum":["permissionLevel","bypassesPlayerLimit","playerName","playerID"],"enumName":"OperatorProperty"}],"output":["Json","Unknown"],"category":"event"},{"name":"$player","version":"1.0.0","description":"Retrieves data from an event whose context was a player event","unwrap":true,"brackets":false,"args":[{"name":"property","description":"The property to pull","rest":false,"required":true,"type":"Enum","enum":["id","name"],"enumName":"PlayerProperty"}],"output":["Json","Unknown"],"category":"event"},{"name":"$playerBan","version":"1.0.0","description":"Retrieves data from an event whose context was a player ban event","unwrap":true,"brackets":false,"args":[{"name":"property","description":"The property to pull","rest":false,"required":true,"type":"Enum","enum":["reason","source","playerID","playerName","expiresTimestamp"],"enumName":"UserBanProperty"}],"output":["Json","Unknown"],"category":"event"},{"name":"$serverState","version":"1.0.0","description":"Retrieves data from an event whose context was a server status event","unwrap":true,"brackets":false,"args":[{"name":"property","description":"The property to pull","rest":false,"required":true,"type":"Enum","enum":["hasStarted","playerIDs","playerNames","versionName","versionProtocol"],"enumName":"ServerStateProperty"},{"name":"separator","description":"The separator to use for each value","rest":false,"type":"String"}],"output":["Json","Unknown"],"category":"event"},{"name":"$javaEulaBlocked","version":"1.0.0","description":"Returns whether a java server has EULA blocked","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["Boolean"],"category":"java"},{"name":"$javaHost","version":"1.0.0","description":"Returns the host name of the java server","unwrap":false,"output":["String"],"category":"java"},{"name":"$javaIPAddress","version":"1.0.0","description":"Returns the IP address of a java server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["String"],"category":"java"},{"name":"$javaIcon","version":"1.0.0","description":"Returns the icon of a java server as attachment","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["Attachment"],"category":"java"},{"name":"$javaMOTD","version":"1.0.0","description":"Returns the message of the day (MOTD) from a java server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["Raw","Clean","Html"],"enumName":"MOTDProperty"}],"output":["Json","Unknown"],"category":"java"},{"name":"$javaMaxPlayers","version":"1.0.0","description":"Returns the maximum amount of allowed players on a java server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["Number"],"category":"java"},{"name":"$javaMods","version":"1.0.0","description":"Returns the mods of a java server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["name","version"],"enumName":"JavaModProperty"},{"name":"separator","description":"The separator to use for each value","rest":false,"type":"String"}],"output":["Json","String[]"],"category":"java"},{"name":"$javaPlayerCount","version":"1.0.0","description":"Returns the online player count of a java server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["Number"],"category":"java"},{"name":"$javaPlayerList","version":"1.0.0","description":"Returns the online player list of a java server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["uuid","nameRaw","nameClean","nameHtml"],"enumName":"JavaPlayerProperty"},{"name":"separator","description":"The separator to use for each value","rest":false,"type":"String"}],"output":["Json","String[]"],"category":"java"},{"name":"$javaPlugins","version":"1.0.0","description":"Returns the plugins of a java server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["name","version"],"enumName":"JavaPluginProperty"},{"name":"separator","description":"The separator to use for each value","rest":false,"type":"String"}],"output":["Json","String[]"],"category":"java"},{"name":"$javaPort","version":"1.0.0","description":"Returns the port of the java server","unwrap":false,"output":["Number"],"category":"java"},{"name":"$javaServerOnline","version":"1.0.0","description":"Returns whether a java server is online","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["Boolean"],"category":"java"},{"name":"$javaSoftware","version":"1.0.0","description":"Returns the software of a java server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"}],"output":["String"],"category":"java"},{"name":"$javaVersion","version":"1.0.0","description":"Returns the version of a java server","unwrap":true,"brackets":false,"args":[{"name":"host","description":"The host domain of the server","rest":false,"type":"String"},{"name":"port","description":"The port of the host connection","rest":false,"type":"Number"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["nameRaw","nameClean","nameHtml","protocol"],"enumName":"JavaVersionProperty"}],"output":["Json","Unknown"],"category":"java"},{"name":"$addAllowList","version":"1.0.0","description":"Adds players to the server's allow list, returns bool","unwrap":true,"brackets":true,"args":[{"name":"players","description":"The players to add","rest":true,"required":true,"type":"String"}],"output":["Boolean"],"category":"management"},{"name":"$addIPBan","version":"1.0.0","description":"Adds an IP address to the server's ban list, returns bool","unwrap":true,"brackets":true,"args":[{"name":"ip","description":"The IP address to ban from the server","rest":false,"required":true,"type":"String"},{"name":"reason","description":"The reason for the ban","rest":false,"type":"String"},{"name":"source","description":"The source of the ban","rest":false,"type":"String"},{"name":"expires","description":"The expire date of the ban","rest":false,"type":"Date"}],"output":["Boolean"],"category":"management"},{"name":"$addOperator","version":"1.0.0","description":"Adds a player to the server's operator list, returns bool","unwrap":true,"brackets":true,"args":[{"name":"player","description":"The player to add as an operator","rest":false,"required":true,"type":"String"},{"name":"level","description":"The operator permission level to grant (from 1 to 4, with 4 being the highest)","rest":false,"type":"Number"},{"name":"bypass","description":"Whether the operator bypasses the player limit","rest":false,"type":"Boolean"}],"output":["Boolean"],"category":"management"},{"name":"$addPlayerBan","version":"1.0.0","description":"Adds a player to the server's ban list, returns bool","unwrap":true,"brackets":true,"args":[{"name":"player","description":"The player to ban from the server","rest":false,"required":true,"type":"String"},{"name":"reason","description":"The reason for the ban","rest":false,"type":"String"},{"name":"source","description":"The source of the ban","rest":false,"type":"String"},{"name":"expires","description":"The expire date of the ban","rest":false,"type":"Date"}],"output":["Boolean"],"category":"management"},{"name":"$clearAllowList","version":"1.0.0","description":"Clears the server's allow list, returns bool","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$clearIPBans","version":"1.0.0","description":"Clears the server's IP ban list, returns bool","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$clearOperators","version":"1.0.0","description":"Clears the server's operator list, returns bool","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$clearPlayerBans","version":"1.0.0","description":"Clears the server's player ban list, returns bool","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$getAllowList","version":"1.0.0","description":"Returns the server's allow list","unwrap":true,"brackets":false,"args":[{"name":"force","description":"Whether to force a direct fetch, defaults to false","rest":false,"required":true,"type":"Boolean"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["id","name"],"enumName":"PlayerProperty"},{"name":"separator","description":"The separator to use for each value","rest":false,"type":"String"}],"output":["Json","String[]"],"category":"management"},{"name":"$getConnectedPlayers","version":"1.0.0","description":"Returns the server's currently connected players","unwrap":true,"brackets":false,"args":[{"name":"force","description":"Whether to force a direct fetch, defaults to false","rest":false,"required":true,"type":"Boolean"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["id","name"],"enumName":"PlayerProperty"},{"name":"separator","description":"The separator to use for each value","rest":false,"type":"String"}],"output":["Json","String[]"],"category":"management"},{"name":"$getGameRules","version":"1.0.0","description":"Returns the server's game rules","unwrap":true,"brackets":false,"args":[{"name":"force","description":"Whether to force a direct fetch, defaults to false","rest":false,"required":true,"type":"Boolean"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["key","value","type"],"enumName":"GameRuleProperty"},{"name":"separator","description":"The separator to use for each value","rest":false,"type":"String"}],"output":["Json","Unknown[]"],"category":"management"},{"name":"$getIPBans","version":"1.0.0","description":"Returns the server's IP ban list","unwrap":true,"brackets":false,"args":[{"name":"force","description":"Whether to force a direct fetch, defaults to false","rest":false,"required":true,"type":"Boolean"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["ip","reason","source","expiresTimestamp"],"enumName":"IPBanProperty"},{"name":"separator","description":"The separator to use for each value","rest":false,"type":"String"}],"output":["Json","Unknown[]"],"category":"management"},{"name":"$getOperators","version":"1.0.0","description":"Returns the server's operator list","unwrap":true,"brackets":false,"args":[{"name":"force","description":"Whether to force a direct fetch, defaults to false","rest":false,"required":true,"type":"Boolean"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["permissionLevel","bypassesPlayerLimit","playerName","playerID"],"enumName":"OperatorProperty"},{"name":"separator","description":"The separator to use for each value","rest":false,"type":"String"}],"output":["Json","Unknown[]"],"category":"management"},{"name":"$getPlayerBans","version":"1.0.0","description":"Returns the server's player ban list","unwrap":true,"brackets":false,"args":[{"name":"force","description":"Whether to force a direct fetch, defaults to false","rest":false,"required":true,"type":"Boolean"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["reason","source","playerID","playerName","expiresTimestamp"],"enumName":"UserBanProperty"},{"name":"separator","description":"The separator to use for each value","rest":false,"type":"String"}],"output":["Json","Unknown[]"],"category":"management"},{"name":"$getServerVersion","version":"1.0.0","description":"Returns current version of the minecraft server","unwrap":true,"brackets":false,"args":[{"name":"force","description":"Whether to force a direct fetch, defaults to false","rest":false,"required":true,"type":"Boolean"},{"name":"property","description":"The property to return","rest":false,"type":"Enum","enum":["name","protocol"],"enumName":"VersionProperty"}],"output":["Json","String"],"category":"management"},{"name":"$hasGameRulesRegistry","version":"1.0.0","description":"Returns whether the server has the new game rules registry","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$hasServerStarted","version":"1.0.0","description":"Returns whether the server has fully started","unwrap":true,"brackets":false,"args":[{"name":"force","description":"Whether to force a direct fetch, defaults to false","rest":false,"required":true,"type":"Boolean"}],"output":["Boolean"],"category":"management"},{"name":"$kickPlayers","version":"1.0.0","description":"Kicks players from the minecraft server, returns number of kicked players","unwrap":true,"brackets":true,"experimental":true,"args":[{"name":"message","description":"The message displayed to the players when they are kicked","rest":false,"required":false,"type":"String"},{"name":"players","description":"The players to kick","rest":true,"required":true,"type":"String"}],"output":["Number"],"category":"management"},{"name":"$removeAllowList","version":"1.0.0","description":"Removes players from the server's allow list, returns bool","unwrap":true,"brackets":true,"args":[{"name":"players","description":"The players to remove","rest":true,"required":true,"type":"String"}],"output":["Boolean"],"category":"management"},{"name":"$removeIPBans","version":"1.0.0","description":"Removes IP addresses from the server's ban list, returns bool","aliases":["$removeIPBan"],"unwrap":true,"brackets":true,"args":[{"name":"ips","description":"The IP addresses to unban","rest":true,"required":true,"type":"String"}],"output":["Boolean"],"category":"management"},{"name":"$removeOperators","version":"1.0.0","description":"Removes players from the server's operator list, returns bool","aliases":["$removeOperator"],"unwrap":true,"brackets":true,"args":[{"name":"players","description":"The players to remove as operator","rest":true,"required":true,"type":"String"}],"output":["Boolean"],"category":"management"},{"name":"$removePlayerBans","version":"1.0.0","description":"Removes players from the server's ban list, returns bool","aliases":["$removePlayerBan"],"unwrap":true,"brackets":true,"args":[{"name":"players","description":"The players to unban","rest":true,"required":true,"type":"String"}],"output":["Boolean"],"category":"management"},{"name":"$saveServer","version":"1.0.0","description":"Saves the minecraft server","unwrap":true,"brackets":false,"args":[{"name":"flush","description":"Whether to save chunks to disk immediately, defaults to true","rest":false,"required":true,"type":"Boolean"}],"category":"management"},{"name":"$sendSystemMessage","version":"1.0.0","description":"Sends a system message to the minecraft server, returns bool","unwrap":true,"brackets":true,"args":[{"name":"message","description":"The message to send","rest":false,"required":true,"type":"String"},{"name":"overlay","description":"Whether to display the message as an overlay above the hotbar, otherwise in chat","rest":false,"type":"Boolean"},{"name":"players","description":"The players receiving the message, omit to send to all players","rest":true,"type":"String"}],"output":["Boolean"],"category":"management"},{"name":"$serverAcceptTransfers","version":"1.0.0","description":"Returns whether the server accepts players transferred from other servers","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$serverAllowFlight","version":"1.0.0","description":"Returns whether players are allowed to fly on the server","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$serverAutoSave","version":"1.0.0","description":"Returns whether the server automatically saves the world periodically","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$serverDifficulty","version":"1.0.0","description":"Returns the difficulty level of the server","unwrap":false,"output":["Difficulty"],"category":"management"},{"name":"$serverEnforceAllowList","version":"1.0.0","description":"Returns whether the server immediately kicks players when they are removed from the allow list","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$serverEntityBroadcastRange","version":"1.0.0","description":"Returns the range in chunks around each player in which entities are updated to the player, in percentage","unwrap":false,"output":["Number"],"category":"management"},{"name":"$serverForceGameMode","version":"1.0.0","description":"Returns whether players are forced to use the server's game mode when they join","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$serverGameMode","version":"1.0.0","description":"Returns the default game mode for players when they join the server for the first time","unwrap":false,"output":["GameMode"],"category":"management"},{"name":"$serverHideOnlinePlayers","version":"1.0.0","description":"Returns whether the server hides the list of online players from the server list","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$serverMOTD","version":"1.0.0","description":"Returns the server's message of the day (MOTD)","unwrap":false,"output":["String"],"category":"management"},{"name":"$serverMaxPlayers","version":"1.0.0","description":"Returns the maximum number of players that can join the server","unwrap":false,"output":["Number"],"category":"management"},{"name":"$serverOperatorUserPermissionLevel","version":"1.0.0","description":"Returns the permission level granted to new operators","unwrap":false,"output":["Number"],"category":"management"},{"name":"$serverPauseWhenEmptySeconds","version":"1.0.0","description":"Returns the number of seconds before pausing server when no players are online","unwrap":false,"output":["Number"],"category":"management"},{"name":"$serverPlayerIdleTimeout","version":"1.0.0","description":"Returns the number of minutes a player can be idle before being kicked","unwrap":false,"output":["Number"],"category":"management"},{"name":"$serverSimulationDistance","version":"1.0.0","description":"Returns the simulation distance of the server in chunks","unwrap":false,"output":["Number"],"category":"management"},{"name":"$serverSpawnProtectionRadius","version":"1.0.0","description":"Returns the radius around the world spawn point that is protected from non-operator players","unwrap":false,"output":["Number"],"category":"management"},{"name":"$serverStatusHeartbeatInterval","version":"1.0.0","description":"Returns the interval in seconds between status heartbeats sent to server management clients","unwrap":false,"output":["Number"],"category":"management"},{"name":"$serverStatusReplies","version":"1.0.0","description":"Returns whether the server responds to status requests in the multiplayer server list","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$serverUseAllowList","version":"1.0.0","description":"Returns whether the server uses the allow list","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$serverViewDistance","version":"1.0.0","description":"Returns the view distance of the server in chunks","unwrap":false,"output":["Number"],"category":"management"},{"name":"$setAcceptTransfers","version":"1.0.0","description":"Sets whether the server accepts players transferred from other servers","unwrap":true,"brackets":true,"args":[{"name":"accept","description":"Whether to accept transferred players","rest":false,"required":true,"type":"Boolean"}],"category":"management"},{"name":"$setAllowFlight","version":"1.0.0","description":"Sets whether players are allowed to fly on the server","unwrap":true,"brackets":true,"args":[{"name":"allow","description":"Whether to allow flying for players","rest":false,"required":true,"type":"Boolean"}],"category":"management"},{"name":"$setAllowList","version":"1.0.0","description":"Overwrites the existing allow list with a set of players, returns bool","unwrap":true,"brackets":true,"args":[{"name":"players","description":"The players to set","rest":true,"required":true,"type":"String"}],"output":["Boolean"],"category":"management"},{"name":"$setAutoSave","version":"1.0.0","description":"Sets whether the server automatically saves the world periodically","unwrap":true,"brackets":true,"args":[{"name":"save","description":"Whether to enable auto-saving the world","rest":false,"required":true,"type":"Boolean"}],"category":"management"},{"name":"$setDifficulty","version":"1.0.0","description":"Sets the difficulty level of the world","unwrap":true,"brackets":true,"args":[{"name":"difficulty","description":"The difficulty level to set","rest":false,"required":true,"type":"Enum","enum":["Peaceful","Easy","Normal","Hard"],"enumName":"Difficulty"}],"category":"management"},{"name":"$setEnforceAllowList","version":"1.0.0","description":"Sets whether the server immediately kicks players when they are removed from the allow list","unwrap":true,"brackets":true,"args":[{"name":"enforce","description":"Whether to enable enforcement","rest":false,"required":true,"type":"Boolean"}],"category":"management"},{"name":"$setEntityBroadcastRange","version":"1.0.0","description":"Sets the range in chunks around each player in which entities are updated to the players, in percentage","unwrap":true,"brackets":true,"args":[{"name":"percentage","description":"The entity broadcast range percentage (min 10, max 1000)","rest":false,"required":true,"type":"Number"}],"category":"management"},{"name":"$setForceGameMode","version":"1.0.0","description":"Sets whether players are forced to use the server's game mode when they join","unwrap":true,"brackets":true,"args":[{"name":"force","description":"Whether to force the server's game mode","rest":false,"required":true,"type":"Boolean"}],"category":"management"},{"name":"$setGameMode","version":"1.0.0","description":"Sets the default game mode for players when they join the server for the first time","unwrap":true,"brackets":true,"args":[{"name":"mode","description":"The default game mode to set","rest":false,"required":true,"type":"Enum","enum":["Survival","Creative","Spectator","Adventure"],"enumName":"GameMode"}],"category":"management"},{"name":"$setHideOnlinePlayers","version":"1.0.0","description":"Sets whether the server hides the list of online players from the server list","unwrap":true,"brackets":true,"args":[{"name":"hide","description":"Whether to hide the list of online players","rest":false,"required":true,"type":"Boolean"}],"category":"management"},{"name":"$setMOTD","version":"1.0.0","description":"Sets the message of the day (MOTD) for this server","unwrap":true,"brackets":true,"args":[{"name":"motd","description":"The MOTD to set","rest":false,"required":true,"type":"String"}],"category":"management"},{"name":"$setMaxPlayers","version":"1.0.0","description":"Sets the maximum number of players that can join the server","unwrap":true,"brackets":true,"args":[{"name":"max","description":"The maximum number of players","rest":false,"required":true,"type":"Number"}],"category":"management"},{"name":"$setOperatorUserPermissionLevel","version":"1.0.0","description":"Sets the permission level granted to new operators","unwrap":true,"brackets":true,"args":[{"name":"level","description":"The operator user permission level (from 1 to 4, with 4 being the highest)","rest":false,"required":true,"type":"Number"}],"category":"management"},{"name":"$setPauseWhenEmptySeconds","version":"1.0.0","description":"Sets the number of seconds before pausing server when no players are online","unwrap":true,"brackets":true,"args":[{"name":"seconds","description":"The number of seconds before pausing when empty","rest":false,"required":true,"type":"Number"}],"category":"management"},{"name":"$setPlayerIdleTimeout","version":"1.0.0","description":"Sets the number of minutes a player can be idle before being kicked","unwrap":true,"brackets":true,"args":[{"name":"minutes","description":"The number of minutes before kicking idle players","rest":false,"required":true,"type":"Number"}],"category":"management"},{"name":"$setSimulationDistance","version":"1.0.0","description":"Sets the simulation distance of the server in chunks","unwrap":true,"brackets":true,"args":[{"name":"chunks","description":"The simulation distance in chunks","rest":false,"required":true,"type":"Number"}],"category":"management"},{"name":"$setSpawnProtectionRadius","version":"1.0.0","description":"Sets the radius around the world spawn point that is protected from non-operator players","unwrap":true,"brackets":true,"args":[{"name":"radius","description":"The spawn protection radius to set","rest":false,"required":true,"type":"Number"}],"category":"management"},{"name":"$setStatusHeartbeatInterval","version":"1.0.0","description":"Sets the interval in seconds between status heartbeats sent to server management clients","unwrap":true,"brackets":true,"args":[{"name":"seconds","description":"The status heartbeat interval in seconds","rest":false,"required":true,"type":"Number"}],"category":"management"},{"name":"$setStatusReplies","version":"1.0.0","description":"Sets whether the server responds to status requests in the multiplayer server list","unwrap":true,"brackets":true,"args":[{"name":"respond","description":"Whether to respond to status requests","rest":false,"required":true,"type":"Boolean"}],"category":"management"},{"name":"$setUseAllowList","version":"1.0.0","description":"Sets whether the server uses the allow list","unwrap":true,"brackets":true,"args":[{"name":"enable","description":"Whether to enable the allow list","rest":false,"required":true,"type":"Boolean"}],"category":"management"},{"name":"$setViewDistance","version":"1.0.0","description":"Sets the view distance of the server in chunks","unwrap":true,"brackets":true,"args":[{"name":"chunks","description":"The view distance in chunks","rest":false,"required":true,"type":"Number"}],"category":"management"},{"name":"$stopServer","version":"1.0.0","description":"Stops the minecraft server, returns bool","unwrap":false,"output":["Boolean"],"category":"management"},{"name":"$updateGameRule","version":"1.0.0","description":"Updates a game rule of the minecraft server, returns bool","unwrap":true,"brackets":true,"args":[{"name":"key","description":"The key of the game rule to update","rest":false,"required":true,"type":"String"},{"name":"value","description":"The new value for the game rule","rest":false,"required":true,"type":"String"}],"output":["Boolean"],"category":"management"}] \ No newline at end of file diff --git a/metadata/paths.json b/metadata/paths.json new file mode 100644 index 0000000..68a71c5 --- /dev/null +++ b/metadata/paths.json @@ -0,0 +1 @@ +{"functions":"src/native","events":"src/events"} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..7b7b074 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,1440 @@ +{ + "name": "forge.minecraft", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "forge.minecraft", + "version": "1.0.0", + "license": "GPL-3.0", + "dependencies": { + "mc-server-management": "^3.2.1", + "node-mcstatus": "^1.2.1", + "tiny-typed-emitter": "^2.1.0" + }, + "devDependencies": { + "@tryforge/forgescript": "^2.5.0", + "typedoc": "^0.28.15", + "typescript": "^5.6.3" + } + }, + "node_modules/@discordjs/builders": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/@discordjs/builders/-/builders-1.13.1.tgz", + "integrity": "sha512-cOU0UDHc3lp/5nKByDxkmRiNZBpdp0kx55aarbiAfakfKJHlxv/yFW1zmIqCAmwH5CRlrH9iMFKJMpvW4DPB+w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@discordjs/formatters": "^0.6.2", + "@discordjs/util": "^1.2.0", + "@sapphire/shapeshift": "^4.0.0", + "discord-api-types": "^0.38.33", + "fast-deep-equal": "^3.1.3", + "ts-mixer": "^6.0.4", + "tslib": "^2.6.3" + }, + "engines": { + "node": ">=16.11.0" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/collection": { + "version": "1.5.3", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-1.5.3.tgz", + "integrity": "sha512-SVb428OMd3WO1paV3rm6tSjM4wC+Kecaa1EUGX7vc6/fddvw/6lg90z4QtCqm21zvVe92vMMDt9+DkIvjXImQQ==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=16.11.0" + } + }, + "node_modules/@discordjs/formatters": { + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/@discordjs/formatters/-/formatters-0.6.2.tgz", + "integrity": "sha512-y4UPwWhH6vChKRkGdMB4odasUbHOUwy7KL+OVwF86PvT6QVOwElx+TiI1/6kcmcEe+g5YRXJFiXSXUdabqZOvQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "discord-api-types": "^0.38.33" + }, + "engines": { + "node": ">=16.11.0" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/rest": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/@discordjs/rest/-/rest-2.6.0.tgz", + "integrity": "sha512-RDYrhmpB7mTvmCKcpj+pc5k7POKszS4E2O9TYc+U+Y4iaCP+r910QdO43qmpOja8LRr1RJ0b3U+CqVsnPqzf4w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@discordjs/collection": "^2.1.1", + "@discordjs/util": "^1.1.1", + "@sapphire/async-queue": "^1.5.3", + "@sapphire/snowflake": "^3.5.3", + "@vladfrangu/async_event_emitter": "^2.4.6", + "discord-api-types": "^0.38.16", + "magic-bytes.js": "^1.10.0", + "tslib": "^2.6.3", + "undici": "6.21.3" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/rest/node_modules/@discordjs/collection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.1.1.tgz", + "integrity": "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/rest/node_modules/undici": { + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz", + "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.17" + } + }, + "node_modules/@discordjs/util": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@discordjs/util/-/util-1.2.0.tgz", + "integrity": "sha512-3LKP7F2+atl9vJFhaBjn4nOaSWahZ/yWjOvA4e5pnXkt2qyXRCHLxoBQy81GFtLGCq7K9lPm9R517M1U+/90Qg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "discord-api-types": "^0.38.33" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/ws": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/@discordjs/ws/-/ws-1.2.3.tgz", + "integrity": "sha512-wPlQDxEmlDg5IxhJPuxXr3Vy9AjYq5xCvFWGJyD7w7Np8ZGu+Mc+97LCoEc/+AYCo2IDpKioiH0/c/mj5ZR9Uw==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@discordjs/collection": "^2.1.0", + "@discordjs/rest": "^2.5.1", + "@discordjs/util": "^1.1.0", + "@sapphire/async-queue": "^1.5.2", + "@types/ws": "^8.5.10", + "@vladfrangu/async_event_emitter": "^2.2.4", + "discord-api-types": "^0.38.1", + "tslib": "^2.6.2", + "ws": "^8.17.0" + }, + "engines": { + "node": ">=16.11.0" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@discordjs/ws/node_modules/@discordjs/collection": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-2.1.1.tgz", + "integrity": "sha512-LiSusze9Tc7qF03sLCujF5iZp7K+vRNEDBZ86FT9aQAv3vxMLihUvKvpsCWiQ2DJq1tVckopKm1rxomgNUc9hg==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/@fastify/busboy": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.1.1.tgz", + "integrity": "sha512-vBZP4NlzfOlerQTnba4aqZoMhE/a9HY7HRqoOPaETQcSQuWEIyZMHGfVu6w9wGtGK5fED5qRs2DteVCjOH60sA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14" + } + }, + "node_modules/@gerrit0/mini-shiki": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@gerrit0/mini-shiki/-/mini-shiki-3.20.0.tgz", + "integrity": "sha512-Wa57i+bMpK6PGJZ1f2myxo3iO+K/kZikcyvH8NIqNNZhQUbDav7V9LQmWOXhf946mz5c1NZ19WMsGYiDKTryzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/engine-oniguruma": "^3.20.0", + "@shikijs/langs": "^3.20.0", + "@shikijs/themes": "^3.20.0", + "@shikijs/types": "^3.20.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, + "node_modules/@noble/hashes": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", + "license": "MIT", + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@paralleldrive/cuid2": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/@paralleldrive/cuid2/-/cuid2-2.3.1.tgz", + "integrity": "sha512-XO7cAxhnTZl0Yggq6jOgjiOHhbgcO4NqFqwSmQpjK3b6TEE6Uj/jfSk6wzYyemh3+I0sHirKSetjQwn5cZktFw==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "^1.1.5" + } + }, + "node_modules/@sapphire/async-queue": { + "version": "1.5.5", + "resolved": "https://registry.npmjs.org/@sapphire/async-queue/-/async-queue-1.5.5.tgz", + "integrity": "sha512-cvGzxbba6sav2zZkH8GPf2oGk9yYoD5qrNWdu9fRehifgnFZJMV+nuy2nON2roRO4yQQ+v7MK/Pktl/HgfsUXg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@sapphire/shapeshift": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@sapphire/shapeshift/-/shapeshift-4.0.0.tgz", + "integrity": "sha512-d9dUmWVA7MMiKobL3VpLF8P2aeanRTu6ypG2OIaEv/ZHH/SUQ2iHOVyi5wAPjQ+HmnMuL0whK9ez8I/raWbtIg==", + "dev": true, + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.3", + "lodash": "^4.17.21" + }, + "engines": { + "node": ">=v16" + } + }, + "node_modules/@sapphire/snowflake": { + "version": "3.5.3", + "resolved": "https://registry.npmjs.org/@sapphire/snowflake/-/snowflake-3.5.3.tgz", + "integrity": "sha512-jjmJywLAFoWeBi1W7994zZyiNWPIiqRRNAmSERxyg93xRGzNYvGjlZ0gR6x0F4gPRi2+0O6S71kOZYyr3cxaIQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/@shikijs/engine-oniguruma": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@shikijs/engine-oniguruma/-/engine-oniguruma-3.20.0.tgz", + "integrity": "sha512-Yx3gy7xLzM0ZOjqoxciHjA7dAt5tyzJE3L4uQoM83agahy+PlW244XJSrmJRSBvGYELDhYXPacD4R/cauV5bzQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.20.0", + "@shikijs/vscode-textmate": "^10.0.2" + } + }, + "node_modules/@shikijs/langs": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@shikijs/langs/-/langs-3.20.0.tgz", + "integrity": "sha512-le+bssCxcSHrygCWuOrYJHvjus6zhQ2K7q/0mgjiffRbkhM4o1EWu2m+29l0yEsHDbWaWPNnDUTRVVBvBBeKaA==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.20.0" + } + }, + "node_modules/@shikijs/themes": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@shikijs/themes/-/themes-3.20.0.tgz", + "integrity": "sha512-U1NSU7Sl26Q7ErRvJUouArxfM2euWqq1xaSrbqMu2iqa+tSp0D1Yah8216sDYbdDHw4C8b75UpE65eWorm2erQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/types": "3.20.0" + } + }, + "node_modules/@shikijs/types": { + "version": "3.20.0", + "resolved": "https://registry.npmjs.org/@shikijs/types/-/types-3.20.0.tgz", + "integrity": "sha512-lhYAATn10nkZcBQ0BlzSbJA3wcmL5MXUUF8d2Zzon6saZDlToKaiRX60n2+ZaHJCmXEcZRWNzn+k9vplr8Jhsw==", + "dev": true, + "license": "MIT", + "dependencies": { + "@shikijs/vscode-textmate": "^10.0.2", + "@types/hast": "^3.0.4" + } + }, + "node_modules/@shikijs/vscode-textmate": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@shikijs/vscode-textmate/-/vscode-textmate-10.0.2.tgz", + "integrity": "sha512-83yeghZ2xxin3Nj8z1NMd/NCuca+gsYXswywDy5bHvwlWL8tpTQmzGeUuHd9FC3E/SBEMvzJRwWEOz5gGes9Qg==", + "dev": true, + "license": "MIT" + }, + "node_modules/@swc/helpers": { + "version": "0.5.17", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.17.tgz", + "integrity": "sha512-5IKx/Y13RsYd+sauPb2x+U/xZikHjolzfuDgTAl/Tdf3Q8rslRvC19NKDLgAJQ6wsqADk10ntlv08nPFw/gO/A==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@tryforge/forgescript": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/@tryforge/forgescript/-/forgescript-2.5.0.tgz", + "integrity": "sha512-DhD7FfgzbR81Oc6l6PCgKQTP5O67CovZxL6IEIPCHZOg72ptsg9OQzJQbLOFCJspRiGZIZcZYhnOvErLXm/04g==", + "dev": true, + "license": "GPL-3.0", + "dependencies": { + "chalk": "^4.1.2", + "discord.js": "^14.22.1", + "ms-utility": "^3.3.0", + "tiny-typed-emitter": "^2.1.0", + "undici": "^5.23.0" + }, + "engines": { + "node": ">=16.11.0" + } + }, + "node_modules/@types/hast": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/@types/hast/-/hast-3.0.4.tgz", + "integrity": "sha512-WPs+bbQw5aCj+x6laNGWLH3wviHtoCv/P3+otBhbOhJgG8qtpdAMlTCxLtsTWA7LH1Oh/bFCHsBn0TPS5m30EQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/unist": "*" + } + }, + "node_modules/@types/node": { + "version": "25.0.3", + "resolved": "https://registry.npmjs.org/@types/node/-/node-25.0.3.tgz", + "integrity": "sha512-W609buLVRVmeW693xKfzHeIV6nJGGz98uCPfeXI1ELMLXVeKYZ9m15fAMSaUPBHYLGFsVRcMmSCksQOrZV9BYA==", + "license": "MIT", + "dependencies": { + "undici-types": "~7.16.0" + } + }, + "node_modules/@types/unist": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/unist/-/unist-3.0.3.tgz", + "integrity": "sha512-ko/gIFJRv177XgZsZcBwnqJN5x/Gien8qNOn0D5bQU/zAzVf9Zt3BlcUiLqhV9y4ARk0GbT3tnUiPNgnTXzc/Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==", + "license": "MIT" + }, + "node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@vladfrangu/async_event_emitter": { + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/@vladfrangu/async_event_emitter/-/async_event_emitter-2.4.7.tgz", + "integrity": "sha512-Xfe6rpCTxSxfbswi/W/Pz7zp1WWSNn4A0eW4mLkQUewCrXXtMj31lCg+iQyTkh/CkusZSq9eDflu7tjEDXUY6g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=v14.0.0", + "npm": ">=7.0.0" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true, + "license": "Python-2.0" + }, + "node_modules/asap": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/asap/-/asap-2.0.6.tgz", + "integrity": "sha512-BSHWgDSAiKs50o2Re8ppvp3seVHXSRM44cdSsT9FfNEUUZLOGWVCsiWaRPWM1Znn+mqZ1OfVZ3z3DWEzSp7hRA==", + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/brace-expansion": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz", + "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/bufferutil": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.1.0.tgz", + "integrity": "sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/component-emitter": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.1.tgz", + "integrity": "sha512-T0+barUSQRTUQASh8bx02dl+DhF54GtIDY13Y3m9oWTklKbb3Wv974meRpeZ3lp1JpLVECWWNHC4vaG2XHXouQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cookiejar": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/cookiejar/-/cookiejar-2.1.4.tgz", + "integrity": "sha512-LDx6oHrK+PhzLKJU9j5S7/Y3jM/mUHvD/DeI1WQmJn652iPC5Y4TBzC9l+5OMOXlyTTA+SmVUPm0HQUwpD5Jqw==", + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.3.tgz", + "integrity": "sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==", + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dezalgo": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/dezalgo/-/dezalgo-1.0.4.tgz", + "integrity": "sha512-rXSP0bf+5n0Qonsb+SVVfNfIsimO4HEtmnIpPHY8Q1UCzKlQrDMfdobr8nJOOsRgWCyMRqeSBQzmWUMq7zvVig==", + "license": "ISC", + "dependencies": { + "asap": "^2.0.0", + "wrappy": "1" + } + }, + "node_modules/discord-api-types": { + "version": "0.38.37", + "resolved": "https://registry.npmjs.org/discord-api-types/-/discord-api-types-0.38.37.tgz", + "integrity": "sha512-Cv47jzY1jkGkh5sv0bfHYqGgKOWO1peOrGMkDFM4UmaGMOTgOW8QSexhvixa9sVOiz8MnVOBryWYyw/CEVhj7w==", + "dev": true, + "license": "MIT", + "workspaces": [ + "scripts/actions/documentation" + ] + }, + "node_modules/discord.js": { + "version": "14.25.1", + "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-14.25.1.tgz", + "integrity": "sha512-2l0gsPOLPs5t6GFZfQZKnL1OJNYFcuC/ETWsW4VtKVD/tg4ICa9x+jb9bkPffkMdRpRpuUaO/fKkHCBeiCKh8g==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@discordjs/builders": "^1.13.0", + "@discordjs/collection": "1.5.3", + "@discordjs/formatters": "^0.6.2", + "@discordjs/rest": "^2.6.0", + "@discordjs/util": "^1.2.0", + "@discordjs/ws": "^1.2.3", + "@sapphire/snowflake": "3.5.3", + "discord-api-types": "^0.38.33", + "fast-deep-equal": "3.1.3", + "lodash.snakecase": "4.1.1", + "magic-bytes.js": "^1.10.0", + "tslib": "^2.6.3", + "undici": "6.21.3" + }, + "engines": { + "node": ">=18" + }, + "funding": { + "url": "https://github.com/discordjs/discord.js?sponsor" + } + }, + "node_modules/discord.js/node_modules/undici": { + "version": "6.21.3", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.21.3.tgz", + "integrity": "sha512-gBLkYIlEnSp8pFbT64yFgGE6UIB9tAkhukC23PmMDCe5Nd+cRqKxSjw5y54MK2AZMgZfJWMaNE4nYUHgi1XEOw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=18.17" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/fast-safe-stringify": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", + "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==", + "license": "MIT" + }, + "node_modules/form-data": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.5.tgz", + "integrity": "sha512-8RipRLol37bNs2bhoV67fiTEvdTrbMUYcFTiy3+wuuOnUog2QBHCZWXDRijWQfAkhBj2Uf5UnVaiWwA5vdd82w==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "hasown": "^2.0.2", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/formidable": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/formidable/-/formidable-2.1.5.tgz", + "integrity": "sha512-Oz5Hwvwak/DCaXVVUtPn4oLMLLy1CdclLKO1LFgU7XzDpVMUU5UjlSLpGMocyQNNk8F6IJW9M/YdooSn2MRI+Q==", + "license": "MIT", + "dependencies": { + "@paralleldrive/cuid2": "^2.2.2", + "dezalgo": "^1.0.4", + "once": "^1.4.0", + "qs": "^6.11.0" + }, + "funding": { + "url": "https://ko-fi.com/tunnckoCore/commissions" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "uc.micro": "^2.0.0" + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", + "dev": true, + "license": "MIT" + }, + "node_modules/lunr": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/lunr/-/lunr-2.3.9.tgz", + "integrity": "sha512-zTU3DaZaF3Rt9rhN3uBMGQD3dD2/vFQqnvZCDv4dl5iOzq2IZQqTxu90r4E5J+nP70J3ilqVCrbho2eWaeW8Ow==", + "dev": true, + "license": "MIT" + }, + "node_modules/magic-bytes.js": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/magic-bytes.js/-/magic-bytes.js-1.12.1.tgz", + "integrity": "sha512-ThQLOhN86ZkJ7qemtVRGYM+gRgR8GEXNli9H/PMvpnZsE44Xfh3wx9kGJaldg314v85m+bFW6WBMaVHJc/c3zA==", + "dev": true, + "license": "MIT" + }, + "node_modules/markdown-it": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/mc-server-management": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/mc-server-management/-/mc-server-management-3.2.1.tgz", + "integrity": "sha512-T50v/P/+g7GVEsvO7EZR0seOh6SQ9JiGuk9SfPOzbUOrf2P0LwMuvGU+6GlO3sjxfsqSNsAUoU6SD/g+zdgm9Q==", + "license": "MIT", + "dependencies": { + "eventemitter3": "^5.0.1", + "rpc-websockets": "^9.3.0", + "semver": "^7.7.3" + }, + "engines": { + "node": ">=22.0.0" + } + }, + "node_modules/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "dev": true, + "license": "MIT" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", + "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/minimatch": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", + "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/ms-utility": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/ms-utility/-/ms-utility-3.3.0.tgz", + "integrity": "sha512-PM1brH9z25ICcU17rK8yLwjH5sekCHs1xiftUTKmkoSlBY+F/l7G+zyUMmZ148SkVwOPb0qDGZgawKvELJ+klQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/node-gyp-build": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", + "license": "MIT", + "optional": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, + "node_modules/node-mcstatus": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/node-mcstatus/-/node-mcstatus-1.2.1.tgz", + "integrity": "sha512-nEZjbxWiOg7D77jrH/Qqd1atRdmITGFInIFg4iEh+uEH0jBCuIL2gFL0m71i8OfgdgNJGEPRrRsNpQ9/pzfPow==", + "license": "MIT", + "dependencies": { + "superagent": "^8.0.9", + "zod": "^3.20.6" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/qs": { + "version": "6.14.1", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.1.tgz", + "integrity": "sha512-4EK3+xJl8Ts67nLYNwqw/dsFVnCf+qR7RgXSK9jEEm9unao3njwMDdmsdvoKBKHzxd7tCYz5e5M+SnMjdtXGQQ==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/rpc-websockets": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.3.2.tgz", + "integrity": "sha512-VuW2xJDnl1k8n8kjbdRSWawPRkwaVqUQNjE1TdeTawf0y0abGhtVJFTXCLfgpgGDBkO/Fj6kny8Dc/nvOW78MA==", + "license": "LGPL-3.0-only", + "dependencies": { + "@swc/helpers": "^0.5.11", + "@types/uuid": "^8.3.4", + "@types/ws": "^8.2.2", + "buffer": "^6.0.3", + "eventemitter3": "^5.0.1", + "uuid": "^8.3.2", + "ws": "^8.5.0" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/kozjak" + }, + "optionalDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + } + }, + "node_modules/semver": { + "version": "7.7.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.3.tgz", + "integrity": "sha512-SdsKMrI9TdgjdweUSR9MweHA4EJ8YxHn8DFaDisvhVlUOe4BF1tLD7GAj0lIqWVl+dPb/rExr0Btby5loQm20Q==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/superagent": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.1.2.tgz", + "integrity": "sha512-6WTxW1EB6yCxV5VFOIPQruWGHqc3yI7hEmZK6h+pyk69Lk/Ut7rLUY6W/ONF2MjBuGjvmMiIpsrVJ2vjrHlslA==", + "deprecated": "Please upgrade to superagent v10.2.2+, see release notes at https://github.com/forwardemail/superagent/releases/tag/v10.2.2 - maintenance is supported by Forward Email @ https://forwardemail.net", + "license": "MIT", + "dependencies": { + "component-emitter": "^1.3.0", + "cookiejar": "^2.1.4", + "debug": "^4.3.4", + "fast-safe-stringify": "^2.1.1", + "form-data": "^4.0.0", + "formidable": "^2.1.2", + "methods": "^1.1.2", + "mime": "2.6.0", + "qs": "^6.11.0", + "semver": "^7.3.8" + }, + "engines": { + "node": ">=6.4.0 <13 || >=14" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tiny-typed-emitter": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tiny-typed-emitter/-/tiny-typed-emitter-2.1.0.tgz", + "integrity": "sha512-qVtvMxeXbVej0cQWKqVSSAHmKZEHAvxdF8HEUBFWts8h+xEo5m/lEiPakuyZ3BnCBjOD8i24kzNOiOLLgsSxhA==", + "license": "MIT" + }, + "node_modules/ts-mixer": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/ts-mixer/-/ts-mixer-6.0.4.tgz", + "integrity": "sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" + }, + "node_modules/typedoc": { + "version": "0.28.15", + "resolved": "https://registry.npmjs.org/typedoc/-/typedoc-0.28.15.tgz", + "integrity": "sha512-mw2/2vTL7MlT+BVo43lOsufkkd2CJO4zeOSuWQQsiXoV2VuEn7f6IZp2jsUDPmBMABpgR0R5jlcJ2OGEFYmkyg==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "@gerrit0/mini-shiki": "^3.17.0", + "lunr": "^2.3.9", + "markdown-it": "^14.1.0", + "minimatch": "^9.0.5", + "yaml": "^2.8.1" + }, + "bin": { + "typedoc": "bin/typedoc" + }, + "engines": { + "node": ">= 18", + "pnpm": ">= 10" + }, + "peerDependencies": { + "typescript": "5.0.x || 5.1.x || 5.2.x || 5.3.x || 5.4.x || 5.5.x || 5.6.x || 5.7.x || 5.8.x || 5.9.x" + } + }, + "node_modules/typescript": { + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "dev": true, + "license": "Apache-2.0", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=14.17" + } + }, + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "dev": true, + "license": "MIT" + }, + "node_modules/undici": { + "version": "5.29.0", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.29.0.tgz", + "integrity": "sha512-raqeBD6NQK4SkWhQzeYKd1KmIG6dllBOTt55Rmkt4HtI9mwdWtJljnrXjAFUBLTSN67HWrOIZ3EPF4kjUw80Bg==", + "dev": true, + "license": "MIT", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "node_modules/undici-types": { + "version": "7.16.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-7.16.0.tgz", + "integrity": "sha512-Zz+aZWSj8LE6zoxD+xrjh4VfkIG8Ya6LvYkZqtUQGJPZjYl53ypCaUwWqo7eI0x66KBGeRo+mlBEkMSeSZ38Nw==", + "license": "MIT" + }, + "node_modules/utf-8-validate": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", + "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/ws": { + "version": "8.18.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.3.tgz", + "integrity": "sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/yaml": { + "version": "2.8.2", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.8.2.tgz", + "integrity": "sha512-mplynKqc1C2hTVYxd0PU2xQAc22TI1vShAYGksCCfxbn/dFwnHTNi1bvYsBTkhdUNtGIf5xNOg938rrSSYvS9A==", + "dev": true, + "license": "ISC", + "bin": { + "yaml": "bin.mjs" + }, + "engines": { + "node": ">= 14.6" + }, + "funding": { + "url": "https://github.com/sponsors/eemeli" + } + }, + "node_modules/zod": { + "version": "3.25.76", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.25.76.tgz", + "integrity": "sha512-gzUt/qt81nXsFGKIFcC3YnfEAx5NkunCfnDlvuBSSFS02bcXu4Lmea0AFIUwbLWxWPx3d9p8S5QoaujKcNQxcQ==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..b3e6111 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "@tryforge/forge.minecraft", + "version": "1.0.0", + "description": "ForgeMinecraft is an extension that provides real-time Minecraft server management via the management server protocol, alongside various functions for retrieving status and metadata from Java and Bedrock servers.", + "main": "dist/index.js", + "scripts": { + "docgen": "tsc && typedoc src/index.ts && node dist/docgen", + "commit": "npm run docgen && node dist/commit", + "test": "tsc && node dist/__tests__/" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/tryforge/ForgeMinecraft.git" + }, + "keywords": [], + "author": "itsnicky.", + "license": "GPL-3.0", + "devDependencies": { + "@tryforge/forgescript": "^2.5.0", + "typedoc": "^0.28.15", + "typescript": "^5.6.3" + }, + "dependencies": { + "mc-server-management": "^3.2.1", + "node-mcstatus": "^1.2.1", + "tiny-typed-emitter": "^2.1.0" + } +} diff --git a/src/commit.ts b/src/commit.ts new file mode 100644 index 0000000..f7e616c --- /dev/null +++ b/src/commit.ts @@ -0,0 +1,68 @@ +import { execSync } from "child_process" +import { existsSync, mkdirSync, readFileSync, writeFileSync } from "fs" +import { stdin, stdout } from "process" +import { createInterface } from "readline" +import { join } from "path" +import { platform } from "os" + +const path = "./metadata" +if (!existsSync(path)) mkdirSync(path) + +const version = require("../package.json").version + +export async function prompt(q: string) { + const itf = createInterface(stdin, stdout) + return new Promise(r => { + itf.question(q, input => { + itf.close() + r(input) + }) + }) +} + +async function main() { + let skip = false + + const msg = (await prompt("Please write the commit message: ")).replace( + /(--?(\w+))/gim, (match) => { + const name = /(\w+)/.exec(match)![1].toLowerCase() + + switch (name) { + case "hide": { + skip = true + break + } + + default: { + throw new Error(`--${name} is not a valid flag.`) + } + } + + return "" + } + ).trim() + + const fileName = join(path, "changelogs.json") + const json: Record = existsSync(fileName) ? JSON.parse(readFileSync(fileName, "utf-8")) : {} + json[version] ??= [] + const author = execSync("git config user.name").toString().trim() + if (!skip) { + json[version].unshift({ + message: msg, + timestamp: new Date(), + author + }) + writeFileSync(fileName, JSON.stringify(json), "utf-8") + } + + const branch = await prompt("Write the branch name to push to (defaults to dev): ") || "dev" + let escapedMsg = msg + if (platform() === "darwin") escapedMsg = escapedMsg.replace(/\$/g, "\\$") + + execSync("git branch -M " + branch + " && git add . && git commit -m \"" + escapedMsg + "\" && git push -u origin " + branch, { + stdio: "inherit" + }) +} + +// Nothing +main() \ No newline at end of file diff --git a/src/constants.ts b/src/constants.ts new file mode 100644 index 0000000..92b411c --- /dev/null +++ b/src/constants.ts @@ -0,0 +1 @@ +export const ForgeMinecraftEventHandlerName = "ForgeMinecraftEvents" \ No newline at end of file diff --git a/src/docgen.ts b/src/docgen.ts new file mode 100644 index 0000000..5977d8f --- /dev/null +++ b/src/docgen.ts @@ -0,0 +1,11 @@ +import { generateMetadata } from "@tryforge/forgescript" +import { ForgeMinecraftEventHandlerName } from "./constants" + +generateMetadata( + `${__dirname}/native`, + "native", + ForgeMinecraftEventHandlerName, + undefined, + undefined, + `${__dirname}/events` +) \ No newline at end of file diff --git a/src/events/allowListAdded.ts b/src/events/allowListAdded.ts new file mode 100644 index 0000000..3e2c4dc --- /dev/null +++ b/src/events/allowListAdded.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "allowListAdded", + version: "1.0.0", + description: "This event is fired when a player was added to the allow list", + listener: async function(obj) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("allowListAdded") + + for (const command of commands) { + const ctx = new Context({ + obj, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/allowListRemoved.ts b/src/events/allowListRemoved.ts new file mode 100644 index 0000000..613ce90 --- /dev/null +++ b/src/events/allowListRemoved.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "allowListRemoved", + version: "1.0.0", + description: "This event is fired when a player was removed from the allow list", + listener: async function(obj) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("allowListRemoved") + + for (const command of commands) { + const ctx = new Context({ + obj, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/banAdded.ts b/src/events/banAdded.ts new file mode 100644 index 0000000..267b7b3 --- /dev/null +++ b/src/events/banAdded.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "banAdded", + version: "1.0.0", + description: "This event is fired when a player was banned", + listener: async function(obj) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("banAdded") + + for (const command of commands) { + const ctx = new Context({ + obj, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/banRemoved.ts b/src/events/banRemoved.ts new file mode 100644 index 0000000..2292374 --- /dev/null +++ b/src/events/banRemoved.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "banRemoved", + version: "1.0.0", + description: "This event is fired when a player was unbanned", + listener: async function(obj) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("banRemoved") + + for (const command of commands) { + const ctx = new Context({ + obj, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/connected.ts b/src/events/connected.ts new file mode 100644 index 0000000..68631a2 --- /dev/null +++ b/src/events/connected.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "connected", + version: "1.0.0", + description: "This event is fired when the management server has connected", + listener: async function() { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("connected") + + for (const command of commands) { + const ctx = new Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/disconnected.ts b/src/events/disconnected.ts new file mode 100644 index 0000000..3bed03d --- /dev/null +++ b/src/events/disconnected.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "disconnected", + version: "1.0.0", + description: "This event is fired when the management server has disconnected", + listener: async function() { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("disconnected") + + for (const command of commands) { + const ctx = new Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/error.ts b/src/events/error.ts new file mode 100644 index 0000000..b56f19a --- /dev/null +++ b/src/events/error.ts @@ -0,0 +1,24 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "error", + version: "1.0.0", + description: "This event is fired when an error occurred", + listener: async function(err) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("error") + + for (const command of commands) { + const ctx = new Context({ + obj: {}, + command, + client: this, + extras: err.message, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/gameRuleUpdated.ts b/src/events/gameRuleUpdated.ts new file mode 100644 index 0000000..85de414 --- /dev/null +++ b/src/events/gameRuleUpdated.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "gameRuleUpdated", + version: "1.0.0", + description: "This event is fired when a game rule was updated", + listener: async function(obj) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("gameRuleUpdated") + + for (const command of commands) { + const ctx = new Context({ + obj, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/ipBanAdded.ts b/src/events/ipBanAdded.ts new file mode 100644 index 0000000..e7427f0 --- /dev/null +++ b/src/events/ipBanAdded.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "ipBanAdded", + version: "1.0.0", + description: "This event is fired when an IP was banned", + listener: async function(obj) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("ipBanAdded") + + for (const command of commands) { + const ctx = new Context({ + obj, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/ipBanRemoved.ts b/src/events/ipBanRemoved.ts new file mode 100644 index 0000000..3c7dba0 --- /dev/null +++ b/src/events/ipBanRemoved.ts @@ -0,0 +1,25 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." +import { IPBan } from "mc-server-management" + +export default new MinecraftEventHandler({ + name: "ipBanRemoved", + version: "1.0.0", + description: "This event is fired when an IP was unbanned", + listener: async function(ip) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("ipBanRemoved") + const ban = new IPBan(ip) + + for (const command of commands) { + const ctx = new Context({ + obj: ban, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/operatorAdded.ts b/src/events/operatorAdded.ts new file mode 100644 index 0000000..eac1912 --- /dev/null +++ b/src/events/operatorAdded.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "operatorAdded", + version: "1.0.0", + description: "This event is fired when an operator was added", + listener: async function(obj) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("operatorAdded") + + for (const command of commands) { + const ctx = new Context({ + obj, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/operatorRemoved.ts b/src/events/operatorRemoved.ts new file mode 100644 index 0000000..fe88a2f --- /dev/null +++ b/src/events/operatorRemoved.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "operatorRemoved", + version: "1.0.0", + description: "This event is fired when an operator was removed", + listener: async function(obj) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("operatorRemoved") + + for (const command of commands) { + const ctx = new Context({ + obj, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/playerJoined.ts b/src/events/playerJoined.ts new file mode 100644 index 0000000..c41240b --- /dev/null +++ b/src/events/playerJoined.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "playerJoined", + version: "1.0.0", + description: "This event is fired when a player has joined the server", + listener: async function(obj) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("playerJoined") + + for (const command of commands) { + const ctx = new Context({ + obj, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/playerLeft.ts b/src/events/playerLeft.ts new file mode 100644 index 0000000..4788f95 --- /dev/null +++ b/src/events/playerLeft.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "playerLeft", + version: "1.0.0", + description: "This event is fired when a player has left the server", + listener: async function(obj) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("playerLeft") + + for (const command of commands) { + const ctx = new Context({ + obj, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/reconnecting.ts b/src/events/reconnecting.ts new file mode 100644 index 0000000..44c89a7 --- /dev/null +++ b/src/events/reconnecting.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "reconnecting", + version: "1.0.0", + description: "This event is fired when the management server is reconnecting", + listener: async function() { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("reconnecting") + + for (const command of commands) { + const ctx = new Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/serverActivity.ts b/src/events/serverActivity.ts new file mode 100644 index 0000000..009902c --- /dev/null +++ b/src/events/serverActivity.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "serverActivity", + version: "1.0.0", + description: "This event is fired when a network connection to the server has been initiated", + listener: async function() { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("serverActivity") + + for (const command of commands) { + const ctx = new Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/serverSaved.ts b/src/events/serverSaved.ts new file mode 100644 index 0000000..942e4e8 --- /dev/null +++ b/src/events/serverSaved.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "serverSaved", + version: "1.0.0", + description: "This event is fired when the server was saved", + listener: async function() { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("serverSaved") + + for (const command of commands) { + const ctx = new Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/serverSaving.ts b/src/events/serverSaving.ts new file mode 100644 index 0000000..9f3b8ae --- /dev/null +++ b/src/events/serverSaving.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "serverSaving", + version: "1.0.0", + description: "This event is fired when the server is saving", + listener: async function() { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("serverSaving") + + for (const command of commands) { + const ctx = new Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/serverStarted.ts b/src/events/serverStarted.ts new file mode 100644 index 0000000..5cfe929 --- /dev/null +++ b/src/events/serverStarted.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "serverStarted", + version: "1.0.0", + description: "This event is fired when the server has started", + listener: async function() { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("serverStarted") + + for (const command of commands) { + const ctx = new Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/serverStatus.ts b/src/events/serverStatus.ts new file mode 100644 index 0000000..ab8cc53 --- /dev/null +++ b/src/events/serverStatus.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "serverStatus", + version: "1.0.0", + description: "This event is fired when the server status was received", + listener: async function(obj) { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("serverStatus") + + for (const command of commands) { + const ctx = new Context({ + obj, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/events/serverStopping.ts b/src/events/serverStopping.ts new file mode 100644 index 0000000..2d08fd8 --- /dev/null +++ b/src/events/serverStopping.ts @@ -0,0 +1,23 @@ +import { Interpreter } from "@tryforge/forgescript" +import { MinecraftEventHandler } from "../handlers" +import { Context, ForgeMinecraft } from ".." + +export default new MinecraftEventHandler({ + name: "serverStopping", + version: "1.0.0", + description: "This event is fired when the server is stopping", + listener: async function() { + const commands = this.getExtension(ForgeMinecraft, true).commands.get("serverStopping") + + for (const command of commands) { + const ctx = new Context({ + obj: {}, + command, + client: this, + data: command.compiled.code, + }) + + Interpreter.run(ctx) + } + }, +}) \ No newline at end of file diff --git a/src/functions/array.ts b/src/functions/array.ts new file mode 100644 index 0000000..0e09d02 --- /dev/null +++ b/src/functions/array.ts @@ -0,0 +1,5 @@ +import { ArgType } from "@tryforge/forgescript" + +export default function(value?: any) { + return value ?? null +} \ No newline at end of file diff --git a/src/functions/contextNoop.ts b/src/functions/contextNoop.ts new file mode 100644 index 0000000..655e8ac --- /dev/null +++ b/src/functions/contextNoop.ts @@ -0,0 +1,9 @@ +import { Context, Logger } from "@tryforge/forgescript" + +export default function(this: Context, ...args: any[]) { + if (this.hasDisabledConsoleErrors()) { + return + } + + Logger.error("[ForgeMinecraft]", ...args) +} \ No newline at end of file diff --git a/src/functions/convertEnum.ts b/src/functions/convertEnum.ts new file mode 100644 index 0000000..d45c78d --- /dev/null +++ b/src/functions/convertEnum.ts @@ -0,0 +1,11 @@ +import { EnumLike } from "@tryforge/forgescript" + +/** + * Converts an enum string value into an enum key. + * @param en The enum to convert the value into. + * @param value The value to convert. + * @returns + */ +export default function(en: Enum, value: string) { + return (Object.keys(en) as (keyof Enum)[]).find((key) => en[key] === value) +} \ No newline at end of file diff --git a/src/functions/defineProperties.ts b/src/functions/defineProperties.ts new file mode 100644 index 0000000..14f855d --- /dev/null +++ b/src/functions/defineProperties.ts @@ -0,0 +1,9 @@ +import { EnumLike } from "@tryforge/forgescript" + +export type Properties = { + [P in keyof Enum]: (v?: Type | null, sep?: string | null, index?: number | null) => null | undefined | string | number | boolean +} + +export default function defineProperties(props: Properties) { + return props +} \ No newline at end of file diff --git a/src/functions/isUUID.ts b/src/functions/isUUID.ts new file mode 100644 index 0000000..071d471 --- /dev/null +++ b/src/functions/isUUID.ts @@ -0,0 +1,11 @@ +export const UUIDRegex = /^[0-9a-f]{8}-[0-9a-f]{4}-4[0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}$/i +export const UUIDRegexNoDashes = /^[0-9a-f]{32}$/i + +/** + * Returns whether the given value is a valid UUID. + * @param value The value to check. + * @returns + */ +export default function(value: string) { + return UUIDRegex.test(value) || UUIDRegexNoDashes.test(value) +} \ No newline at end of file diff --git a/src/functions/noop.ts b/src/functions/noop.ts new file mode 100644 index 0000000..6c53e68 --- /dev/null +++ b/src/functions/noop.ts @@ -0,0 +1,5 @@ +import { Logger } from "@tryforge/forgescript" + +export default (...args: any[]) => { + Logger.error("[ForgeMinecraft]", ...args) +} \ No newline at end of file diff --git a/src/functions/parsePlayer.ts b/src/functions/parsePlayer.ts new file mode 100644 index 0000000..62bea2d --- /dev/null +++ b/src/functions/parsePlayer.ts @@ -0,0 +1,11 @@ +import { Player } from "mc-server-management" +import isUUID from "./isUUID" + +/** + * Parses a player input into a Player instance. + * @param value The value to parse. + * @returns + */ +export default function(value: string) { + return (isUUID(value) ? Player.withId(value) : Player.withName(value)) +} \ No newline at end of file diff --git a/src/functions/resolveStatus.ts b/src/functions/resolveStatus.ts new file mode 100644 index 0000000..415e47b --- /dev/null +++ b/src/functions/resolveStatus.ts @@ -0,0 +1,20 @@ +/** + * Resolves to a status response from a Minecraft server. + * @param resolver The resolver function. + * @param defaults The default server options. + * @param host The host domain of the server. + * @param port The port for the host domain. + * @returns + */ +export default async function( + resolver: (host: string, port?: number) => Promise, + defaults: { host?: string; port?: number } | undefined, + host?: string | null, + port?: number +) { + host ||= defaults?.host + port ??= defaults?.port + + if (!host) return null + return resolver(host, port) +} \ No newline at end of file diff --git a/src/functions/transformEnum.ts b/src/functions/transformEnum.ts new file mode 100644 index 0000000..582a422 --- /dev/null +++ b/src/functions/transformEnum.ts @@ -0,0 +1,14 @@ +import { EnumLike } from "@tryforge/forgescript" + +/** + * Transforms an enum value from one enum to another. + * @param fromValue The value to transform. + * @param toEnum The enum to transform the value into. + * @returns + */ +export default function( + fromValue: From[keyof From], + toEnum: To +): To[keyof To] { + return Object.values(toEnum).find((v) => v === fromValue) +} \ No newline at end of file diff --git a/src/handlers/MinecraftEventHandler.ts b/src/handlers/MinecraftEventHandler.ts new file mode 100644 index 0000000..be8ed8b --- /dev/null +++ b/src/handlers/MinecraftEventHandler.ts @@ -0,0 +1,34 @@ +import { GameRuleType, IPBan, Operator, Player, ServerState, TypedGameRule, UserBan } from "mc-server-management" +import { BaseEventHandler, ForgeClient } from "@tryforge/forgescript" +import { ForgeMinecraft } from ".." + +export interface IMinecraftEvents { + error: [Error] + connected: [] + reconnecting: [] + disconnected: [] + serverStarted: [] + serverStopping: [] + serverSaving: [] + serverSaved: [] + serverActivity: [] + serverStatus: [ServerState], + playerJoined: [Player] + playerLeft: [Player] + operatorAdded: [Operator] + operatorRemoved: [Operator] + allowListAdded: [Player] + allowListRemoved: [Player] + banAdded: [UserBan] + banRemoved: [Player] + ipBanAdded: [IPBan] + ipBanRemoved: [string] + gameRuleUpdated: [TypedGameRule] +} + +export class MinecraftEventHandler extends BaseEventHandler { + register(client: ForgeClient) { + // @ts-ignore + client.getExtension(ForgeMinecraft, true).emitter.on(this.name, this.listener.bind(client)) + } +} \ No newline at end of file diff --git a/src/handlers/index.ts b/src/handlers/index.ts new file mode 100644 index 0000000..af25430 --- /dev/null +++ b/src/handlers/index.ts @@ -0,0 +1 @@ +export * from "./MinecraftEventHandler" \ No newline at end of file diff --git a/src/index.ts b/src/index.ts new file mode 100644 index 0000000..c2a4ea6 --- /dev/null +++ b/src/index.ts @@ -0,0 +1,160 @@ +import { EventManager, ForgeClient, ForgeExtension } from "@tryforge/forgescript" +import { MinecraftServer } from "mc-server-management" +import { statusBedrock, statusJava } from "node-mcstatus" +import { TypedEmitter } from "tiny-typed-emitter" +import { description, version } from "../package.json" +import { MinecraftCommandManager, MinecraftConnectionManager } from "./managers" +import { ForgeMinecraftEventHandlerName } from "./constants" +import { IMinecraftEvents } from "./handlers" +import resolveStatus from "./functions/resolveStatus" + +export interface IManagementServerOptions { + /** + * The host domain of the server. + */ + host: string + + /** + * The port for the host connection. + */ + port: number + + /** + * The token needed to connect to the server. + */ + token: string + + /** + * Whether to automatically reconnect to the server if the connection is lost. + * @default true + */ + reconnect?: boolean + + /** + * The interval in ms used to reconnect to the server. + * @default 1000 + */ + reconnectInterval?: number + + /** + * The maximum number of times to attempt to reconnect to the server. Set to `0` for infinite attempts. + * @default 5 + */ + maxReconnectAttempts?: number +} + +export interface IJavaServerOptions { + /** + * The host domain of the server. + */ + host: string + + /** + * The port for the host domain. + * @default 25565 + */ + port?: number +} + +export interface IBedrockServerOptions { + /** + * The host domain of the server. + */ + host: string + + /** + * The port for the host domain. + * @default 19132 + */ + port?: number +} + +export interface IForgeMinecraftOptions { + /** + * The events to receive from the management server. + */ + events?: Array + + /** + * The management server options used to establish a connection. + */ + server?: IManagementServerOptions + + /** + * The default Java server options to use for java functions. + */ + java?: IJavaServerOptions + + /** + * The default Bedrock server options to use for bedrock functions. + */ + bedrock?: IBedrockServerOptions +} + +export type TransformEvents = { + [P in keyof T]: T[P] extends any[] ? (...args: T[P]) => any : never +} + +export class ForgeMinecraft extends ForgeExtension { + name = "forge.minecraft" + description = description + version = version + + public server?: MinecraftServer + public commands!: MinecraftCommandManager + + private manager?: MinecraftConnectionManager + private emitter = new TypedEmitter>() + + public constructor(public readonly options: IForgeMinecraftOptions = {}) { + super() + } + + /** + * Gets the status response of a Java Minecraft server. Uses the `java` client options if no parameters are provided. + * @param host The host domain of the server. + * @param port The port for the host domain. + * @returns + */ + public async getJavaStatus(host?: string | null, port?: number) { + return resolveStatus(statusJava, this.options.java, host, port) + } + + /** + * Gets the status response of a Bedrock Minecraft server. Uses the `bedrock` client options if no parameters are provided. + * @param host The host domain of the server. + * @param port The port for the host domain. + * @returns + */ + public async getBedrockStatus(host?: string | null, port?: number) { + return resolveStatus(statusBedrock, this.options.bedrock, host, port) + } + + public async init(client: ForgeClient) { + client.minecraft = this + this.commands = new MinecraftCommandManager(client) + + if (this.options.server) { + this.manager = new MinecraftConnectionManager(this.options.server, this.emitter) + + this.manager.on("connected", (server) => { + this.server = server + }) + + this.manager.connect(client) + } + + EventManager.load(ForgeMinecraftEventHandlerName, __dirname + `/events`) + this.load(__dirname + `/native`) + + if (this.options.events?.length) { + client.events.load(ForgeMinecraftEventHandlerName, this.options.events) + } + } +} + +export * from "./handlers" +export * from "./managers" +export * from "./structures" +export * from "./constants" +export * from "./types" \ No newline at end of file diff --git a/src/managers/MinecraftCommandManager.ts b/src/managers/MinecraftCommandManager.ts new file mode 100644 index 0000000..ee5c445 --- /dev/null +++ b/src/managers/MinecraftCommandManager.ts @@ -0,0 +1,7 @@ +import { BaseCommandManager } from "@tryforge/forgescript" +import { IMinecraftEvents } from "../handlers" +import { ForgeMinecraftEventHandlerName } from "../constants" + +export class MinecraftCommandManager extends BaseCommandManager { + handlerName = ForgeMinecraftEventHandlerName +} \ No newline at end of file diff --git a/src/managers/MinecraftConnectionManager.ts b/src/managers/MinecraftConnectionManager.ts new file mode 100644 index 0000000..938dbae --- /dev/null +++ b/src/managers/MinecraftConnectionManager.ts @@ -0,0 +1,111 @@ +import { EventData, MinecraftServer, Notifications, WebSocketConnection } from "mc-server-management" +import { ForgeClient, Logger } from "@tryforge/forgescript" +import { TypedEmitter } from "tiny-typed-emitter" +import { IMinecraftEvents } from "../handlers" +import { IManagementServerOptions, TransformEvents } from "../index" + +export interface IConnectionEvents { + connected: (server: MinecraftServer) => void + reconnecting: () => void + disconnected: () => void +} + +export class MinecraftConnectionManager extends TypedEmitter { + public connection?: WebSocketConnection + public server?: MinecraftServer + + constructor( + private readonly options: IManagementServerOptions, + private readonly emitter: TypedEmitter> + ) { + super() + } + + public async connect(client: ForgeClient) { + Logger.info("[ForgeMinecraft] Connecting to management server...") + + const { host, port, token, reconnect, reconnectInterval, maxReconnectAttempts } = this.options + const connection = await WebSocketConnection.connect(`ws://${host}:${port}`, token, { + reconnect, + reconnect_interval: reconnectInterval, + max_reconnects: maxReconnectAttempts + }).catch(() => undefined) + + if (!connection) { + Logger.warn("[ForgeMinecraft] Management connection could not be established.") + return + } + + this.connection = connection + this.server = new MinecraftServer(connection) + + Logger.info("[ForgeMinecraft] Management connection established.") + + this._attachSocketListeners(connection) + this.emit("connected", this.server) + + const onReady = () => { + this.emitter.emit("connected") + this._attachServerListeners(this.server!) + } + + if (client.isReady() as boolean) onReady() + else client.once("clientReady", () => onReady()) + } + + private _attachSocketListeners(connection: WebSocketConnection) { + connection.on("open", () => { + Logger.info("[ForgeMinecraft] Management connection established.") + this.emitter.emit("connected") + }) + + connection.on("close", () => { + Logger.warn("[ForgeMinecraft] Management connection closed.") + // this.emit("disconnected") + this.emitter.emit("disconnected") + + if (this.options.reconnect !== false) { + Logger.info("[ForgeMinecraft] Reconnecting to management server...") + // this.emit("reconnecting") + this.emitter.emit("reconnecting") + } + }) + + connection.on("max_reconnects_reached", () => { + Logger.warn("[ForgeMinecraft] Maximum reconnect attempts reached. Connection closed.") + }) + + connection.on("error", (err) => { + Logger.debug("[ForgeMinecraft] Management socket error:", err.message) + }) + } + + private _attachServerListeners(server: MinecraftServer) { + const events: Array<[keyof EventData, keyof IMinecraftEvents]> = [ + ["error", "error"], + [Notifications.ALLOWLIST_ADDED, "allowListAdded"], + [Notifications.ALLOWLIST_REMOVED, "allowListRemoved"], + [Notifications.BAN_ADDED, "banAdded"], + [Notifications.BAN_REMOVED, "banRemoved"], + [Notifications.GAME_RULE_UPDATED, "gameRuleUpdated"], + [Notifications.IP_BAN_ADDED, "ipBanAdded"], + [Notifications.IP_BAN_REMOVED, "ipBanRemoved"], + [Notifications.OPERATOR_ADDED, "operatorAdded"], + [Notifications.OPERATOR_REMOVED, "operatorRemoved"], + [Notifications.PLAYER_JOINED, "playerJoined"], + [Notifications.PLAYER_LEFT, "playerLeft"], + [Notifications.SERVER_ACTIVITY, "serverActivity"], + [Notifications.SERVER_SAVED, "serverSaved"], + [Notifications.SERVER_SAVING, "serverSaving"], + [Notifications.SERVER_STARTED, "serverStarted"], + [Notifications.SERVER_STATUS, "serverStatus"], + [Notifications.SERVER_STOPPING, "serverStopping"] + ] + + for (const [event, targetEvent] of events) { + server.on(event, (...data) => { + this.emitter.emit(targetEvent, ...data) + }) + } + } +} \ No newline at end of file diff --git a/src/managers/index.ts b/src/managers/index.ts new file mode 100644 index 0000000..a3c3ab2 --- /dev/null +++ b/src/managers/index.ts @@ -0,0 +1,2 @@ +export * from "./MinecraftCommandManager" +export * from "./MinecraftConnectionManager" \ No newline at end of file diff --git a/src/native/bedrock/bedrockEdition.ts b/src/native/bedrock/bedrockEdition.ts new file mode 100644 index 0000000..4c748e1 --- /dev/null +++ b/src/native/bedrock/bedrockEdition.ts @@ -0,0 +1,32 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export enum BedrockEdition { + MCPE, + MCEE +} + +export default new NativeFunction({ + name: "$bedrockEdition", + version: "1.0.0", + description: "Returns the edition of a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: BedrockEdition, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.edition) + } +}) \ No newline at end of file diff --git a/src/native/bedrock/bedrockEulaBlocked.ts b/src/native/bedrock/bedrockEulaBlocked.ts new file mode 100644 index 0000000..f51bf92 --- /dev/null +++ b/src/native/bedrock/bedrockEulaBlocked.ts @@ -0,0 +1,27 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$bedrockEulaBlocked", + version: "1.0.0", + description: "Returns whether a bedrock server has EULA blocked", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.Boolean, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.eula_blocked) + } +}) \ No newline at end of file diff --git a/src/native/bedrock/bedrockGameMode.ts b/src/native/bedrock/bedrockGameMode.ts new file mode 100644 index 0000000..4106f02 --- /dev/null +++ b/src/native/bedrock/bedrockGameMode.ts @@ -0,0 +1,28 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { GameMode } from "../../types" + +export default new NativeFunction({ + name: "$bedrockGameMode", + version: "1.0.0", + description: "Returns the game mode of a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: GameMode, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.gamemode) + } +}) \ No newline at end of file diff --git a/src/native/bedrock/bedrockHost.ts b/src/native/bedrock/bedrockHost.ts new file mode 100644 index 0000000..2f0ec5b --- /dev/null +++ b/src/native/bedrock/bedrockHost.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$bedrockHost", + version: "1.0.0", + description: "Returns the host name of the bedrock server", + unwrap: false, + output: ArgType.String, + async execute(ctx) { + return this.success((await ctx.client.minecraft.getBedrockStatus().catch(ctx.noop))?.host) + } +}) \ No newline at end of file diff --git a/src/native/bedrock/bedrockIPAddress.ts b/src/native/bedrock/bedrockIPAddress.ts new file mode 100644 index 0000000..59022f9 --- /dev/null +++ b/src/native/bedrock/bedrockIPAddress.ts @@ -0,0 +1,28 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$bedrockIPAddress", + version: "1.0.0", + description: "Returns the IP address of a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.String, + async execute(ctx, [host, port]) { + const status = await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop) + return this.success(status && "ip_address" in status ? status?.ip_address : null) + } +}) \ No newline at end of file diff --git a/src/native/bedrock/bedrockMOTD.ts b/src/native/bedrock/bedrockMOTD.ts new file mode 100644 index 0000000..15fe869 --- /dev/null +++ b/src/native/bedrock/bedrockMOTD.ts @@ -0,0 +1,40 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { MOTDProperty } from "../java/javaMOTD" + +export default new NativeFunction({ + name: "$bedrockMOTD", + version: "1.0.0", + description: "Returns the message of the day (MOTD) from a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: MOTDProperty, + }, + ], + output: [ + ArgType.Json, + ArgType.Unknown + ], + async execute(ctx, [host, port, prop]) { + const motd = (await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.motd + if (!motd || prop) return this.success(motd?.[prop!]) + return this.successJSON(motd) + } +}) \ No newline at end of file diff --git a/src/native/bedrock/bedrockMaxPlayers.ts b/src/native/bedrock/bedrockMaxPlayers.ts new file mode 100644 index 0000000..2a383e0 --- /dev/null +++ b/src/native/bedrock/bedrockMaxPlayers.ts @@ -0,0 +1,27 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$bedrockMaxPlayers", + version: "1.0.0", + description: "Returns the maximum amount of allowed players on a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.Number, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.players?.max) + } +}) \ No newline at end of file diff --git a/src/native/bedrock/bedrockPlayerCount.ts b/src/native/bedrock/bedrockPlayerCount.ts new file mode 100644 index 0000000..88b6983 --- /dev/null +++ b/src/native/bedrock/bedrockPlayerCount.ts @@ -0,0 +1,27 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$bedrockPlayerCount", + version: "1.0.0", + description: "Returns the online player count of a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.Number, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.players?.online) + } +}) \ No newline at end of file diff --git a/src/native/bedrock/bedrockPort.ts b/src/native/bedrock/bedrockPort.ts new file mode 100644 index 0000000..fc6fe81 --- /dev/null +++ b/src/native/bedrock/bedrockPort.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$bedrockPort", + version: "1.0.0", + description: "Returns the port of the bedrock server", + unwrap: false, + output: ArgType.Number, + async execute(ctx) { + return this.success((await ctx.client.minecraft.getBedrockStatus().catch(ctx.noop))?.port) + } +}) \ No newline at end of file diff --git a/src/native/bedrock/bedrockServerID.ts b/src/native/bedrock/bedrockServerID.ts new file mode 100644 index 0000000..ee18de3 --- /dev/null +++ b/src/native/bedrock/bedrockServerID.ts @@ -0,0 +1,27 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$bedrockServerID", + version: "1.0.0", + description: "Returns the server ID of a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.String, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.server_id) + } +}) \ No newline at end of file diff --git a/src/native/bedrock/bedrockServerOnline.ts b/src/native/bedrock/bedrockServerOnline.ts new file mode 100644 index 0000000..7946c3e --- /dev/null +++ b/src/native/bedrock/bedrockServerOnline.ts @@ -0,0 +1,27 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$bedrockServerOnline", + version: "1.0.0", + description: "Returns whether a bedrock server is online", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.Boolean, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.online) + } +}) \ No newline at end of file diff --git a/src/native/bedrock/bedrockVersion.ts b/src/native/bedrock/bedrockVersion.ts new file mode 100644 index 0000000..9ae932e --- /dev/null +++ b/src/native/bedrock/bedrockVersion.ts @@ -0,0 +1,40 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { VersionProperty } from "../management/getServerVersion" + +export default new NativeFunction({ + name: "$bedrockVersion", + version: "1.0.0", + description: "Returns the version of a bedrock server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: VersionProperty, + }, + ], + output: [ + ArgType.Json, + ArgType.Unknown + ], + async execute(ctx, [host, port, prop]) { + const version = (await ctx.client.minecraft.getBedrockStatus(host, port || undefined).catch(ctx.noop))?.version + if (!version || prop) return this.success(version?.[prop!]) + return this.successJSON(version) + } +}) \ No newline at end of file diff --git a/src/native/event/gameRule.ts b/src/native/event/gameRule.ts new file mode 100644 index 0000000..1831996 --- /dev/null +++ b/src/native/event/gameRule.ts @@ -0,0 +1,29 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { GameRuleProperties, GameRuleProperty } from "../../properties/gameRule" + +export default new NativeFunction({ + name: "$gameRule", + version: "1.0.0", + description: "Retrieves data from an event whose context was a game rule event", + unwrap: true, + brackets: false, + args: [ + { + name: "property", + description: "The property to pull", + rest: false, + required: true, + type: ArgType.Enum, + enum: GameRuleProperty, + }, + ], + output: [ + ArgType.Json, + ArgType.Unknown + ], + execute(ctx, [prop]) { + const rule = ctx.gameRule + if (!rule || prop) return this.success(GameRuleProperties[prop](rule)) + return this.successJSON(rule) + }, +}) \ No newline at end of file diff --git a/src/native/event/ipBan.ts b/src/native/event/ipBan.ts new file mode 100644 index 0000000..62bda66 --- /dev/null +++ b/src/native/event/ipBan.ts @@ -0,0 +1,29 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { IPBanProperties, IPBanProperty } from "../../properties/ban" + +export default new NativeFunction({ + name: "$ipBan", + version: "1.0.0", + description: "Retrieves data from an event whose context was an IP ban event", + unwrap: true, + brackets: false, + args: [ + { + name: "property", + description: "The property to pull", + rest: false, + required: true, + type: ArgType.Enum, + enum: IPBanProperty, + }, + ], + output: [ + ArgType.Json, + ArgType.Unknown + ], + execute(ctx, [prop]) { + const ban = ctx.ipBan + if (!ban || prop) return this.success(IPBanProperties[prop](ban)) + return this.successJSON(ban) + }, +}) \ No newline at end of file diff --git a/src/native/event/operator.ts b/src/native/event/operator.ts new file mode 100644 index 0000000..941f353 --- /dev/null +++ b/src/native/event/operator.ts @@ -0,0 +1,29 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { OperatorProperties, OperatorProperty } from "../../properties/operator" + +export default new NativeFunction({ + name: "$operator", + version: "1.0.0", + description: "Retrieves data from an event whose context was an operator event", + unwrap: true, + brackets: false, + args: [ + { + name: "property", + description: "The property to pull", + rest: false, + required: true, + type: ArgType.Enum, + enum: OperatorProperty, + }, + ], + output: [ + ArgType.Json, + ArgType.Unknown + ], + execute(ctx, [prop]) { + const operator = ctx.operator + if (!operator || prop) return this.success(OperatorProperties[prop](operator)) + return this.successJSON(operator) + }, +}) \ No newline at end of file diff --git a/src/native/event/player.ts b/src/native/event/player.ts new file mode 100644 index 0000000..4c18f54 --- /dev/null +++ b/src/native/event/player.ts @@ -0,0 +1,29 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { PlayerProperty } from "../management/getConnectedPlayers" + +export default new NativeFunction({ + name: "$player", + version: "1.0.0", + description: "Retrieves data from an event whose context was a player event", + unwrap: true, + brackets: false, + args: [ + { + name: "property", + description: "The property to pull", + rest: false, + required: true, + type: ArgType.Enum, + enum: PlayerProperty, + }, + ], + output: [ + ArgType.Json, + ArgType.Unknown + ], + execute(ctx, [prop]) { + const player = ctx.player + if (!player || prop) return this.success(player?.[prop]) + return this.successJSON(player) + }, +}) \ No newline at end of file diff --git a/src/native/event/playerBan.ts b/src/native/event/playerBan.ts new file mode 100644 index 0000000..dc25911 --- /dev/null +++ b/src/native/event/playerBan.ts @@ -0,0 +1,29 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { UserBanProperties, UserBanProperty } from "../../properties/ban" + +export default new NativeFunction({ + name: "$playerBan", + version: "1.0.0", + description: "Retrieves data from an event whose context was a player ban event", + unwrap: true, + brackets: false, + args: [ + { + name: "property", + description: "The property to pull", + rest: false, + required: true, + type: ArgType.Enum, + enum: UserBanProperty, + }, + ], + output: [ + ArgType.Json, + ArgType.Unknown + ], + execute(ctx, [prop]) { + const ban = ctx.userBan + if (!ban || prop) return this.success(UserBanProperties[prop](ban)) + return this.successJSON(ban) + }, +}) \ No newline at end of file diff --git a/src/native/event/serverState.ts b/src/native/event/serverState.ts new file mode 100644 index 0000000..485ef60 --- /dev/null +++ b/src/native/event/serverState.ts @@ -0,0 +1,35 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { ServerStateProperties, ServerStateProperty } from "../../properties/serverState" + +export default new NativeFunction({ + name: "$serverState", + version: "1.0.0", + description: "Retrieves data from an event whose context was a server status event", + unwrap: true, + brackets: false, + args: [ + { + name: "property", + description: "The property to pull", + rest: false, + required: true, + type: ArgType.Enum, + enum: ServerStateProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: ArgType.String, + }, + ], + output: [ + ArgType.Json, + ArgType.Unknown + ], + execute(ctx, [prop, sep]) { + const state = ctx.serverState + if (!state || prop) return this.success(ServerStateProperties[prop](state, sep)) + return this.successJSON(state) + }, +}) \ No newline at end of file diff --git a/src/native/java/javaEulaBlocked.ts b/src/native/java/javaEulaBlocked.ts new file mode 100644 index 0000000..7366bbf --- /dev/null +++ b/src/native/java/javaEulaBlocked.ts @@ -0,0 +1,27 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$javaEulaBlocked", + version: "1.0.0", + description: "Returns whether a java server has EULA blocked", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.Boolean, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.eula_blocked) + } +}) \ No newline at end of file diff --git a/src/native/java/javaHost.ts b/src/native/java/javaHost.ts new file mode 100644 index 0000000..160d6d1 --- /dev/null +++ b/src/native/java/javaHost.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$javaHost", + version: "1.0.0", + description: "Returns the host name of the java server", + unwrap: false, + output: ArgType.String, + async execute(ctx) { + return this.success((await ctx.client.minecraft.getJavaStatus().catch(ctx.noop))?.host) + } +}) \ No newline at end of file diff --git a/src/native/java/javaIPAddress.ts b/src/native/java/javaIPAddress.ts new file mode 100644 index 0000000..478a90b --- /dev/null +++ b/src/native/java/javaIPAddress.ts @@ -0,0 +1,28 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$javaIPAddress", + version: "1.0.0", + description: "Returns the IP address of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.String, + async execute(ctx, [host, port]) { + const status = await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop) + return this.success(status && "ip_address" in status ? status?.ip_address : null) + } +}) \ No newline at end of file diff --git a/src/native/java/javaIcon.ts b/src/native/java/javaIcon.ts new file mode 100644 index 0000000..239b15a --- /dev/null +++ b/src/native/java/javaIcon.ts @@ -0,0 +1,33 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { AttachmentBuilder } from "discord.js" + +export default new NativeFunction({ + name: "$javaIcon", + version: "1.0.0", + description: "Returns the icon of a java server as attachment", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.Attachment, + async execute(ctx, [host, port]) { + const icon = (await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.icon + if (icon) { + const buffer = Buffer.from(icon.split(",")[1], "base64") + ctx.container.files.push(new AttachmentBuilder(buffer).setName("icon.png")) + } + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/java/javaMOTD.ts b/src/native/java/javaMOTD.ts new file mode 100644 index 0000000..8070573 --- /dev/null +++ b/src/native/java/javaMOTD.ts @@ -0,0 +1,45 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export enum MOTDProperty { + Raw = "raw", + Clean = "clean", + Html = "html", +} + +export default new NativeFunction({ + name: "$javaMOTD", + version: "1.0.0", + description: "Returns the message of the day (MOTD) from a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: MOTDProperty, + }, + ], + output: [ + ArgType.Json, + ArgType.Unknown + ], + async execute(ctx, [host, port, prop]) { + const motd = (await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.motd + if (!motd || prop) return this.success(motd?.[prop!]) + return this.successJSON(motd) + } +}) \ No newline at end of file diff --git a/src/native/java/javaMaxPlayers.ts b/src/native/java/javaMaxPlayers.ts new file mode 100644 index 0000000..b48ca30 --- /dev/null +++ b/src/native/java/javaMaxPlayers.ts @@ -0,0 +1,27 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$javaMaxPlayers", + version: "1.0.0", + description: "Returns the maximum amount of allowed players on a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.Number, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.players?.max) + } +}) \ No newline at end of file diff --git a/src/native/java/javaMods.ts b/src/native/java/javaMods.ts new file mode 100644 index 0000000..74efae4 --- /dev/null +++ b/src/native/java/javaMods.ts @@ -0,0 +1,51 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import array from "../../functions/array" + +export enum JavaModProperty { + name = "name", + version = "version", +} + +export default new NativeFunction({ + name: "$javaMods", + version: "1.0.0", + description: "Returns the mods of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: JavaModProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: ArgType.String, + }, + ], + output: [ + ArgType.Json, + array() + ], + async execute(ctx, [host, port, prop, sep]) { + const mods = (await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.mods + if (!mods || prop) return this.success(mods?.map((x) => x[prop!]).join(sep ?? ", ")) + return this.successJSON(mods) + } +}) \ No newline at end of file diff --git a/src/native/java/javaPlayerCount.ts b/src/native/java/javaPlayerCount.ts new file mode 100644 index 0000000..1c4fc62 --- /dev/null +++ b/src/native/java/javaPlayerCount.ts @@ -0,0 +1,27 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$javaPlayerCount", + version: "1.0.0", + description: "Returns the online player count of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.Number, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.players?.online) + } +}) \ No newline at end of file diff --git a/src/native/java/javaPlayerList.ts b/src/native/java/javaPlayerList.ts new file mode 100644 index 0000000..6f4e503 --- /dev/null +++ b/src/native/java/javaPlayerList.ts @@ -0,0 +1,53 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import array from "../../functions/array" + +export enum JavaPlayerProperty { + uuid = "uuid", + nameRaw = "name_raw", + nameClean = "name_clean", + nameHtml = "name_html", +} + +export default new NativeFunction({ + name: "$javaPlayerList", + version: "1.0.0", + description: "Returns the online player list of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: JavaPlayerProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: ArgType.String, + }, + ], + output: [ + ArgType.Json, + array() + ], + async execute(ctx, [host, port, prop, sep]) { + const players = (await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.players?.list + if (!players || prop) return this.success(players?.map((x) => x[prop!]).join(sep ?? ", ")) + return this.successJSON(players) + } +}) \ No newline at end of file diff --git a/src/native/java/javaPlugins.ts b/src/native/java/javaPlugins.ts new file mode 100644 index 0000000..3c67e7e --- /dev/null +++ b/src/native/java/javaPlugins.ts @@ -0,0 +1,51 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import array from "../../functions/array" + +export enum JavaPluginProperty { + name = "name", + version = "version", +} + +export default new NativeFunction({ + name: "$javaPlugins", + version: "1.0.0", + description: "Returns the plugins of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: JavaPluginProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: ArgType.String, + }, + ], + output: [ + ArgType.Json, + array() + ], + async execute(ctx, [host, port, prop, sep]) { + const plugins = (await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.plugins + if (!plugins || prop) return this.success(plugins?.map((x) => x[prop!]).join(sep ?? ", ")) + return this.successJSON(plugins) + } +}) \ No newline at end of file diff --git a/src/native/java/javaPort.ts b/src/native/java/javaPort.ts new file mode 100644 index 0000000..51cfe76 --- /dev/null +++ b/src/native/java/javaPort.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$javaPort", + version: "1.0.0", + description: "Returns the port of the java server", + unwrap: false, + output: ArgType.Number, + async execute(ctx) { + return this.success((await ctx.client.minecraft.getJavaStatus().catch(ctx.noop))?.port) + } +}) \ No newline at end of file diff --git a/src/native/java/javaServerOnline.ts b/src/native/java/javaServerOnline.ts new file mode 100644 index 0000000..bd946d1 --- /dev/null +++ b/src/native/java/javaServerOnline.ts @@ -0,0 +1,27 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$javaServerOnline", + version: "1.0.0", + description: "Returns whether a java server is online", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.Boolean, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.online) + } +}) \ No newline at end of file diff --git a/src/native/java/javaSoftware.ts b/src/native/java/javaSoftware.ts new file mode 100644 index 0000000..0f9cb36 --- /dev/null +++ b/src/native/java/javaSoftware.ts @@ -0,0 +1,27 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$javaSoftware", + version: "1.0.0", + description: "Returns the software of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + } + ], + output: ArgType.String, + async execute(ctx, [host, port]) { + return this.success((await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.software) + } +}) \ No newline at end of file diff --git a/src/native/java/javaVersion.ts b/src/native/java/javaVersion.ts new file mode 100644 index 0000000..e28f1f0 --- /dev/null +++ b/src/native/java/javaVersion.ts @@ -0,0 +1,46 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export enum JavaVersionProperty { + nameRaw = "name_raw", + nameClean = "name_clean", + nameHtml = "name_html", + protocol = "protocol", +} + +export default new NativeFunction({ + name: "$javaVersion", + version: "1.0.0", + description: "Returns the version of a java server", + unwrap: true, + brackets: false, + args: [ + { + name: "host", + description: "The host domain of the server", + rest: false, + type: ArgType.String, + }, + { + name: "port", + description: "The port of the host connection", + rest: false, + type: ArgType.Number, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: JavaVersionProperty, + }, + ], + output: [ + ArgType.Json, + ArgType.Unknown + ], + async execute(ctx, [host, port, prop]) { + const version = (await ctx.client.minecraft.getJavaStatus(host, port || undefined).catch(ctx.noop))?.version + if (!version || prop) return this.success(version?.[prop!]) + return this.successJSON(version) + } +}) \ No newline at end of file diff --git a/src/native/management/addAllowList.ts b/src/native/management/addAllowList.ts new file mode 100644 index 0000000..ebb4bff --- /dev/null +++ b/src/native/management/addAllowList.ts @@ -0,0 +1,25 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import parsePlayer from "../../functions/parsePlayer" + +export default new NativeFunction({ + name: "$addAllowList", + version: "1.0.0", + description: "Adds players to the server's allow list, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "players", + description: "The players to add", + rest: true, + required: true, + type: ArgType.String, + }, + ], + output: ArgType.Boolean, + async execute(ctx, [players]) { + return this.success(!!( + await ctx.client.minecraft.server?.allowlist().add(players.map(parsePlayer)).catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/addIPBan.ts b/src/native/management/addIPBan.ts new file mode 100644 index 0000000..ecaa26e --- /dev/null +++ b/src/native/management/addIPBan.ts @@ -0,0 +1,47 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$addIPBan", + version: "1.0.0", + description: "Adds an IP address to the server's ban list, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "ip", + description: "The IP address to ban from the server", + rest: false, + required: true, + type: ArgType.String, + }, + { + name: "reason", + description: "The reason for the ban", + rest: false, + type: ArgType.String, + }, + { + name: "source", + description: "The source of the ban", + rest: false, + type: ArgType.String, + }, + { + name: "expires", + description: "The expire date of the ban", + rest: false, + type: ArgType.Date, + }, + ], + output: ArgType.Boolean, + async execute(ctx, [ip, reason, source, expires]) { + return this.success(!!( + await ctx.client.minecraft.server?.ipBanList().add( + ip, + reason || undefined, + source || undefined, + expires || undefined + ).catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/addOperator.ts b/src/native/management/addOperator.ts new file mode 100644 index 0000000..436d061 --- /dev/null +++ b/src/native/management/addOperator.ts @@ -0,0 +1,41 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import parsePlayer from "../../functions/parsePlayer" + +export default new NativeFunction({ + name: "$addOperator", + version: "1.0.0", + description: "Adds a player to the server's operator list, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "player", + description: "The player to add as an operator", + rest: false, + required: true, + type: ArgType.String, + }, + { + name: "level", + description: "The operator permission level to grant (from 1 to 4, with 4 being the highest)", + rest: false, + type: ArgType.Number, + }, + { + name: "bypass", + description: "Whether the operator bypasses the player limit", + rest: false, + type: ArgType.Boolean, + }, + ], + output: ArgType.Boolean, + async execute(ctx, [player, level, bypass]) { + return this.success(!!( + await ctx.client.minecraft.server?.operatorList().add( + parsePlayer(player), + level || undefined, + typeof(bypass) === "boolean" ? bypass : undefined + ).catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/addPlayerBan.ts b/src/native/management/addPlayerBan.ts new file mode 100644 index 0000000..f108547 --- /dev/null +++ b/src/native/management/addPlayerBan.ts @@ -0,0 +1,48 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import parsePlayer from "../../functions/parsePlayer" + +export default new NativeFunction({ + name: "$addPlayerBan", + version: "1.0.0", + description: "Adds a player to the server's ban list, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "player", + description: "The player to ban from the server", + rest: false, + required: true, + type: ArgType.String, + }, + { + name: "reason", + description: "The reason for the ban", + rest: false, + type: ArgType.String, + }, + { + name: "source", + description: "The source of the ban", + rest: false, + type: ArgType.String, + }, + { + name: "expires", + description: "The expire date of the ban", + rest: false, + type: ArgType.Date, + }, + ], + output: ArgType.Boolean, + async execute(ctx, [player, reason, source, expires]) { + return this.success(!!( + await ctx.client.minecraft.server?.banList().add( + parsePlayer(player), + reason || undefined, + source || undefined, + expires || undefined + ).catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/clearAllowList.ts b/src/native/management/clearAllowList.ts new file mode 100644 index 0000000..dc06ad1 --- /dev/null +++ b/src/native/management/clearAllowList.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$clearAllowList", + version: "1.0.0", + description: "Clears the server's allow list, returns bool", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.successJSON(!!( + await ctx.client.minecraft.server?.allowlist().clear().catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/clearIPBans.ts b/src/native/management/clearIPBans.ts new file mode 100644 index 0000000..9685101 --- /dev/null +++ b/src/native/management/clearIPBans.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$clearIPBans", + version: "1.0.0", + description: "Clears the server's IP ban list, returns bool", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.successJSON(!!( + await ctx.client.minecraft.server?.ipBanList().clear().catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/clearOperators.ts b/src/native/management/clearOperators.ts new file mode 100644 index 0000000..43caa1f --- /dev/null +++ b/src/native/management/clearOperators.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$clearOperators", + version: "1.0.0", + description: "Clears the server's operator list, returns bool", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.successJSON(!!( + await ctx.client.minecraft.server?.operatorList().clear().catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/clearPlayerBans.ts b/src/native/management/clearPlayerBans.ts new file mode 100644 index 0000000..62d3d38 --- /dev/null +++ b/src/native/management/clearPlayerBans.ts @@ -0,0 +1,14 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$clearPlayerBans", + version: "1.0.0", + description: "Clears the server's player ban list, returns bool", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.successJSON(!!( + await ctx.client.minecraft.server?.banList().clear().catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/getAllowList.ts b/src/native/management/getAllowList.ts new file mode 100644 index 0000000..ce4827c --- /dev/null +++ b/src/native/management/getAllowList.ts @@ -0,0 +1,42 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { PlayerProperty } from "./getConnectedPlayers" +import array from "../../functions/array" + +export default new NativeFunction({ + name: "$getAllowList", + version: "1.0.0", + description: "Returns the server's allow list", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: PlayerProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: ArgType.String, + } + ], + output: [ + ArgType.Json, + array() + ], + async execute(ctx, [force, prop, sep]) { + const players = await ctx.client.minecraft.server?.allowlist().get(force || false).catch(ctx.noop) + if (!players || prop) return this.success(players?.map((x) => x[prop!]).join(sep ?? ", ")) + return this.successJSON(players) + } +}) \ No newline at end of file diff --git a/src/native/management/getConnectedPlayers.ts b/src/native/management/getConnectedPlayers.ts new file mode 100644 index 0000000..d0c73be --- /dev/null +++ b/src/native/management/getConnectedPlayers.ts @@ -0,0 +1,46 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import array from "../../functions/array" + +export enum PlayerProperty { + id = "id", + name = "name" +} + +export default new NativeFunction({ + name: "$getConnectedPlayers", + version: "1.0.0", + description: "Returns the server's currently connected players", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: PlayerProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: ArgType.String, + } + ], + output: [ + ArgType.Json, + array() + ], + async execute(ctx, [force, prop, sep]) { + const players = await ctx.client.minecraft.server?.getConnectedPlayers(force || false).catch(ctx.noop) + if (!players || prop) return this.success(players?.map((x) => x[prop!]).join(sep ?? ", ")) + return this.successJSON(players) + } +}) \ No newline at end of file diff --git a/src/native/management/getGameRules.ts b/src/native/management/getGameRules.ts new file mode 100644 index 0000000..f483765 --- /dev/null +++ b/src/native/management/getGameRules.ts @@ -0,0 +1,43 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { GameRuleProperties, GameRuleProperty } from "../../properties/gameRule" +import array from "../../functions/array" + +export default new NativeFunction({ + name: "$getGameRules", + version: "1.0.0", + description: "Returns the server's game rules", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: GameRuleProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: ArgType.String, + } + ], + output: [ + ArgType.Json, + array() + ], + async execute(ctx, [force, prop, sep]) { + const map = await ctx.client.minecraft.server?.getGameRules(force || false).catch(ctx.noop) + const rules = Array.from(map?.values() || []) + if (!map || prop) return this.success(rules.map((x) => GameRuleProperties[prop!](x)).join(sep ?? ", ")) + return this.successJSON(rules) + } +}) \ No newline at end of file diff --git a/src/native/management/getIPBans.ts b/src/native/management/getIPBans.ts new file mode 100644 index 0000000..2b1508b --- /dev/null +++ b/src/native/management/getIPBans.ts @@ -0,0 +1,42 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { IPBanProperties, IPBanProperty } from "../../properties/ban" +import array from "../../functions/array" + +export default new NativeFunction({ + name: "$getIPBans", + version: "1.0.0", + description: "Returns the server's IP ban list", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: IPBanProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: ArgType.String, + } + ], + output: [ + ArgType.Json, + array() + ], + async execute(ctx, [force, prop, sep]) { + const bans = await ctx.client.minecraft.server?.ipBanList().get(force || false).catch(ctx.noop) + if (!bans || prop) return this.success(bans?.map((x) => IPBanProperties[prop!](x)).join(sep ?? ", ")) + return this.successJSON(bans) + } +}) \ No newline at end of file diff --git a/src/native/management/getOperators.ts b/src/native/management/getOperators.ts new file mode 100644 index 0000000..2a80704 --- /dev/null +++ b/src/native/management/getOperators.ts @@ -0,0 +1,42 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { OperatorProperties, OperatorProperty } from "../../properties/operator" +import array from "../../functions/array" + +export default new NativeFunction({ + name: "$getOperators", + version: "1.0.0", + description: "Returns the server's operator list", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: OperatorProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: ArgType.String, + } + ], + output: [ + ArgType.Json, + array() + ], + async execute(ctx, [force, prop, sep]) { + const operators = await ctx.client.minecraft.server?.operatorList().get(force || false).catch(ctx.noop) + if (!operators || prop) return this.success(operators?.map((x) => OperatorProperties[prop!](x)).join(sep ?? ", ")) + return this.successJSON(operators) + } +}) \ No newline at end of file diff --git a/src/native/management/getPlayerBans.ts b/src/native/management/getPlayerBans.ts new file mode 100644 index 0000000..c95f896 --- /dev/null +++ b/src/native/management/getPlayerBans.ts @@ -0,0 +1,42 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { UserBanProperties, UserBanProperty } from "../../properties/ban" +import array from "../../functions/array" + +export default new NativeFunction({ + name: "$getPlayerBans", + version: "1.0.0", + description: "Returns the server's player ban list", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: UserBanProperty, + }, + { + name: "separator", + description: "The separator to use for each value", + rest: false, + type: ArgType.String, + } + ], + output: [ + ArgType.Json, + array() + ], + async execute(ctx, [force, prop, sep]) { + const bans = await ctx.client.minecraft.server?.banList().get(force || false).catch(ctx.noop) + if (!bans || prop) return this.success(bans?.map((x) => UserBanProperties[prop!](x)).join(sep ?? ", ")) + return this.successJSON(bans) + } +}) \ No newline at end of file diff --git a/src/native/management/getServerVersion.ts b/src/native/management/getServerVersion.ts new file mode 100644 index 0000000..6290e0a --- /dev/null +++ b/src/native/management/getServerVersion.ts @@ -0,0 +1,39 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export enum VersionProperty { + name = "name", + protocol = "protocol" +} + +export default new NativeFunction({ + name: "$getServerVersion", + version: "1.0.0", + description: "Returns current version of the minecraft server", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: ArgType.Boolean, + }, + { + name: "property", + description: "The property to return", + rest: false, + type: ArgType.Enum, + enum: VersionProperty, + } + ], + output: [ + ArgType.Json, + ArgType.String + ], + async execute(ctx, [force, prop]) { + const version = (await ctx.client.minecraft.server?.getStatus(force || false).catch(ctx.noop))?.version + if (!version || prop) return this.success(version?.[prop!]) + return this.successJSON(version) + } +}) \ No newline at end of file diff --git a/src/native/management/hasGameRulesRegistry.ts b/src/native/management/hasGameRulesRegistry.ts new file mode 100644 index 0000000..a9e732e --- /dev/null +++ b/src/native/management/hasGameRulesRegistry.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$hasGameRulesRegistry", + version: "1.0.0", + description: "Returns whether the server has the new game rules registry", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.success(!!(await ctx.client.minecraft.server?.hasGameRulesRegistry().catch(ctx.noop))) + } +}) \ No newline at end of file diff --git a/src/native/management/hasServerStarted.ts b/src/native/management/hasServerStarted.ts new file mode 100644 index 0000000..3efff3c --- /dev/null +++ b/src/native/management/hasServerStarted.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$hasServerStarted", + version: "1.0.0", + description: "Returns whether the server has fully started", + unwrap: true, + brackets: false, + args: [ + { + name: "force", + description: "Whether to force a direct fetch, defaults to false", + rest: false, + required: true, + type: ArgType.Boolean, + } + ], + output: ArgType.Boolean, + async execute(ctx, [force]) { + return this.success(!!(await ctx.client.minecraft.server?.getStatus(force || false).catch(ctx.noop))?.started) + } +}) \ No newline at end of file diff --git a/src/native/management/kickPlayers.ts b/src/native/management/kickPlayers.ts new file mode 100644 index 0000000..80f7f73 --- /dev/null +++ b/src/native/management/kickPlayers.ts @@ -0,0 +1,38 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import parsePlayer from "../../functions/parsePlayer" + +export default new NativeFunction({ + name: "$kickPlayers", + version: "1.0.0", + description: "Kicks players from the minecraft server, returns number of kicked players", + unwrap: true, + brackets: true, + experimental: true, + args: [ + { + name: "message", + description: "The message displayed to the players when they are kicked", + rest: false, + required: false, + type: ArgType.String, + }, + { + name: "players", + description: "The players to kick", + rest: true, + required: true, + type: ArgType.String, + } + ], + output: ArgType.Number, + async execute(ctx, [msg, players]) { + const result = await ctx.client.minecraft.server?.kickPlayers( + players.map((x) => parsePlayer(x)), + msg || undefined + ).catch((err) => { + if (err?.code !== -32603) ctx.noop(err) + }) + + return this.success(result?.length || 0) + } +}) \ No newline at end of file diff --git a/src/native/management/removeAllowList.ts b/src/native/management/removeAllowList.ts new file mode 100644 index 0000000..c1b78af --- /dev/null +++ b/src/native/management/removeAllowList.ts @@ -0,0 +1,25 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import parsePlayer from "../../functions/parsePlayer" + +export default new NativeFunction({ + name: "$removeAllowList", + version: "1.0.0", + description: "Removes players from the server's allow list, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "players", + description: "The players to remove", + rest: true, + required: true, + type: ArgType.String, + }, + ], + output: ArgType.Boolean, + async execute(ctx, [players]) { + return this.success(!!( + await ctx.client.minecraft.server?.allowlist().remove(players.map(parsePlayer)).catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/removeIPBans.ts b/src/native/management/removeIPBans.ts new file mode 100644 index 0000000..7d9445b --- /dev/null +++ b/src/native/management/removeIPBans.ts @@ -0,0 +1,25 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$removeIPBans", + version: "1.0.0", + description: "Removes IP addresses from the server's ban list, returns bool", + aliases: ["$removeIPBan"], + unwrap: true, + brackets: true, + args: [ + { + name: "ips", + description: "The IP addresses to unban", + rest: true, + required: true, + type: ArgType.String, + }, + ], + output: ArgType.Boolean, + async execute(ctx, [ips]) { + return this.success(!!( + await ctx.client.minecraft.server?.ipBanList().remove(ips).catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/removeOperators.ts b/src/native/management/removeOperators.ts new file mode 100644 index 0000000..000069e --- /dev/null +++ b/src/native/management/removeOperators.ts @@ -0,0 +1,26 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import parsePlayer from "../../functions/parsePlayer" + +export default new NativeFunction({ + name: "$removeOperators", + version: "1.0.0", + description: "Removes players from the server's operator list, returns bool", + aliases: ["$removeOperator"], + unwrap: true, + brackets: true, + args: [ + { + name: "players", + description: "The players to remove as operator", + rest: true, + required: true, + type: ArgType.String, + }, + ], + output: ArgType.Boolean, + async execute(ctx, [players]) { + return this.success(!!( + await ctx.client.minecraft.server?.operatorList().remove(players.map(parsePlayer)).catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/removePlayerBans.ts b/src/native/management/removePlayerBans.ts new file mode 100644 index 0000000..0032748 --- /dev/null +++ b/src/native/management/removePlayerBans.ts @@ -0,0 +1,26 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import parsePlayer from "../../functions/parsePlayer" + +export default new NativeFunction({ + name: "$removePlayerBans", + version: "1.0.0", + description: "Removes players from the server's ban list, returns bool", + aliases: ["$removePlayerBan"], + unwrap: true, + brackets: true, + args: [ + { + name: "players", + description: "The players to unban", + rest: true, + required: true, + type: ArgType.String, + }, + ], + output: ArgType.Boolean, + async execute(ctx, [players]) { + return this.success(!!( + await ctx.client.minecraft.server?.banList().remove(players.map(parsePlayer)).catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/saveServer.ts b/src/native/management/saveServer.ts new file mode 100644 index 0000000..6aec5fd --- /dev/null +++ b/src/native/management/saveServer.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$saveServer", + version: "1.0.0", + description: "Saves the minecraft server", + unwrap: true, + brackets: false, + args: [ + { + name: "flush", + description: "Whether to save chunks to disk immediately, defaults to true", + rest: false, + required: true, + type: ArgType.Boolean, + } + ], + async execute(ctx, [flush]) { + await ctx.client.minecraft.server?.save(flush ?? true).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/sendSystemMessage.ts b/src/native/management/sendSystemMessage.ts new file mode 100644 index 0000000..8dd2886 --- /dev/null +++ b/src/native/management/sendSystemMessage.ts @@ -0,0 +1,41 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import parsePlayer from "../../functions/parsePlayer" + +export default new NativeFunction({ + name: "$sendSystemMessage", + version: "1.0.0", + description: "Sends a system message to the minecraft server, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "message", + description: "The message to send", + rest: false, + required: true, + type: ArgType.String, + }, + { + name: "overlay", + description: "Whether to display the message as an overlay above the hotbar, otherwise in chat", + rest: false, + type: ArgType.Boolean, + }, + { + name: "players", + description: "The players receiving the message, omit to send to all players", + rest: true, + type: ArgType.String, + } + ], + output: ArgType.Boolean, + async execute(ctx, [msg, overlay, players]) { + return this.success(!!( + await ctx.client.minecraft.server?.sendSystemMessage( + msg, + players?.length ? players.map((x) => parsePlayer(x)) : undefined, + overlay || undefined + ).catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/serverAcceptTransfers.ts b/src/native/management/serverAcceptTransfers.ts new file mode 100644 index 0000000..f83bb4a --- /dev/null +++ b/src/native/management/serverAcceptTransfers.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverAcceptTransfers", + version: "1.0.0", + description: "Returns whether the server accepts players transferred from other servers", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getAcceptTransfers().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverAllowFlight.ts b/src/native/management/serverAllowFlight.ts new file mode 100644 index 0000000..94a6e5b --- /dev/null +++ b/src/native/management/serverAllowFlight.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverAllowFlight", + version: "1.0.0", + description: "Returns whether players are allowed to fly on the server", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getAllowFlight().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverAutoSave.ts b/src/native/management/serverAutoSave.ts new file mode 100644 index 0000000..b539506 --- /dev/null +++ b/src/native/management/serverAutoSave.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverAutoSave", + version: "1.0.0", + description: "Returns whether the server automatically saves the world periodically", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getAutoSave().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverDifficulty.ts b/src/native/management/serverDifficulty.ts new file mode 100644 index 0000000..0b8a222 --- /dev/null +++ b/src/native/management/serverDifficulty.ts @@ -0,0 +1,15 @@ +import { NativeFunction } from "@tryforge/forgescript" +import { Difficulty } from "../../types" +import convertEnum from "../../functions/convertEnum" + +export default new NativeFunction({ + name: "$serverDifficulty", + version: "1.0.0", + description: "Returns the difficulty level of the server", + unwrap: false, + output: Difficulty, + async execute(ctx) { + const diff = await ctx.client.minecraft.server?.settings().getDifficulty().catch(ctx.noop) + return this.success(diff ? convertEnum(Difficulty, diff) : null) + } +}) \ No newline at end of file diff --git a/src/native/management/serverEnforceAllowList.ts b/src/native/management/serverEnforceAllowList.ts new file mode 100644 index 0000000..bfd9b85 --- /dev/null +++ b/src/native/management/serverEnforceAllowList.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverEnforceAllowList", + version: "1.0.0", + description: "Returns whether the server immediately kicks players when they are removed from the allow list", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getEnforceAllowList().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverEntityBroadcastRange.ts b/src/native/management/serverEntityBroadcastRange.ts new file mode 100644 index 0000000..a827cd9 --- /dev/null +++ b/src/native/management/serverEntityBroadcastRange.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverEntityBroadcastRange", + version: "1.0.0", + description: "Returns the range in chunks around each player in which entities are updated to the player, in percentage", + unwrap: false, + output: ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getEntityBroadcastRange().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverForceGameMode.ts b/src/native/management/serverForceGameMode.ts new file mode 100644 index 0000000..a8497ff --- /dev/null +++ b/src/native/management/serverForceGameMode.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverForceGameMode", + version: "1.0.0", + description: "Returns whether players are forced to use the server's game mode when they join", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getForceGameMode().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverGameMode.ts b/src/native/management/serverGameMode.ts new file mode 100644 index 0000000..322327d --- /dev/null +++ b/src/native/management/serverGameMode.ts @@ -0,0 +1,15 @@ +import { NativeFunction } from "@tryforge/forgescript" +import { GameMode } from "../../types" +import convertEnum from "../../functions/convertEnum" + +export default new NativeFunction({ + name: "$serverGameMode", + version: "1.0.0", + description: "Returns the default game mode for players when they join the server for the first time", + unwrap: false, + output: GameMode, + async execute(ctx) { + const mode = await ctx.client.minecraft.server?.settings().getGameMode().catch(ctx.noop) + return this.success(mode ? convertEnum(GameMode, mode) : null) + } +}) \ No newline at end of file diff --git a/src/native/management/serverHideOnlinePlayers.ts b/src/native/management/serverHideOnlinePlayers.ts new file mode 100644 index 0000000..495ecbd --- /dev/null +++ b/src/native/management/serverHideOnlinePlayers.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverHideOnlinePlayers", + version: "1.0.0", + description: "Returns whether the server hides the list of online players from the server list", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getHideOnlinePlayers().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverMOTD.ts b/src/native/management/serverMOTD.ts new file mode 100644 index 0000000..8aae29e --- /dev/null +++ b/src/native/management/serverMOTD.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverMOTD", + version: "1.0.0", + description: "Returns the server's message of the day (MOTD)", + unwrap: false, + output: ArgType.String, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getMOTD().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverMaxPlayers.ts b/src/native/management/serverMaxPlayers.ts new file mode 100644 index 0000000..ece0a52 --- /dev/null +++ b/src/native/management/serverMaxPlayers.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverMaxPlayers", + version: "1.0.0", + description: "Returns the maximum number of players that can join the server", + unwrap: false, + output: ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getMaxPlayers().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverOperatorUserPermissionLevel.ts b/src/native/management/serverOperatorUserPermissionLevel.ts new file mode 100644 index 0000000..748892e --- /dev/null +++ b/src/native/management/serverOperatorUserPermissionLevel.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverOperatorUserPermissionLevel", + version: "1.0.0", + description: "Returns the permission level granted to new operators", + unwrap: false, + output: ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getOperatorUserPermissionLevel().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverPauseWhenEmptySeconds.ts b/src/native/management/serverPauseWhenEmptySeconds.ts new file mode 100644 index 0000000..46d1f6e --- /dev/null +++ b/src/native/management/serverPauseWhenEmptySeconds.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverPauseWhenEmptySeconds", + version: "1.0.0", + description: "Returns the number of seconds before pausing server when no players are online", + unwrap: false, + output: ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getPauseWhenEmptySeconds().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverPlayerIdleTimeout.ts b/src/native/management/serverPlayerIdleTimeout.ts new file mode 100644 index 0000000..52a78c9 --- /dev/null +++ b/src/native/management/serverPlayerIdleTimeout.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverPlayerIdleTimeout", + version: "1.0.0", + description: "Returns the number of minutes a player can be idle before being kicked", + unwrap: false, + output: ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getPlayerIdleTimeout().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverSimulationDistance.ts b/src/native/management/serverSimulationDistance.ts new file mode 100644 index 0000000..0dc76e8 --- /dev/null +++ b/src/native/management/serverSimulationDistance.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverSimulationDistance", + version: "1.0.0", + description: "Returns the simulation distance of the server in chunks", + unwrap: false, + output: ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getSimulationDistance().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverSpawnProtectionRadius.ts b/src/native/management/serverSpawnProtectionRadius.ts new file mode 100644 index 0000000..0d57ed6 --- /dev/null +++ b/src/native/management/serverSpawnProtectionRadius.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverSpawnProtectionRadius", + version: "1.0.0", + description: "Returns the radius around the world spawn point that is protected from non-operator players", + unwrap: false, + output: ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getSpawnProtectionRadius().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverStatusHeartbeatInterval.ts b/src/native/management/serverStatusHeartbeatInterval.ts new file mode 100644 index 0000000..64727d8 --- /dev/null +++ b/src/native/management/serverStatusHeartbeatInterval.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverStatusHeartbeatInterval", + version: "1.0.0", + description: "Returns the interval in seconds between status heartbeats sent to server management clients", + unwrap: false, + output: ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getStatusHeartbeatInterval().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverStatusReplies.ts b/src/native/management/serverStatusReplies.ts new file mode 100644 index 0000000..8068162 --- /dev/null +++ b/src/native/management/serverStatusReplies.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverStatusReplies", + version: "1.0.0", + description: "Returns whether the server responds to status requests in the multiplayer server list", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getStatusReplies().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverUseAllowList.ts b/src/native/management/serverUseAllowList.ts new file mode 100644 index 0000000..ad30ff4 --- /dev/null +++ b/src/native/management/serverUseAllowList.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverUseAllowList", + version: "1.0.0", + description: "Returns whether the server uses the allow list", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getUseAllowList().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/serverViewDistance.ts b/src/native/management/serverViewDistance.ts new file mode 100644 index 0000000..e57641c --- /dev/null +++ b/src/native/management/serverViewDistance.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$serverViewDistance", + version: "1.0.0", + description: "Returns the view distance of the server in chunks", + unwrap: false, + output: ArgType.Number, + async execute(ctx) { + return this.success(await ctx.client.minecraft.server?.settings().getViewDistance().catch(ctx.noop)) + } +}) \ No newline at end of file diff --git a/src/native/management/setAcceptTransfers.ts b/src/native/management/setAcceptTransfers.ts new file mode 100644 index 0000000..f44fcbd --- /dev/null +++ b/src/native/management/setAcceptTransfers.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setAcceptTransfers", + version: "1.0.0", + description: "Sets whether the server accepts players transferred from other servers", + unwrap: true, + brackets: true, + args: [ + { + name: "accept", + description: "Whether to accept transferred players", + rest: false, + required: true, + type: ArgType.Boolean, + } + ], + async execute(ctx, [accept]) { + await ctx.client.minecraft.server?.settings().setAcceptTransfers(accept).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setAllowFlight.ts b/src/native/management/setAllowFlight.ts new file mode 100644 index 0000000..b0eee73 --- /dev/null +++ b/src/native/management/setAllowFlight.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setAllowFlight", + version: "1.0.0", + description: "Sets whether players are allowed to fly on the server", + unwrap: true, + brackets: true, + args: [ + { + name: "allow", + description: "Whether to allow flying for players", + rest: false, + required: true, + type: ArgType.Boolean, + } + ], + async execute(ctx, [allow]) { + await ctx.client.minecraft.server?.settings().setAllowFlight(allow).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setAllowList.ts b/src/native/management/setAllowList.ts new file mode 100644 index 0000000..15d2821 --- /dev/null +++ b/src/native/management/setAllowList.ts @@ -0,0 +1,25 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import parsePlayer from "../../functions/parsePlayer" + +export default new NativeFunction({ + name: "$setAllowList", + version: "1.0.0", + description: "Overwrites the existing allow list with a set of players, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "players", + description: "The players to set", + rest: true, + required: true, + type: ArgType.String, + }, + ], + output: ArgType.Boolean, + async execute(ctx, [players]) { + return this.success(!!( + await ctx.client.minecraft.server?.allowlist().set(players.map(parsePlayer)).catch(ctx.noop) + )) + } +}) \ No newline at end of file diff --git a/src/native/management/setAutoSave.ts b/src/native/management/setAutoSave.ts new file mode 100644 index 0000000..3ca67b3 --- /dev/null +++ b/src/native/management/setAutoSave.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setAutoSave", + version: "1.0.0", + description: "Sets whether the server automatically saves the world periodically", + unwrap: true, + brackets: true, + args: [ + { + name: "save", + description: "Whether to enable auto-saving the world", + rest: false, + required: true, + type: ArgType.Boolean, + } + ], + async execute(ctx, [save]) { + await ctx.client.minecraft.server?.settings().setAutoSave(save).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setDifficulty.ts b/src/native/management/setDifficulty.ts new file mode 100644 index 0000000..f6fab88 --- /dev/null +++ b/src/native/management/setDifficulty.ts @@ -0,0 +1,26 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { Difficulty as BaseDifficulty } from "mc-server-management" +import { Difficulty } from "../../types" +import transformEnum from "../../functions/transformEnum" + +export default new NativeFunction({ + name: "$setDifficulty", + version: "1.0.0", + description: "Sets the difficulty level of the world", + unwrap: true, + brackets: true, + args: [ + { + name: "difficulty", + description: "The difficulty level to set", + rest: false, + required: true, + type: ArgType.Enum, + enum: Difficulty + } + ], + async execute(ctx, [diff]) { + await ctx.client.minecraft.server?.settings().setDifficulty(transformEnum(diff, BaseDifficulty)).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setEnforceAllowList.ts b/src/native/management/setEnforceAllowList.ts new file mode 100644 index 0000000..b11e9de --- /dev/null +++ b/src/native/management/setEnforceAllowList.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setEnforceAllowList", + version: "1.0.0", + description: "Sets whether the server immediately kicks players when they are removed from the allow list", + unwrap: true, + brackets: true, + args: [ + { + name: "enforce", + description: "Whether to enable enforcement", + rest: false, + required: true, + type: ArgType.Boolean, + } + ], + async execute(ctx, [enforce]) { + await ctx.client.minecraft.server?.settings().setEnforceAllowList(enforce).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setEntityBroadcastRange.ts b/src/native/management/setEntityBroadcastRange.ts new file mode 100644 index 0000000..f85412d --- /dev/null +++ b/src/native/management/setEntityBroadcastRange.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setEntityBroadcastRange", + version: "1.0.0", + description: "Sets the range in chunks around each player in which entities are updated to the players, in percentage", + unwrap: true, + brackets: true, + args: [ + { + name: "percentage", + description: "The entity broadcast range percentage (min 10, max 1000)", + rest: false, + required: true, + type: ArgType.Number, + } + ], + async execute(ctx, [percentage]) { + await ctx.client.minecraft.server?.settings().setEntityBroadcastRange(percentage).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setForceGameMode.ts b/src/native/management/setForceGameMode.ts new file mode 100644 index 0000000..bd0d0c8 --- /dev/null +++ b/src/native/management/setForceGameMode.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setForceGameMode", + version: "1.0.0", + description: "Sets whether players are forced to use the server's game mode when they join", + unwrap: true, + brackets: true, + args: [ + { + name: "force", + description: "Whether to force the server's game mode", + rest: false, + required: true, + type: ArgType.Boolean, + } + ], + async execute(ctx, [force]) { + await ctx.client.minecraft.server?.settings().setForceGameMode(force).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setGameMode.ts b/src/native/management/setGameMode.ts new file mode 100644 index 0000000..056982f --- /dev/null +++ b/src/native/management/setGameMode.ts @@ -0,0 +1,26 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" +import { GameMode as BaseGameMode } from "mc-server-management" +import { GameMode } from "../../types" +import transformEnum from "../../functions/transformEnum" + +export default new NativeFunction({ + name: "$setGameMode", + version: "1.0.0", + description: "Sets the default game mode for players when they join the server for the first time", + unwrap: true, + brackets: true, + args: [ + { + name: "mode", + description: "The default game mode to set", + rest: false, + required: true, + type: ArgType.Enum, + enum: GameMode, + } + ], + async execute(ctx, [mode]) { + await ctx.client.minecraft.server?.settings().setGameMode(transformEnum(mode, BaseGameMode)).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setHideOnlinePlayers.ts b/src/native/management/setHideOnlinePlayers.ts new file mode 100644 index 0000000..479f67e --- /dev/null +++ b/src/native/management/setHideOnlinePlayers.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setHideOnlinePlayers", + version: "1.0.0", + description: "Sets whether the server hides the list of online players from the server list", + unwrap: true, + brackets: true, + args: [ + { + name: "hide", + description: "Whether to hide the list of online players", + rest: false, + required: true, + type: ArgType.Boolean, + } + ], + async execute(ctx, [hide]) { + await ctx.client.minecraft.server?.settings().setHideOnlinePlayers(hide).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setMOTD.ts b/src/native/management/setMOTD.ts new file mode 100644 index 0000000..a151dc1 --- /dev/null +++ b/src/native/management/setMOTD.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setMOTD", + version: "1.0.0", + description: "Sets the message of the day (MOTD) for this server", + unwrap: true, + brackets: true, + args: [ + { + name: "motd", + description: "The MOTD to set", + rest: false, + required: true, + type: ArgType.String, + } + ], + async execute(ctx, [motd]) { + await ctx.client.minecraft.server?.settings().setMOTD(motd).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setMaxPlayers.ts b/src/native/management/setMaxPlayers.ts new file mode 100644 index 0000000..6c25b4d --- /dev/null +++ b/src/native/management/setMaxPlayers.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setMaxPlayers", + version: "1.0.0", + description: "Sets the maximum number of players that can join the server", + unwrap: true, + brackets: true, + args: [ + { + name: "max", + description: "The maximum number of players", + rest: false, + required: true, + type: ArgType.Number, + } + ], + async execute(ctx, [max]) { + await ctx.client.minecraft.server?.settings().setMaxPlayers(max).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setOperatorUserPermissionLevel.ts b/src/native/management/setOperatorUserPermissionLevel.ts new file mode 100644 index 0000000..ff994df --- /dev/null +++ b/src/native/management/setOperatorUserPermissionLevel.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setOperatorUserPermissionLevel", + version: "1.0.0", + description: "Sets the permission level granted to new operators", + unwrap: true, + brackets: true, + args: [ + { + name: "level", + description: "The operator user permission level (from 1 to 4, with 4 being the highest)", + rest: false, + required: true, + type: ArgType.Number, + } + ], + async execute(ctx, [level]) { + await ctx.client.minecraft.server?.settings().setOperatorUserPermissionLevel(level).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setPauseWhenEmptySeconds.ts b/src/native/management/setPauseWhenEmptySeconds.ts new file mode 100644 index 0000000..eecc8c4 --- /dev/null +++ b/src/native/management/setPauseWhenEmptySeconds.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setPauseWhenEmptySeconds", + version: "1.0.0", + description: "Sets the number of seconds before pausing server when no players are online", + unwrap: true, + brackets: true, + args: [ + { + name: "seconds", + description: "The number of seconds before pausing when empty", + rest: false, + required: true, + type: ArgType.Number, + } + ], + async execute(ctx, [seconds]) { + await ctx.client.minecraft.server?.settings().setPauseWhenEmptySeconds(seconds).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setPlayerIdleTimeout.ts b/src/native/management/setPlayerIdleTimeout.ts new file mode 100644 index 0000000..304645f --- /dev/null +++ b/src/native/management/setPlayerIdleTimeout.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setPlayerIdleTimeout", + version: "1.0.0", + description: "Sets the number of minutes a player can be idle before being kicked", + unwrap: true, + brackets: true, + args: [ + { + name: "minutes", + description: "The number of minutes before kicking idle players", + rest: false, + required: true, + type: ArgType.Number, + } + ], + async execute(ctx, [minutes]) { + await ctx.client.minecraft.server?.settings().setPlayerIdleTimeout(minutes).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setSimulationDistance.ts b/src/native/management/setSimulationDistance.ts new file mode 100644 index 0000000..237b4cd --- /dev/null +++ b/src/native/management/setSimulationDistance.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setSimulationDistance", + version: "1.0.0", + description: "Sets the simulation distance of the server in chunks", + unwrap: true, + brackets: true, + args: [ + { + name: "chunks", + description: "The simulation distance in chunks", + rest: false, + required: true, + type: ArgType.Number, + } + ], + async execute(ctx, [chunks]) { + await ctx.client.minecraft.server?.settings().setSimulationDistance(chunks).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setSpawnProtectionRadius.ts b/src/native/management/setSpawnProtectionRadius.ts new file mode 100644 index 0000000..cefada4 --- /dev/null +++ b/src/native/management/setSpawnProtectionRadius.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setSpawnProtectionRadius", + version: "1.0.0", + description: "Sets the radius around the world spawn point that is protected from non-operator players", + unwrap: true, + brackets: true, + args: [ + { + name: "radius", + description: "The spawn protection radius to set", + rest: false, + required: true, + type: ArgType.Number, + } + ], + async execute(ctx, [radius]) { + await ctx.client.minecraft.server?.settings().setSpawnProtectionRadius(radius).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setStatusHeartbeatInterval.ts b/src/native/management/setStatusHeartbeatInterval.ts new file mode 100644 index 0000000..11729f1 --- /dev/null +++ b/src/native/management/setStatusHeartbeatInterval.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setStatusHeartbeatInterval", + version: "1.0.0", + description: "Sets the interval in seconds between status heartbeats sent to server management clients", + unwrap: true, + brackets: true, + args: [ + { + name: "seconds", + description: "The status heartbeat interval in seconds", + rest: false, + required: true, + type: ArgType.Number, + } + ], + async execute(ctx, [seconds]) { + await ctx.client.minecraft.server?.settings().setStatusHeartbeatInterval(seconds).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setStatusReplies.ts b/src/native/management/setStatusReplies.ts new file mode 100644 index 0000000..a9a6119 --- /dev/null +++ b/src/native/management/setStatusReplies.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setStatusReplies", + version: "1.0.0", + description: "Sets whether the server responds to status requests in the multiplayer server list", + unwrap: true, + brackets: true, + args: [ + { + name: "respond", + description: "Whether to respond to status requests", + rest: false, + required: true, + type: ArgType.Boolean, + } + ], + async execute(ctx, [respond]) { + await ctx.client.minecraft.server?.settings().setStatusReplies(respond).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setUseAllowList.ts b/src/native/management/setUseAllowList.ts new file mode 100644 index 0000000..a93dfcb --- /dev/null +++ b/src/native/management/setUseAllowList.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setUseAllowList", + version: "1.0.0", + description: "Sets whether the server uses the allow list", + unwrap: true, + brackets: true, + args: [ + { + name: "enable", + description: "Whether to enable the allow list", + rest: false, + required: true, + type: ArgType.Boolean, + } + ], + async execute(ctx, [enable]) { + await ctx.client.minecraft.server?.settings().setUseAllowList(enable).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/setViewDistance.ts b/src/native/management/setViewDistance.ts new file mode 100644 index 0000000..2398f48 --- /dev/null +++ b/src/native/management/setViewDistance.ts @@ -0,0 +1,22 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$setViewDistance", + version: "1.0.0", + description: "Sets the view distance of the server in chunks", + unwrap: true, + brackets: true, + args: [ + { + name: "chunks", + description: "The view distance in chunks", + rest: false, + required: true, + type: ArgType.Number, + } + ], + async execute(ctx, [chunks]) { + await ctx.client.minecraft.server?.settings().setViewDistance(chunks).catch(ctx.noop) + return this.success() + } +}) \ No newline at end of file diff --git a/src/native/management/stopServer.ts b/src/native/management/stopServer.ts new file mode 100644 index 0000000..c09d602 --- /dev/null +++ b/src/native/management/stopServer.ts @@ -0,0 +1,12 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$stopServer", + version: "1.0.0", + description: "Stops the minecraft server, returns bool", + unwrap: false, + output: ArgType.Boolean, + async execute(ctx) { + return this.success(!!(await ctx.client.minecraft.server?.stop().catch(ctx.noop))) + } +}) \ No newline at end of file diff --git a/src/native/management/updateGameRule.ts b/src/native/management/updateGameRule.ts new file mode 100644 index 0000000..0c593c5 --- /dev/null +++ b/src/native/management/updateGameRule.ts @@ -0,0 +1,29 @@ +import { ArgType, NativeFunction } from "@tryforge/forgescript" + +export default new NativeFunction({ + name: "$updateGameRule", + version: "1.0.0", + description: "Updates a game rule of the minecraft server, returns bool", + unwrap: true, + brackets: true, + args: [ + { + name: "key", + description: "The key of the game rule to update", + rest: false, + required: true, + type: ArgType.String, + }, + { + name: "value", + description: "The new value for the game rule", + rest: false, + required: true, + type: ArgType.String, + }, + ], + output: ArgType.Boolean, + async execute(ctx, [key, value]) { + return this.success(!!(await ctx.client.minecraft.server?.updateGameRule(key, value).catch(ctx.noop))) + } +}) \ No newline at end of file diff --git a/src/properties/ban.ts b/src/properties/ban.ts new file mode 100644 index 0000000..63dfb07 --- /dev/null +++ b/src/properties/ban.ts @@ -0,0 +1,32 @@ +import { IPBan, UserBan } from "mc-server-management" +import defineProperties from "../functions/defineProperties" + +export enum UserBanProperty { + reason = "reason", + source = "source", + playerID = "playerID", + playerName = "playerName", + expiresTimestamp = "expiresTimestamp", +} + +export const UserBanProperties = defineProperties({ + reason: (i) => i?.reason, + source: (i) => i?.source, + playerID: (i) => i?.player.id, + playerName: (i) => i?.player.name, + expiresTimestamp: (i) => i?.expires, +}) + +export enum IPBanProperty { + ip = "ip", + reason = "reason", + source = "source", + expiresTimestamp = "expiresTimestamp", +} + +export const IPBanProperties = defineProperties({ + ip: (i) => i?.ip, + reason: (i) => i?.reason, + source: (i) => i?.source, + expiresTimestamp: (i) => i?.expires, +}) \ No newline at end of file diff --git a/src/properties/gameRule.ts b/src/properties/gameRule.ts new file mode 100644 index 0000000..a7ad868 --- /dev/null +++ b/src/properties/gameRule.ts @@ -0,0 +1,16 @@ +import { GameRuleType as BaseGameRuleType, TypedGameRule } from "mc-server-management" +import defineProperties from "../functions/defineProperties" +import convertEnum from "../functions/convertEnum" +import { GameRuleType } from "../types" + +export enum GameRuleProperty { + key = "key", + value = "value", + type = "type", +} + +export const GameRuleProperties = defineProperties>({ + key: (i) => i?.key, + value: (i) => i?.value, + type: (i) => i?.type ? convertEnum(GameRuleType, i.type) : null, +}) \ No newline at end of file diff --git a/src/properties/operator.ts b/src/properties/operator.ts new file mode 100644 index 0000000..71f25c5 --- /dev/null +++ b/src/properties/operator.ts @@ -0,0 +1,16 @@ +import { Operator } from "mc-server-management" +import defineProperties from "../functions/defineProperties" + +export enum OperatorProperty { + permissionLevel = "permissionLevel", + bypassesPlayerLimit = "bypassesPlayerLimit", + playerName = "playerName", + playerID = "playerID" +} + +export const OperatorProperties = defineProperties({ + permissionLevel: (i) => i?.permissionLevel, + bypassesPlayerLimit: (i) => !!i?.bypassesPlayerLimit, + playerName: (i) => i?.player.name, + playerID: (i) => i?.player.id +}) \ No newline at end of file diff --git a/src/properties/serverState.ts b/src/properties/serverState.ts new file mode 100644 index 0000000..f0a0319 --- /dev/null +++ b/src/properties/serverState.ts @@ -0,0 +1,18 @@ +import { ServerState } from "mc-server-management" +import defineProperties from "../functions/defineProperties" + +export enum ServerStateProperty { + hasStarted = "hasStarted", + playerIDs = "playerIDs", + playerNames = "playerNames", + versionName = "versionName", + versionProtocol = "versionProtocol", +} + +export const ServerStateProperties = defineProperties({ + hasStarted: (i) => i?.started, + playerIDs: (i, sep) => i?.players.map((x) => x.id).join(sep ?? ", "), + playerNames: (i, sep) => i?.players.map((x) => x.name).join(sep ?? ", "), + versionName: (i) => i?.version.name, + versionProtocol: (i) => i?.version.protocol, +}) \ No newline at end of file diff --git a/src/structures/Context.ts b/src/structures/Context.ts new file mode 100644 index 0000000..e6f8dfa --- /dev/null +++ b/src/structures/Context.ts @@ -0,0 +1,81 @@ +import { Context as BaseContext, IContextCache, IRunnable, Sendable } from "@tryforge/forgescript" +import { GameRuleType, IPBan, Operator, Player, ServerState, TypedGameRule, UserBan } from "mc-server-management" +import { ForgeMinecraft } from ".." +import contextNoop from "../functions/contextNoop" + +export type ExtendedSendable = + | Sendable + | Player + | Operator + | ServerState + | TypedGameRule + | UserBan + | IPBan + +export interface IExtendedRunnable extends IRunnable { + obj: ExtendedSendable +} + +export interface IExtendedContextCache extends IContextCache { + player: Player | null + operator: Operator | null + serverState: ServerState | null + gameRule: TypedGameRule | null + userBan: UserBan | null + ipBan: IPBan | null +} + +export class Context extends BaseContext { + #cache: Partial = {} + + public constructor(public readonly runtime: IExtendedRunnable) { + super(runtime) + } + + public get obj() { + return this.runtime.obj + } + + public get player() { + return this.#cache.player ??= this.obj instanceof Player ? this.obj : null + } + + public get operator() { + return this.#cache.operator ??= this.obj instanceof Operator ? this.obj : null + } + + public get serverState() { + return this.#cache.serverState ??= this.obj instanceof ServerState ? this.obj : null + } + + public get gameRule() { + return this.#cache.gameRule ??= this.obj instanceof TypedGameRule ? this.obj as TypedGameRule : null + } + + public get userBan() { + return this.#cache.userBan ??= this.obj instanceof UserBan ? this.obj : null + } + + public get ipBan() { + return this.#cache.ipBan ??= this.obj instanceof IPBan ? this.obj : null + } + + public get noop(): (...args: any[]) => void { + return contextNoop.bind(this) + } +} + +declare module "@tryforge/forgescript" { + interface Context { + noop: (...args: any[]) => void + player: Player | null + operator: Operator | null + serverState: ServerState | null + gameRule: TypedGameRule | null + userBan: UserBan | null + ipBan: IPBan | null + } + interface ForgeClient { + minecraft: ForgeMinecraft + } +} \ No newline at end of file diff --git a/src/structures/index.ts b/src/structures/index.ts new file mode 100644 index 0000000..3ade648 --- /dev/null +++ b/src/structures/index.ts @@ -0,0 +1 @@ +export * from "./Context" \ No newline at end of file diff --git a/src/types.ts b/src/types.ts new file mode 100644 index 0000000..2b1aaac --- /dev/null +++ b/src/types.ts @@ -0,0 +1,18 @@ +export enum GameRuleType { + Boolean = "boolean", + Integer = "integer", +} + +export enum GameMode { + Survival = "survival", + Creative = "creative", + Spectator = "spectator", + Adventure = "adventure", +} + +export enum Difficulty { + Peaceful = "peaceful", + Easy = "easy", + Normal = "normal", + Hard = "hard", +} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..c6fcaa9 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,109 @@ +{ + "compilerOptions": { + /* Visit https://aka.ms/tsconfig to read more about this file */ + + /* Projects */ + // "incremental": true, /* Save .tsbuildinfo files to allow for incremental compilation of projects. */ + // "composite": true, /* Enable constraints that allow a TypeScript project to be used with project references. */ + // "tsBuildInfoFile": "./.tsbuildinfo", /* Specify the path to .tsbuildinfo incremental compilation file. */ + // "disableSourceOfProjectReferenceRedirect": true, /* Disable preferring source files instead of declaration files when referencing composite projects. */ + // "disableSolutionSearching": true, /* Opt a project out of multi-project reference checking when editing. */ + // "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */ + + /* Language and Environment */ + "target": "es2022", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */ + // "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */ + // "jsx": "preserve", /* Specify what JSX code is generated. */ + "experimentalDecorators": true, /* Enable experimental support for legacy experimental decorators. */ + "emitDecoratorMetadata": true, /* Emit design-type metadata for decorated declarations in source files. */ + // "jsxFactory": "", /* Specify the JSX factory function used when targeting React JSX emit, e.g. 'React.createElement' or 'h'. */ + // "jsxFragmentFactory": "", /* Specify the JSX Fragment reference used for fragments when targeting React JSX emit e.g. 'React.Fragment' or 'Fragment'. */ + // "jsxImportSource": "", /* Specify module specifier used to import the JSX factory functions when using 'jsx: react-jsx*'. */ + // "reactNamespace": "", /* Specify the object invoked for 'createElement'. This only applies when targeting 'react' JSX emit. */ + // "noLib": true, /* Disable including any library files, including the default lib.d.ts. */ + // "useDefineForClassFields": true, /* Emit ECMAScript-standard-compliant class fields. */ + // "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */ + + /* Modules */ + "module": "commonjs", /* Specify what module code is generated. */ + "rootDir": "src", /* Specify the root folder within your source files. */ + // "moduleResolution": "node10", /* Specify how TypeScript looks up a file from a given module specifier. */ + // "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */ + // "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */ + // "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */ + // "typeRoots": [], /* Specify multiple folders that act like './node_modules/@types'. */ + // "types": [], /* Specify type package names to be included without being referenced in a source file. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + // "moduleSuffixes": [], /* List of file name suffixes to search when resolving a module. */ + // "allowImportingTsExtensions": true, /* Allow imports to include TypeScript file extensions. Requires '--moduleResolution bundler' and either '--noEmit' or '--emitDeclarationOnly' to be set. */ + // "resolvePackageJsonExports": true, /* Use the package.json 'exports' field when resolving package imports. */ + // "resolvePackageJsonImports": true, /* Use the package.json 'imports' field when resolving imports. */ + // "customConditions": [], /* Conditions to set in addition to the resolver-specific defaults when resolving imports. */ + "resolveJsonModule": true, /* Enable importing .json files. */ + // "allowArbitraryExtensions": true, /* Enable importing files with any extension, provided a declaration file is present. */ + // "noResolve": true, /* Disallow 'import's, 'require's or ''s from expanding the number of files TypeScript should add to a project. */ + + /* JavaScript Support */ + // "allowJs": true, /* Allow JavaScript files to be a part of your program. Use the 'checkJS' option to get errors from these files. */ + // "checkJs": true, /* Enable error reporting in type-checked JavaScript files. */ + // "maxNodeModuleJsDepth": 1, /* Specify the maximum folder depth used for checking JavaScript files from 'node_modules'. Only applicable with 'allowJs'. */ + + /* Emit */ + "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */ + "declarationMap": true, /* Create sourcemaps for d.ts files. */ + // "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */ + "sourceMap": true, /* Create source map files for emitted JavaScript files. */ + // "inlineSourceMap": true, /* Include sourcemap files inside the emitted JavaScript. */ + // "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */ + "outDir": "dist", /* Specify an output folder for all emitted files. */ + // "removeComments": true, /* Disable emitting comments. */ + // "noEmit": true, /* Disable emitting files from a compilation. */ + // "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */ + // "importsNotUsedAsValues": "remove", /* Specify emit/checking behavior for imports that are only used for types. */ + // "downlevelIteration": true, /* Emit more compliant, but verbose and less performant JavaScript for iteration. */ + // "sourceRoot": "", /* Specify the root path for debuggers to find the reference source code. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSources": true, /* Include source code in the sourcemaps inside the emitted JavaScript. */ + // "emitBOM": true, /* Emit a UTF-8 Byte Order Mark (BOM) in the beginning of output files. */ + // "newLine": "crlf", /* Set the newline character for emitting files. */ + // "stripInternal": true, /* Disable emitting declarations that have '@internal' in their JSDoc comments. */ + // "noEmitHelpers": true, /* Disable generating custom helper functions like '__extends' in compiled output. */ + // "noEmitOnError": true, /* Disable emitting files if any type checking errors are reported. */ + // "preserveConstEnums": true, /* Disable erasing 'const enum' declarations in generated code. */ + // "declarationDir": "./", /* Specify the output directory for generated declaration files. */ + // "preserveValueImports": true, /* Preserve unused imported values in the JavaScript output that would otherwise be removed. */ + + /* Interop Constraints */ + // "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */ + // "verbatimModuleSyntax": true, /* Do not transform or elide any imports or exports not marked as type-only, ensuring they are written in the output file's format based on the 'module' setting. */ + // "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */ + "esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */ + // "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */ + "forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */ + + /* Type Checking */ + "strict": true, /* Enable all strict type-checking options. */ + // "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */ + // "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */ + // "strictBindCallApply": true, /* Check that the arguments for 'bind', 'call', and 'apply' methods match the original function. */ + // "strictPropertyInitialization": true, /* Check for class properties that are declared but not set in the constructor. */ + // "noImplicitThis": true, /* Enable error reporting when 'this' is given the type 'any'. */ + // "useUnknownInCatchVariables": true, /* Default catch clause variables as 'unknown' instead of 'any'. */ + // "alwaysStrict": true, /* Ensure 'use strict' is always emitted. */ + // "noUnusedLocals": true, /* Enable error reporting when local variables aren't read. */ + // "noUnusedParameters": true, /* Raise an error when a function parameter isn't read. */ + // "exactOptionalPropertyTypes": true, /* Interpret optional property types as written, rather than adding 'undefined'. */ + // "noImplicitReturns": true, /* Enable error reporting for codepaths that do not explicitly return in a function. */ + // "noFallthroughCasesInSwitch": true, /* Enable error reporting for fallthrough cases in switch statements. */ + // "noUncheckedIndexedAccess": true, /* Add 'undefined' to a type when accessed using an index. */ + // "noImplicitOverride": true, /* Ensure overriding members in derived classes are marked with an override modifier. */ + // "noPropertyAccessFromIndexSignature": true, /* Enforces using indexed accessors for keys declared using an indexed type. */ + // "allowUnusedLabels": true, /* Disable error reporting for unused labels. */ + // "allowUnreachableCode": true, /* Disable error reporting for unreachable code. */ + + /* Completeness */ + // "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */ + "skipLibCheck": true /* Skip type checking all .d.ts files. */ + } +} \ No newline at end of file diff --git a/typedoc.json b/typedoc.json new file mode 100644 index 0000000..96f6bc6 --- /dev/null +++ b/typedoc.json @@ -0,0 +1,13 @@ +{ + "entryPoints": ["src/index.ts"], + "out": "docs", + "highlightLanguages": [ + "ts", + "typescript", + "js", + "javascript", + "json", + "bash", + "properties" + ] +} \ No newline at end of file