Skip to content

Latest commit

 

History

History
45 lines (35 loc) · 2.17 KB

File metadata and controls

45 lines (35 loc) · 2.17 KB

Important information about the codebase

General structure

  • The plugin's code is written in Typescript, stored as .ts files in src/.
  • These files are compiled into .js files stored in build/scripts/.
    • The main.js file is special: it is written in js and needs to be manually copied to build.
  • The build/scripts/*.js files are committed.
  • The JS files are run by an old, buggy version of Mozilla Rhino. (ES5.5) This causes a lot of problems.
  • With the power of modern developer tooling, we can mostly use modern features anyway, though.
  • The build/ folder is a valid Mindustry plugin and should be installed in the server's mods folder. Use of the included scripts is recommended. (npm attach [jarfilepath.jar] to symlink it)

Misc

  • All times are in unix milliseconds.
  • Regexps are broken due to the engine being used. (weird behavior, crashes)
  • Use Java regexes instead.

Async handling

ES6 Promises and ES7 async/await work normally. Some unused Promise methods may not be implemented yet.

The plugin uses a mixture of callbacks, async/await, and promises to handle asynchronous operations. We plan to transition to promises and async/await only.

Frameworks

See framework-usage-guide.md.

History

Contributors (by date)