diff options
| -rw-r--r-- | Writerside/md.tree | 6 | ||||
| -rw-r--r-- | Writerside/topics/config-file.md | 154 | ||||
| -rw-r--r-- | Writerside/topics/configuration.md | 110 | ||||
| -rw-r--r-- | Writerside/topics/gamerules.md | 44 | ||||
| -rw-r--r-- | Writerside/topics/introduction.md | 8 | ||||
| -rw-r--r-- | Writerside/topics/resource-pack.md | 167 | ||||
| -rw-r--r-- | Writerside/topics/usage.md | 30 | ||||
| -rw-r--r-- | src/main/java/world/anhgelus/molehunt/config/Config.java | 4 |
8 files changed, 404 insertions, 119 deletions
diff --git a/Writerside/md.tree b/Writerside/md.tree index d77dee5..acd9d57 100644 --- a/Writerside/md.tree +++ b/Writerside/md.tree @@ -7,6 +7,10 @@ start-page="introduction.md"> <toc-element topic="introduction.md"/> - <toc-element topic="configuration.md"/> <toc-element topic="usage.md"/> + <toc-element topic="configuration.md"> + <toc-element topic="gamerules.md"/> + <toc-element topic="config-file.md"/> + <toc-element topic="resource-pack.md"/> + </toc-element> </instance-profile>
\ No newline at end of file diff --git a/Writerside/topics/config-file.md b/Writerside/topics/config-file.md new file mode 100644 index 0000000..bbfbecd --- /dev/null +++ b/Writerside/topics/config-file.md @@ -0,0 +1,154 @@ +# Config file + +On top of the gamerules, you can edit a config file, named `molehunt.properties`. +This file is automatically generated when starting a server with the mod installed. + +This file will set the default settings when creating a new world, but that's it. +You will still be able to change the gamerules. Editing this file is recommended +when you plan on having multiple molehunt games with the same settings but on +different worlds. + +> If you only want to change the settings on a single world, or don't want to change +> a lot, I would suggest [playing with the gamerules](gamerules.md) rather than the config +> file, as it is easier and directly in-game +{style=note} + + +## Editing the config file + +You can find the `molehunt.properties` file in your server's `config` folder. +If it is not present, make sure the mod is installed, and start your server. + +Every setting available in the config file reflects a gamerule (they have very +similar names, even though different). To know what each setting does, you can +check [the gamerules documention](gamerules.md). + +The config syntax is very simple: +- `name_of_the_setting = value` to set a setting to a `value`. Only one setting + can be set on a single line +- A line starting with a `#` is a comment, and will not be counted be the mod. + + +## Troubleshooting the config file + +If you realise the config file isn't being applied correctly, check these potential +solutions before making an issue on GitHub. + +### Checking the file location + +Make sure the config file you're editing is located in your server's `config` directory, +and that the file's name is `molehunt.properties`. + +### Check that you use the config file's setting names, and not the gamerule names + +For example, to change the game duration in the config file: +```yaml +# Do this: +game_duration = 30 + +# And NOT this: +gameDurationMinutes = 30 +molehunt:GameDurationMinutes = 30 +``` + +You can see the list of all config file setting in [the default configuration file](#default-configuration). + +### Make sure the syntax is correct + +A comment line starts with a `#`, not with `//` nor with anything else. + +Also, you can only set one variable on one line. For exemple, this is incorrect: +```yaml +# This is not a valid config file +first_setting = 1 second_setting = 2 +# The value must also be on the same line as the +#setting name. This is incorrect: +another_setting = +3 +``` + +### Make sure the setting have the right value type + +A boolean value (one that can either be "on or off") can be set to `true` or `false`, +nothing else. +```yaml +# Good +my_boolean = true + +# Bad +my_boolean = false +``` + +Every numerical value should be integers: there are no decimal values in this mod. +And you should not put the unit after the value (do not put `50 blocks`, but only `50`). + +> If you have checked everything, and there's still a problem, don't hesitate to +> create a new issue on GitHub, **if no existing issue match you problem**. + +## Default configuration + +Here is the default configuration that is automatically generated. Every setting +is listed below. + +To regenerate the default configuration, you can rename, move or delete your +current config file, and then run the server with the mod installed. + +```yaml +# Molehunt mod configuration file +# To regenerate the default configuration, delete, move or rename this file. + +# Game settings + +# The duration of a molehunt game, in minutes. +# Default: 90 minutes (1 hour 30 minutes). +game_duration = 90 + +# Mole percentage. +# For example, a mole percentage of 25% will get 1 mole every 4 players. +# Default: 25 %. +mole_percentage = 25 + +# Mole count (absolute). +# This setting will overwrite the mole_percentage setting. +# If set below 0, this setting is disabled. +# Default: -1. +mole_count = -1 + + +# Client-side settings (applies to all players) + +# Show nametags +# Default: false +show_nametags = false + +# Show skins +# Default: false +show_skins = false + +# Show tab +# Default: false +show_tab = false + + +# World border settings + +# Initial world size (in blocks). +# Default: 200 blocks. +initial_world_size = 200 + +# Final world size (in blocks). +# Default: 50 blocks. +final_world_size = 50 + +# Moving starting time offset (in minutes) +# The time before starting to move the world borders. +# If this value is greater than the game duration, borders will never move. +# Default: 10 minutes. +border_moving_starting_time_offset = 10 + +# Other + +# Enable portals (nether, end, end gateway) +# Default: false +enable_portals = false +``` diff --git a/Writerside/topics/configuration.md b/Writerside/topics/configuration.md index 3f10fa1..a258e4f 100644 --- a/Writerside/topics/configuration.md +++ b/Writerside/topics/configuration.md @@ -1,109 +1,7 @@ # Configuration -The mod has two configurations. -The first one modifies the settings of the current world. -The second one modifies the default settings of all your worlds. +_Almost_ everything in the mod can be modified. You can change the mod's behavior by +changing custom gamerules or editing a config file. -## Common concept - -### Molehunt game configuration : -- Game's duration: `game_duration` (or `gameDuration`). -Sets the game's duration in minutes (default: 90). -- Percentage of mole: `mole_percentage` (or `molePercentage`). -Sets the percentage of mole (default: 25). -- Number of mole: `mole_count` (or `moleCount`). -Sets the number of mole (default: -1). -If you want to use the percentage of mole instead, set this value to -1. - -### Client-side settings (applies to all players) : -- Enable players' nametag: `show_nametags` (or `showNametags`). -Players' nametag is visible (default: false). -- Enable players' skin: `show_skins` (or `showSkins`). -Players' skin is visible (default: false). -- Enable tab: `show_tab` (or `showTab`). -Tab can be used (default: false). - -### World-border settings : -- World border size when starting the game : `initial_world_size` (or `initialWorldSize`). -- Target border size on the end of the game : `final_world_size` (or `finalWorldSize`). -- Time before moving the borders : `border_moving_starting_time_offset` (or `borderMovingStartingTimeOffsetMinutes`). - -### Misc -- Enable portals (for the nether, the end and the end gateway) : `enable_portals` (or `enablePortals`). - -Every clientside rules (nametag, skin and tab) are only used by the client during a game. -Before and after the game, they are not used. - -## Configuration per world - -All settings can be modified via gamerules. - -Every gamerule related to this mod starts with the prefix `molehunt:`. - -## Modifying default configuration - -> These settings do not override the configuration per world! -{style="note"} - -A configuration file is available inside the `config` folder. -This is `molehunt.properties`. - -### Default configuration - -```ini -# Molehunt mod configuration file -# To regenerate the default configuration, delete, move or rename this file. - -# Game settings - -# The duration of a molehunt game, in minutes. -# Default: 90 minutes (1 hour 30 minutes). -game_duration = 90 - -# Mole percentage. -# For example, a mole percentage of 25% will get 1 mole every 4 players. -# Default: 25 %. -mole_percentage = 25 - -# Mole count (absolute). -# This setting will overwrite the mole_percentage setting. -# If set below 0, this setting is disabled. -# Default: -1. -mole_count = -1 - - -# Client-side settings (applies to all players) - -# Show nametags -# Default: false -show_nametags = false - -# Show skins -# Default: false -show_skins = false - -# Show tab -# Default: false -show_tab = false - - -# World border settings : - -# Initial world size (in blocks). -# Default: 200 blocks. -initial_world_size = 200 - -# Final world size (in blocks). -# Default: 50 blocks. -final_world_size = 50 - -# Shrinking starting offset (in minutes) -# The time before starting to shrink the world borders. -# If this value is greater than the game duration, borders will never shrink. -# Default: 10 minutes. -border_shrinking_starting_time_offset = 10 - -# Enable portals (nether, end, end gateway) -# Default: false -enable_portals = false -``` +To change the mod's text and default skin, you can use a custom resource pack and set +it to be the default resource pack on your server. diff --git a/Writerside/topics/gamerules.md b/Writerside/topics/gamerules.md new file mode 100644 index 0000000..c838643 --- /dev/null +++ b/Writerside/topics/gamerules.md @@ -0,0 +1,44 @@ +# Gamerules + +To change the mods behavior, you can change your world's gamerules. Every gamerule added +by this mod starts with the prefix `molehunt:`. + +> If plan on making multiple worlds, and don't want to set the gamerules each time, +> [edit the configuration file](config-file.md). +{style=tip} + +Here's a list of all the Molehunt gamerules. + +## Molehunt gamerule list + +### Molehunt game configuration + +- `gameDurationMinutes`: sets the game's duration in minutes (default: `90 minutes`). +- `molePercentage`: sets the mole percentage among all players (default: `25 %`). +- `moleCount`: the absolute mole amount. Overwrites `molePercentage`. To disable + this setting, set it to `-1` (default: `-1`). + +### Client-side settings + +> These gamerules affect client-side features, but are still applied to all players. +> +> Also, they will only be effective when the game starts. +{style=note} + +- `showNametags`: players' nametags are shown (default: `false`). +- `showSkins`: players' custom skin is visible. Setting this to false will + result in everyone having the same skin. This skin can be customized by [creating + a custom resource pack](resource-pack.md) (default: `false`). +- `showTab`: The server player list will be shown (default: `false`). + +### Server-side settings + +- `enablePortals`: enables all portals to other dimensions (default: `false`). + +#### World-border settings + +- `initialWorldSize`: the world size when starting the game (default: `200 blocks`). +- `finalWorldSize`: the target world size on the end of the game (default: `50 blocks`). +- `borderMovingStartingTimeOffsetMinutes`: the time before the world borders start to move in minutes (default: `5 minutes`). + > Setting this to a value greater than `gameDuration` will make the borders never move. + {style=note} diff --git a/Writerside/topics/introduction.md b/Writerside/topics/introduction.md index f1fa63e..e2ef02c 100644 --- a/Writerside/topics/introduction.md +++ b/Writerside/topics/introduction.md @@ -11,4 +11,10 @@ Download the mod for your version. The mod requires [Fabric-API](https://modrinth.com/mod/fabric-api) to works. [Simple Voice Chat](https://modrinth.com/plugin/simple-voice-chat) is highly recommended. -The mod has to be installed on the server *and* on every client. +> If you use Simple Voice Chat, make sure to disable private groups, +> as they would ruin the immersion. +{style=tip} + +The mod has to be installed on the server *and* on every client. The mod is required +to be installed on clients for some client-side features (such as hiding nametags +or changing skins). diff --git a/Writerside/topics/resource-pack.md b/Writerside/topics/resource-pack.md new file mode 100644 index 0000000..c2fd871 --- /dev/null +++ b/Writerside/topics/resource-pack.md @@ -0,0 +1,167 @@ +# Making a cutom resource pack + +If you want to customize visual elements of the mod, you can create +your own custom resource pack. + +Doing so will enable you to change or translate every text line used by +the mod, and also change to default skin that is applied to all players +(if the [gamerule `showSkins`](gamerules.md#client-side-settings) is set to true). + +> After creating your resource pack, you can either force its use by setting it as +> the server's resource pack, or make it optional (it's purely visuals anyway!) +{style=tip} + + +## First steps + +First, create a folder with your resource pack name (it can be whatever you want!). Then, +inside of this folder, create a file named `pack.mcmeta`. This file is very important: it tells +the game that it is indeed a resource pack. + +Now, edit the `pack.mcmeta` file with your favorite text editor, and write the following: +```json +{ + "pack": { + "description": "An awesome description for an awesome resource pack", + "pack_format": 34 + } +} +``` + +> Note that the `pack_format` used here (34) corresponds to minecraft version 1.21.x. If you +> are making the resource pack for another version, you can check which pack format to use +> [on the wiki](https://minecraft.wiki/w/Pack_format). +{style=note} + +You can now close the `pack.mcmeta` file. Now, inside your resource pack's main folder, +create a folder named `assets`, and inside it make another folder name `molehunt`. + +You file tree you look like that: +``` +π MyAwesomeResourcePack +βββ π pack.mcmeta +βββ π assets + βββ π molehunt +``` + +> If you want, you can also add an icon to your resource pack: just add a png file named +> `pack.png` in your resource pack's main folder. +{style=tip} + + +## Adding a custom skin + +To add a custom skin, first you need to make one. You can either use +your own skin, or make a new one using a minecraft skin editor (there are +a lot online). + +Then grab your skin file (make sure it's a `.png` file!), name it `skin.png` +and put it inside a `textures` folder, inside the `molehunt` folder. It should +look like that: +``` +... +π assets +βββ π molehunt + βββ π textures + βββ π skin.png +``` + +Now everyone in the game will be wearing your custom skin! + + +## Changing the mod's text + +Finally, if the mod's text doesn't suit you, or if you want to translate +it to another language, you can! + +> Note that french is already supported by default, so no need to translate +> to it. +{style=tip} + +First, create a new folder in the `molehunt` folder named `lang`, then create +a `en_us.json` file. + +> If you want to target another language, name the file according to your language +> and region. For example: `fr_fr.json` for French in France. +{style=note} + +Now copy the content of the [default `en_us.json` file](#default-en-us-json-language-file) +in you language file, and start editing the lines you want to change! + +Finally, your file structure should look like that: +``` +... +π assets +βββ π molehunt + βββ π lang + βββ π en_us.json + βββ π en_pt.json + βββ etc. +``` +(You can have only one, or multiple language files, it doesn't matter) + +[Minecraft formatting codes](https://minecraft.wiki/w/Formatting_codes) are +supported in `titles` and `subtitles`. + + +## Final file tree, and installing your resource pack + +If you followed every step of this tutorial, the final resource pack should look like this: +``` +π MyAwesomeResourcePack +βββ π pack.mcmeta +βββ π pack.png (optional) +βββ π assets + βββ π molehunt + βββ π textures + β βββ π skin.png + βββ π lang + βββ π en_us.json + βββ π en_pt.json + βββ etc. +``` + +To install it on your client, simply put your awesome resource pack in the `resourcepacks` folder +of [your `.minecraft` folder](https://minecraft.wiki/w/.minecraft). + +If you want, you can zip it to make sharing it easier, but it is not required. + + +## Default `en_us.json` language file + +Here's the default `en_us.json` file. You can use it as a template to +customize the mod's text lines. + +> The weird `Β§` and the character after it corresponds to a minecraft +> formatting code. It can change the text's color and format. You can +> learn more [on the wiki](https://minecraft.wiki/w/Formatting_codes). +{style=tip} + +```json +{ + "commands.molehunt.stop.failed": "The Molehunt game has not been started yet.", + "commands.molehunt.timer.show": "Showing Molehunt timer.", + "commands.molehunt.timer.hide": "Hiding Molehunt timer.", + "commands.molehunt.moles.list": "List of moles:", + "commands.molehunt.moles.list.deny": "You can't see the list of moles.", + "commands.molehunt.stop.success": "The Molehunt game has been stopped.", + "molehunt.game.end.suspense.title": "Β§eAnd the winners are...", + "molehunt.game.end.winners.moles.title": "Β§cThe Moles!", + "molehunt.game.end.winners.survivors.title": "Β§aNot the Moles!", + "molehunt.game.end.winners.subtitle": "Β§6The Moles were", + "molehunt.game.start.suspense": "Β§eYou are...", + "molehunt.game.start.mole.title": "Β§cThe Mole!", + "molehunt.game.start.mole.subtitle": "Β§eGet the list of moles with Β§6/molehunt moles", + "molehunt.game.start.survivor.title": "Β§aNot the Mole!", + "molehunt.game.start.survivor.subtitle": "Β§eTry to survive and find out who's the mole!", + "gamerule.molehunt:gameDuration": "Molehunt: Duration of a game", + "gamerule.molehunt:molePercentage": "Molehunt: Percentage of Mole", + "gamerule.molehunt:moleCount": "Molehunt: Number of Mole", + "gamerule.molehunt:showNametags": "Molehunt: Show players' nametag", + "gamerule.molehunt:showTab": "Molehunt: Enable the tab", + "gamerule.molehunt:showSkins": "Molehunt: Show players' skin", + "gamerule.molehunt:initialWorldSize": "Molehunt: Initial world size", + "gamerule.molehunt:finalWorldSize": "Molehunt: Final world size", + "gamerule.molehunt:borderMovingStartingTimeOffsetMinutes": "Molehunt: Time before moving the borders" +} +``` diff --git a/Writerside/topics/usage.md b/Writerside/topics/usage.md index 2a02033..1170ba8 100644 --- a/Writerside/topics/usage.md +++ b/Writerside/topics/usage.md @@ -1,13 +1,25 @@ -# Usage +# Using the mod -To start a game, execute `/molehunt start`. -You must be OP. +## Starting and stopping the game -To stop a game, execute `/molehunt stop`. -You must be OP. -(They are already an automatic end if there is no more survivors or if the time is over.) +To start a game, execute `/molehunt start` (you must be OP). -To get the list of moles, use `/molehunt moles`. -You must be a mole. +The game ends automatically if one of these two condition is met: +- Every alive player is a mole. +- The timer has run out. -To edit the timer above the hotbar, use `/molehunt timer show` to enable and `/molehunt timer hide` to disable. +The game does not automatically end when every mole is dead to allow for +some funny moments. But if needed, you can stop the game early by using +`/molehunt stop` (you must be OP). + + +## Player commands + +The mod also provide a few commands for every player. + +For moles and spectating players only, using `/molehunt moles` will give +you the list of the moles. + +To some people, the timer above you hotbar could be annoying. To hide it, +use `/molehunt timer hide`. If you want to see it again, use +`/molehunt timer show`. diff --git a/src/main/java/world/anhgelus/molehunt/config/Config.java b/src/main/java/world/anhgelus/molehunt/config/Config.java index b2e45ab..1f617e6 100644 --- a/src/main/java/world/anhgelus/molehunt/config/Config.java +++ b/src/main/java/world/anhgelus/molehunt/config/Config.java @@ -124,8 +124,8 @@ public class Config { # Other - # Enable portals (nether, end, end gateway) - # Default: false + # Enable portals (nether, end, end gateway). + # Default: false. enable_portals = false """; } |
