From c32b07c8af0bd5c157de48f0cce282bdd76d4255 Mon Sep 17 00:00:00 2001 From: xpple Date: Tue, 6 Aug 2024 00:40:13 +0200 Subject: [PATCH] Update README --- README.md | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 99bc32f..763ed9e 100644 --- a/README.md +++ b/README.md @@ -14,19 +14,24 @@ public class Configs { ``` Finally, register your `Configs` class. - For Fabric users, register the `Configs` class in your mod's `onInitialize(Client)` method. Replace `` with your -mod's id. - ```java - new ModConfigBuilder(, Configs.class).build(); - ``` +mod's id. Sometimes you may omit the generics and just do `<>` instead. + - On clients: + ```java + new ModConfigBuilder(, Configs.class).build(); + ``` + - On servers: + ```java + new ModConfigBuilder(, Configs.class).build(); + ``` - For Paper users, register the `Configs` class in your plugin's `onEnable` method. Replace `` with your plugin's name. ```java - new ModConfigBuilder(, Configs.class).build(); + new ModConfigBuilder<>(, Configs.class).build(); ``` That's it! Now you can access `exampleString` through `Configs.exampleString`. You can edit `exampleString` by using the config command. - On Fabric there are different commands for the client and server. For both, replace `` with your mod's id. - - On the client, execute `/cconfig exampleString set `. + - On clients, execute `/cconfig exampleString set `. - On servers, execute `/config exampleString set `. - On Paper servers, execute `/config exampleString set `. Replace `` with your plugin's name. @@ -37,7 +42,7 @@ the options `add`, `put` and `remove` available. Moreover, you can define your o configurations with arbitrary types. To do this, all you have to do is register the (de)serialiser when you build your config. For instance, to create configurations with type `Block` you can do ```java -new ModConfigBuilder(, Configs.class) +new ModConfigBuilder<>(, Configs.class) .registerTypeHierarchy(Block.class, new BlockAdapter(), BlockArgumentType::block) .build(); ``` @@ -74,7 +79,8 @@ And many more things! For some illustrative examples, see the `Configs` class fo [Paper](paper/src/testplugin/java/dev/xpple/betterconfig/Configs.java). ## Installation -Replace `${version}` with the artifact version. Append `-fabric` for Fabric and `-paper` for Paper. +Replace `${version}` with the artifact version. Append `-fabric` for Fabric and `-paper` for Paper to the base artifact +name. You may choose between my own maven repository and GitHub's package repository. ### My own