|
1 | | -# Configuration File |
| 1 | +# Dockyard Configuration |
2 | 2 |
|
3 | 3 | ## Overview |
4 | 4 |
|
5 | | -The configuration file contains a bunch of dockyard settings you can change, including networking, chunk engine, implementations etc. |
6 | | -The config is stored in the core directory with the name `dockyard.toml` |
| 5 | +Dockyard has very simple dsl style config you can change when creating the DockyardServer object |
7 | 6 |
|
8 | 7 | ## Configuration Settings |
9 | 8 |
|
10 | | -* `configVersion` (Int): The version of this configuration file. |
11 | | -* `serverConfig`: |
12 | | - * `ip` (String): IP address for the server to run on |
13 | | - * `port` (Int): Port |
14 | | - * `networkCompressionThreshold` (Int): Minimum size (in bytes) for data to be compressed before sending over the network |
15 | | - * `debug` (Boolean): Enables or disables debug/developer mode (Do not enable on production servers, its lot of spam) |
16 | | - * `cacheSchematics` (Boolean): Enables or disables caching of schematic files. If you are gonna be placing same schematic multiple times, this will cache the schematic when its first parsed. Any subsequent placements will retrieved it from the cache instead of parsing it again. Do keep in mind, if the contents of the file changes, the cache will be invalidated. |
17 | | - * `maxPlayers` (Int): Maximum amount of players able to join the server |
18 | | -* `chunkEngine` |
19 | | - * `async` (Boolean): Specifies if the server should do chunk loading and generation asynchronously |
20 | | -* `implementationConfig`: |
21 | | - * `applyBlockPlacementRules` (Boolean): Enables or disables block placement rules. (These are very barebones) |
22 | | - * `notifyUserOfExceptionDuringCommand` (Boolean): If exception is thrown during command execution, should the executor be notified? |
23 | | - * `commandErrorPrefix` (String): The prefix of command error message |
24 | | - * `commandNoPermissionsMessage` (String): The message that gets sent to the player when they do not have permissions to execute the command |
25 | | -* `defaultImplementations`: |
26 | | - * `dockyardCommands` (Boolean): Enables or disables the core dockyard commands like `/gamemode`, `/world` and `/version` |
27 | | - |
28 | | -## Current Default Config |
29 | | - |
30 | | -```toml |
31 | | -configVersion = 3 |
32 | | - |
33 | | -[serverConfig] |
34 | | - ip = "0.0.0.0" |
35 | | - port = 25565 |
36 | | - networkCompressionThreshold = 256 |
37 | | - cacheSchematics = true |
38 | | - debug = false |
39 | | - maxPlayers = 50 |
40 | | - |
41 | | -[chunkEngine] |
42 | | - async = true |
43 | | - |
44 | | -[implementationConfig] |
45 | | - applyBlockPlacementRules = true |
46 | | - notifyUserOfExceptionDuringCommand = true |
47 | | - commandErrorPrefix = "<dark_red>Error <dark_gray>| <red>" |
48 | | - commandNoPermissionsMessage = "You do not have permissions to execute this command!" |
49 | | - |
50 | | -[defaultImplementations] |
51 | | - dockyardCommands = true |
52 | | -``` |
53 | | - |
54 | | -## Config Change History |
55 | | - |
56 | | -### Changes in config version 3: |
57 | | - |
58 | | -- Renamed `bundledPlugins` to `defaultImplementations` since plugin support was completely removed |
59 | | -- Removed `dockyardExtras` from implementations |
60 | | -- Added `notifyUserOfExceptionDuringCommand` to implementation config |
61 | | -- Added `commandErrorPrefix` to implementation config |
62 | | -- Added `commandNoPermissionsMessage` to implementation config |
63 | | -- Added `maxPlayers` to server config |
64 | | - |
65 | | -### Changes in config version 2: |
66 | | - |
67 | | -- Removed `mayaTestPlugin` from implementations |
68 | | -- Removed `mudkipTestPlugin` from implementations |
69 | | -- Removed `emberSeeker` from implementations |
70 | | -- Added `cacheSchematics` to server config |
| 9 | +- `withIp(string)` |
| 10 | +- `withPort(int)` |
| 11 | +- `useMojangAuth(boolean)` |
| 12 | +- `withNetworkCompressionThreshold(int)` |
| 13 | +- `withMaxPlayers(int)` |
| 14 | +- `useDebugMode(bool)` |
| 15 | +- `withImplementations(ImplementationConfig)` |
| 16 | + |
| 17 | +## Implementation Config |
| 18 | + |
| 19 | +These are some basic default implementations that come with dockyard |
| 20 | + |
| 21 | +- `applyBlockPlacementRules` (bool) |
| 22 | +- `notifyUserOfExceptionDuringCommand` (bool) |
| 23 | +- `commandErrorPrefix` (string) |
| 24 | +- `commandNoPermissionsMessage` (string) |
| 25 | +- `cacheSchematics` (bool) |
| 26 | +- `dockyardCommands` (bool) |
| 27 | +- `npcCommand` (bool) |
| 28 | +- `itemDroppingAndPickup` (bool) |
| 29 | + |
| 30 | +## Example |
| 31 | + |
| 32 | +```kotlin |
| 33 | +val server = DockyardServer { |
| 34 | + withIp("0.0.0.0") |
| 35 | + withMaxPlayers(50) |
| 36 | + withPort(25565) |
| 37 | + useMojangAuth(true) |
| 38 | + withImplementations { |
| 39 | + dockyardCommands = true |
| 40 | + itemDroppingAndPickup = true |
| 41 | + } |
| 42 | +} |
| 43 | + |
| 44 | +server.start() |
| 45 | +``` |
0 commit comments