mirror of
https://github.com/ViaVersion/ViaForge.git
synced 2024-11-26 12:45:44 +01:00
1.9 KiB
1.9 KiB
Contributing guidelines for the project
Setting up a Workspace
ViaFabricPlus uses Gradle, to make sure that it is installed properly you can check Gradle's website.
- Clone the repository using
git clone https://github.com/ViaVersion/ViaForge
. - CD into the local repository.
- Run
./gradlew build
. - Open the folder as a Gradle project in your preferred IDE.
- Run the mod.
Add a new feature or fix a bug
- Create a new branch for your feature/bugfix (e.g.
feature/fix-xyz
orfix/fix-xyz
) - Implement your feature/bugfix and make sure it works correctly
- Clean your code and make sure it is readable and understandable (e.g. use proper variable names)
- Use the Google java code style (https://google.github.io/styleguide/javaguide.html) and format your code accordingly
- Create a pull request and wait for it to be reviewed and merged.
- You're done, congrats!
Add support for a new Minecraft version
- Create a new branch for the new version (e.g.
update/1.20.6
) - Create a new
viaforge-mc<version>
folder in the root directory of the project - Add a
gradle.properties
file with theforge_version
set (Available at https://files.minecraftforge.net/) - Register it inside the
settings.gradle
file - Copy the code from the previous version and update it accordingly
Build logic
The build.gradle
file contains the shared build code for all submodules. Build code for only specific versions
of the game can be wrapped with checks using the versionId
integer which will be parsed from the forge_version
.
An example would be:
if (versionId >= 1_13_2) {
// We don't need to package mixins into Forge 1.13+ jars, since Forge already has it
exclude("org/spongepowered/**")
}
Notes
Shared source code is inside the src/main/java
root folder, while version-specific code is inside the /viaforge-mc<version>
folders.