mirror of
https://github.com/curioustorvald/Terrarum.git
synced 2026-03-15 16:16:10 +09:00
Updated modules
@@ -1,4 +1,4 @@
|
||||
== Welcome to Terrarum Wiki portal! ==
|
||||
|
||||
* [[Developer Portal|Developer's Den]]
|
||||
* [[Player Portal|Player Page]]
|
||||
* [[Player Portal|Player Portal]]
|
||||
|
||||
@@ -17,7 +17,7 @@ Modules' default config must be found under `<module root>/default.json`. Any co
|
||||
|
||||
The user config will have a key with `<module name>:` prepended: for example, if the module `basegame` contains config key `gameplay_max_crafting`, the user-modified config will be named as `basegame:gameplay_max_crafting` on the `<appdata>/config.json`.
|
||||
|
||||
## Loading Modules
|
||||
## Managing Modules
|
||||
* [[Module Organisation|Modules:Load Order]], aka Load Order
|
||||
* [[The Entry Point|Modules:How to Get Started]]
|
||||
|
||||
@@ -30,10 +30,10 @@ The user config will have a key with `<module name>:` prepended: for example, if
|
||||
* [[Hottest Editor of '20: CRISPR|Modules:New Actors]]
|
||||
* [[Texture Packs|Modules:Retextures]]
|
||||
|
||||
## Dirty Jobs
|
||||
## Dirty Deeds
|
||||
* [[Items in-depth|Development:Items]]
|
||||
* [[Actors in-depth|Development:Actors|]]
|
||||
|
||||
## Other Documentations
|
||||
## Recondite References
|
||||
* [[Creature RAW|Development:RAW]]
|
||||
* [[Faction|Development:Faction]]
|
||||
|
||||
@@ -1,10 +1,99 @@
|
||||
## Metadata
|
||||
Every modules must be able to introduce themselves through the `metadata.properties` file.
|
||||
|
||||
The metadata file is a standard-issue Java properties file with some required keys.
|
||||
|
||||
### metadata.properties
|
||||
A metadata must have following keys:
|
||||
|
||||
- **propername** — the displayed name of the module
|
||||
- **description** — a short text describing the module
|
||||
- **author** — the author of the module
|
||||
- **package** — the root package of the module
|
||||
- **entrypoint** — the fully-qualified class name of the Entry Point (see Contents § Entry Point)
|
||||
- **version** — the version of the module. The version format must strictly follow the [Semver 2.0.0](https://semver.org/) scheme
|
||||
- **releasedate** — the release date of the module of the version. The date format must be `YYYY-MM-DD`
|
||||
- **jar** — the name of the Jar file the module's codes are contained. If there is none, leave it as a blank
|
||||
- **jarhash** — the Sha256sum of the Jar file. If there is no Jar file, leave it as a blank
|
||||
- **dependency** — list the other modules that this module requires.
|
||||
|
||||
### Dependency Format
|
||||
|
||||
The dependency string has following syntax:
|
||||
- `module_name version`
|
||||
- `module1 version;module2 version`
|
||||
- `module1 version;module2 version;module3 version; ...`
|
||||
|
||||
The version string has following syntax:
|
||||
- `a.b.c` — the exact version a.b.c
|
||||
- `a.b.c+` — Any version between a.b.c and a.b.65535
|
||||
- `a.b.*` — Any version between a.b.0 and a.b.65535
|
||||
- `a.b+` — Any version between a.b.0 and a.255.65535
|
||||
- `a.*` — Any version between a.0.0 and a.255.65535
|
||||
- `*` — Any version. Period.
|
||||
|
||||
For example, if your module requires `basegame` 0.3 or higher, the dependency string will be `basegame 0.3+`.
|
||||
|
||||
### icon.png
|
||||
A module can have an icon about themselves. The image must be sized 48x48 and in 32-bit colour PNG format.
|
||||
|
||||
### Jar File
|
||||
A module may have one Jar file. Two or more Jars are not allowed: if your module requires external libraries, package them as a Fatjar.
|
||||
|
||||
## Contents
|
||||
Except for the [[retextures|Modules:Retextures]], there are *technically* no strict directory structure required, certain ingame elements loaded by the engine expects certain paths.
|
||||
|
||||
### Entry Point
|
||||
If your module has a Jar file, it must have single class that extends `net.torvald.terrarum.ModuleEntryPoint`: such class is called a Entry Point. The Entry Point initialises and installs your module to the game. What the Entry Point does to load your module depends upto you, but the engine provides the Modmgr for installing ingame elements to the game.
|
||||
|
||||
### The Modmgr
|
||||
|
||||
The Modmgr provides function to load following ingame elements:
|
||||
- ModMgr.**GameBlockLoader** — loads the blocks and wires
|
||||
- ModMgr.**GameItemLoader** — loads the items
|
||||
- ModMgr.**GameMaterialLoader** — loads the materials that accompany with the blocks and items
|
||||
- ModMgr.**GameLanguageLoader** — loads the text translations
|
||||
- ModMgr.**GameRetextureLoader** — loads the retextures
|
||||
- ModMgr.**GameCraftingRecipeLoader** — loads the crafting recipes
|
||||
|
||||
#### GameBlockLoader
|
||||
|
||||
The GameBlockLoader looks for the `<module root>/blocks/blocks.csv` for the list of blocks and the `<module root>/wires/wires.csv` for the list of wires.
|
||||
|
||||
Every block within a module gets a unique number as an ID. A texture of the block must be named as the ID, with the extension of `.tga`.
|
||||
|
||||
TODO describe the csv
|
||||
|
||||
##### Block Texture Format
|
||||
|
||||
Autotiling and TODO
|
||||
|
||||
#### GameItemLoader
|
||||
|
||||
The GameBlockLoader looks for the `<module root>/items/itemid.csv` for the list of items.
|
||||
|
||||
TODO describe the csv but not the GameItem
|
||||
|
||||
#### GameMaterialLoader
|
||||
|
||||
The GameMaterialLoader looks for the `<module root>/materials/materials.csv` for the list of materials.
|
||||
|
||||
TODO
|
||||
|
||||
#### GameLanguageLoader
|
||||
|
||||
The GameMaterialLoader looks for the `<module root>/locales/` for the translations.
|
||||
|
||||
TODP
|
||||
|
||||
#### GameRetextureLoader
|
||||
|
||||
The GameRetextureLoader looks for the `<module root>/retextures/` for the retextures.
|
||||
|
||||
For the retexture file formats, please refer to the [[Modules:Retextures]]
|
||||
|
||||
#### GameCraftingRecipeLoader
|
||||
|
||||
The GameCraftingRecipeLoader looks for the `<module root>/crafting/*.json` for the crafting recipes.
|
||||
|
||||
TODQ
|
||||
|
||||
Reference in New Issue
Block a user