# Contributing

Contributions are always welcomed, in any form.


## For non-developers

You are welcome to:

* Ask questions, share experiences, and request features on [the GitHub Discussions page](https://github.com/IzzelAliz/Arclight/discussions).
* Submit bugs or something not working to [the GitHub issues page](https://github.com/IzzelAliz/Arclight/issues).
* Submit new translations [here](https://github.com/IzzelAliz/Arclight/tree/FeudalKings/i18n-config/src/main/resources/META-INF/i18n).


## For developers

We have reworked the project structure in 1.20.4, we may separate them to describe it.


### **Prerequisite**

* A Java IDE that supports Gradle (IntelliJ IDEA is recommended).
* Understanding of Java, Gradle, Minecraft, ModLoaders(Forge/NeoForge/Fabric), and Bukkit.
* Arclight is based on [SpongeMixin](https://github.com/SpongePowered/Mixin). Understanding how to write Mixins and how they work is important.


### Setting up the workspace

**After 1.20.4:**

Clone this project and import it into a Java IDE.

**Before 1.20.2:**

Clone this project first, and in the project folder, run `gradlew remapSpigotJar`. When it's done, import this project into your IDE and refresh it.

To build Arclight, run `gradlew remapSpigotJar idea` first and run `gradlew build`. If you have not built it before, you need to run `gradlew build` again.

Refer to <https://gist.github.com/IzzelAliz/ddac7f3f1a82dd19d28e29b1da33aac1> for setting up a mojmap spigot workspace.


### Project structure

**After 1.20.4:**

* The `arclight-common` contains most of the codes.
  * The mixins are in `io/izzel/arclight/common/mixin` package.
  * The bridges provide the interface among our mixins and platforms, they are implemented in mixins.
  * The other codes including the remapper are in the `io/izzel/arclight/common/mod` package.
* The `arclight-forge` `arclight-neoforge` `arclight-fabric` contains platform-specific codes, its structure is similar to the `arclight-common`.
* The `bootstrap` bundles subprojects to a server jar.
* The `installer` will install mod loaders automatically at run time.
* The `buildSrc` is used for remapping the spigot jar in the developing environment.
* The `i18n-config` contains multi-language translations of arclight.

**Before 1.20.2:**

* The `arclight-api` contains codes that are not related to Minecraft.
* The `arclight-common` contains most of the codes.
  * The mixins are in the `io/izzel/arclight/common/mixin` package.
  * The bridge classes bridge the gap between Minecraft and Bukkit, which are implemented in mixins.
  * The other codes including the remapper are in the `io/izzel/arclight/common/mod` package.
* The `arclight-forge`  contains forge-specific mixins.
* The `forge-installer` contains the code to install Forge and bundle arclight as a server jar.
* The `buildSrc` is used for remapping the spigot jar in the developing environment. 
* The `i18n-config` contains multi-language translations of arclight.


### Code style

* In general, follow Google Java Style.
* Mixins should follow this [implementation policy](https://github.com/SpongePowered/Sponge/wiki/Implementation-Policy:-Bridges-and-Mixins): mixin method names and bridge class names
* Shadows should be wrapped using `@formatter:off/on` for readability


### Tips

**Before 1.20.2:**

* You can find bukkit <-> srg mappings in `build/arclight_cache/tmp_srg/bukkit_srg.srg` once you built the project


### Reminder to upgrade the Minecraft version

Following steps:

* Update Minecraft and mod-loader versions in `build.gradle`.
* Change the Bukkit version in `arclight-common/build.gradle`.
* Check the upstream commits, all from SpigotMC, MinecraftForge, NeoForged, and FabricMC.
* Update resource files, including `async-catcher.json`, `arclight.accesswidener` (don’t forget to remove the duplicate entries in AW).
* Upload new library files to `arclight.mcxk.net`.

---

**Documents**

- [Versions and its supporting status](https://wiki.izzel.io/s/arclight-docs/doc/versions-and-its-supporting-status-NCKYxXI3mt)
- [Tutorials](https://wiki.izzel.io/s/arclight-docs/doc/tutorials-LsIkwojL9P)
- [Administration](https://wiki.izzel.io/s/arclight-docs/doc/administration-puh66tln4f)
- [Development](https://wiki.izzel.io/s/arclight-docs/doc/development-kCaAexaIdQ)
- [FAQ](https://wiki.izzel.io/s/arclight-docs/doc/faq-ApcZ25PXVT)
- [Donate](https://wiki.izzel.io/s/arclight-docs/doc/donate-Bj9cf2F5YH)