|
1 | | -## CSS-Minecraft |
2 | | -This is the source code for CSS' Minecraft plugin. |
| 1 | +# CSS Minecraft |
| 2 | +This is the source code for CSS' Minecraft plugin/mod. |
3 | 3 |
|
4 | 4 | ## Building |
5 | 5 |
|
6 | | -Ensure that you have maven installed. |
7 | | -Then: |
| 6 | +To compile, run the `build` Gradle task. |
| 7 | + |
8 | 8 | ``` |
9 | | -maven clean package |
| 9 | +./gradlew build |
10 | 10 | ``` |
11 | 11 |
|
12 | | -This will automatically execute the shadow-jar goal in the package cycle. |
13 | | - |
14 | | -There will now be a .jar file located in /target |
15 | | - |
16 | | -You can now put this .jar file in the /plugins folder in a Spigot/CraftBukkit 1.17.1 server and run the server. |
| 12 | +Jars will be output to `**/build/libs/cssminecraft-*.jar`. |
17 | 13 |
|
18 | 14 | ## Configuration |
19 | 15 |
|
| 16 | +The configuration file will be located in the server configuration directory, which depends on the platform. |
| 17 | +Typically, this will be at: |
20 | 18 |
|
21 | | -MEMBER_ROLE_ID: The ID of the role that the plugin checks against when someone runs the /makegreen command. |
| 19 | +* **bukkit**: `plugins/CSSMinecraft/config.yml` |
| 20 | +* **fabric**: `config/cssminecraft/config.yml` |
| 21 | +* **forge**: `config/cssminecraft/config.yml` |
22 | 22 |
|
23 | | -BRIDGE_CHANNEL_ID: The ID of the channel to send bridged messages to Minecraft. |
| 23 | +```yaml |
| 24 | +# The ID of the role that the plugin checks against when someone runs the /makegreen command. |
| 25 | +member-role-id: 0 |
24 | 26 |
|
25 | | -DISCORD_SERVER_ID: The ID of the guild to interact with. |
| 27 | +# The ID of the channel to send bridged messages to Minecraft. |
| 28 | +bridge-channel-id: 0 |
26 | 29 |
|
27 | | -WEBHOOK_URL: The URL of the Discord webhook to send bridged messages from Minecraft. |
| 30 | +# The ID of the guild to interact with. |
| 31 | +discord-server-id: 0 |
28 | 32 |
|
29 | | -AVATAR_SERVICE: A link to an avatar service, with %s as a placeholder of the user's minecraft username. |
| 33 | +# The URL of the Discord webhook to send bridged messages from Minecraft. |
| 34 | +webhook-url: "" |
30 | 35 |
|
31 | | -BOT_TOKEN: The token of the Discord bot that will be detecting messages to send to Minecraft, as well as Member roles. |
| 36 | +# The token of the Discord bot that will be detecting messages to send to Minecraft, as well as Member roles. |
| 37 | +bot-token: "" |
32 | 38 |
|
| 39 | +# A link to an avatar service, with %s as a placeholder of the user's minecraft username. |
| 40 | +# This is used as the profile picture URL in webhook messages. |
| 41 | +# We'd recommend the following value: https://cravatar.eu/helmhead/%s/190.png |
| 42 | +avatar-service: "" |
| 43 | + |
| 44 | +# The verbosity of logging (0 = error only, 1 = +warnings, 2 = +info, 3 = +debug) |
| 45 | +logging-level: 2 |
| 46 | +``` |
33 | 47 |
|
34 | 48 | ## Dependencies |
35 | 49 |
|
36 | | -This plugin depends on [LuckPerms](https://www.spigotmc.org/resources/luckperms.28140/), which needs to be placed alongside this in the /plugins folder. |
| 50 | +This plugin optionally depends on [LuckPerms](https://luckperms.net/) to grant the member role. |
| 51 | +
|
| 52 | +Without it, only the Discord message bridge will be functional. |
37 | 53 |
|
38 | 54 | ## Development |
39 | 55 |
|
40 | 56 | PR's welcome, feel free to do whatever. |
| 57 | +
|
| 58 | +The project is written mostly in an abstract fashion to help re-use code across |
| 59 | +different platforms. |
| 60 | +
|
| 61 | +Each Gradle subproject has the following purpose: |
| 62 | +* `/common`: platform-independent interfaces and implementations which houses most logic - the |
| 63 | +following subprojects depend on this |
| 64 | +* `/bukkit`: specific implementation for Bukkit / Spigot / Paper etc. |
| 65 | +* `/fabric`: specific implementation for Fabric servers |
| 66 | +* `/forge`: specific implementation for Forge servers |
| 67 | + |
| 68 | +Note that this is a server only mod, and will not work on clients. |
| 69 | + |
| 70 | +## Version matrix |
| 71 | + |
| 72 | +The following table documents mod compatibility for older versions of Minecraft and their platforms. |
| 73 | +Any versions prior to 1.12.1 are backports. |
| 74 | + |
| 75 | +If a Minecraft version is not listed here, then no version of the mod exists for it. |
| 76 | + |
| 77 | +All version branches will follow the name `minecraft/<version>`. |
| 78 | + |
| 79 | +| Minecraft | Java | Bukkit | Forge | Fabric | Links | |
| 80 | +|-----------|------|--------|-------|--------|-------------------------------------------------------------------------| |
| 81 | +| 1.21.1 | 21 | ✅ | ✅ | ✅ | (master) | |
| 82 | +| 1.18.2 | 17 | ❌ | ❌ | ✅ | [Branch](https://github.com/CSSUoB/CSS-Minecraft/tree/minecraft/1.18.2) | |
| 83 | +| 1.12.2 | 8 | ❌ | ✅ | ❌ | [Branch](https://github.com/CSSUoB/CSS-Minecraft/tree/minecraft/1.12.2) | |
| 84 | + |
| 85 | +**Never merge `minecraft/*` branches into master.** Build features/fixes in master and cherry-pick backwards. |
| 86 | + |
| 87 | +### Upgrading to future versions |
| 88 | + |
| 89 | +The `master` branch should always target the latest version. |
| 90 | +Before upgrading, create a new release branch for the current version using the naming |
| 91 | +scheme `minecraft/<version>`. |
| 92 | + |
| 93 | +Then, make the necessary changes to upgrade Minecraft version. Bukkit / Spigot / Paper |
| 94 | +has a stable enough API where not many changes will be needed (if any at all), but |
| 95 | +other platforms will likely break. |
| 96 | + |
| 97 | +Once changes are done, update the version matrix and open a new PR to `master`. |
| 98 | + |
| 99 | +### Backporting to older versions |
| 100 | + |
| 101 | +This mod was originally made for Minecraft 1.21, thus |
| 102 | +it will require backporting to work on older modpacks. |
| 103 | + |
| 104 | +Create a branch from the nearest Minecraft version and name it `minecraft/<version>`. |
| 105 | +You may be required to change the Java version, or upgrade/downgrade Gradle. |
| 106 | +It should be noted that Fabric does not exist prior to Minecraft 1.14. |
| 107 | + |
| 108 | +Once finished, push the branch to GitHub and update this version matrix with the platform |
| 109 | +and version you have backported. |
| 110 | + |
0 commit comments