-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
138 changed files
with
501 additions
and
384 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
github: FlorianMichael | ||
custom: ["https://florianmichael.de/donate"] | ||
custom: [ "https://florianmichael.de/donate" ] | ||
ko_fi: rk_01 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,45 +1,58 @@ | ||
# 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](https://gradle.org/install/). | ||
|
||
ViaFabricPlus uses Gradle, to make sure that it is installed properly you can | ||
check [Gradle's website](https://gradle.org/install/). | ||
|
||
1. Clone the repository using `git clone https://github.com/ViaVersion/ViaFabricPlus`. | ||
2. CD into the local repository. | ||
3. Run `./gradlew genSources`. | ||
4. Open the folder as a Gradle project in your preferred IDE. | ||
5. Run the mod. | ||
|
||
## Update translation files | ||
Translation files are located in `src/main/resources/assets/viafabricplus/lang/`. To update them, you need to do the following: | ||
1. Copy the `en_us.json` file and rename it to the language code of the language you want to update (e.g. `de_de.json` for German) | ||
|
||
Translation files are located in `src/main/resources/assets/viafabricplus/lang/`. To update them, you need to do the | ||
following: | ||
|
||
1. Copy the `en_us.json` file and rename it to the language code of the language you want to update (e.g. `de_de.json` | ||
for German) | ||
2. Translate all values in the file to the language you want to update | ||
3. Do not change the keys of the values, only the values themselves | ||
4. Do not change the formatting of the file (e.g. the spaces between the keys and values or the order of the keys) | ||
5. Try to be consistent with Minecraft language files. | ||
6. Take a look at UN's guidelines for Gender-inclusive language: https://www.un.org/en/gender-inclusive-language/guidelines.shtml | ||
6. Take a look at UN's guidelines for Gender-inclusive | ||
language: https://www.un.org/en/gender-inclusive-language/guidelines.shtml | ||
7. Create a pull request and wait for it to be reviewed and merged. | ||
8. You're done, congrats! | ||
|
||
## Add a new feature or fix a bug | ||
|
||
1. Create a new branch for your feature/bugfix (e.g. `feature/fix-xyz` or `fix/fix-xyz`) | ||
2. Implement your feature/bugfix and make sure it works correctly | ||
3. Clean your code and make sure it is readable and understandable (e.g. use proper variable names) | ||
4. Use the Google java code style (https://google.github.io/styleguide/javaguide.html) and format your code accordingly | ||
5. If you're changing API, make sure to update the documentation in the `docs` folder, add javadocs to your code and don't break backwards compatibility if not necessary | ||
5. If you're changing API, make sure to update the documentation in the `docs` folder, add javadocs to your code and | ||
don't break backwards compatibility if not necessary | ||
6. Create a pull request and wait for it to be reviewed and merged. | ||
7. You're done, congrats! | ||
|
||
## Adding protocol new fixes - which are important and which aren't? | ||
|
||
Protocol fixes are the core functionality of ViaFabricPlus, they make ViaFabricPlus stand out from all other existing | ||
protocol translation platforms, and so it's even more important to keep them working. | ||
|
||
When adding new fixes, you should always check if the fix is relevant for the current version of the game. If you're unsure, | ||
When adding new fixes, you should always check if the fix is relevant for the current version of the game. If you're | ||
unsure, | ||
ask in the ViaVersion discord. | ||
|
||
In general, you should only implement changes which could be detected by the server or are relevant for the gameplay. | ||
In general, you should only implement changes which could be detected by the server or are relevant for the gameplay. | ||
|
||
From experience, most changes are related to either movement or networking. If you contribute new fixes, please proof | ||
your changes by showing that they are relevant and also by providing a game source diff. **It's important that fixes | ||
are changing the actual change happend in the game and not just visual changes.** | ||
|
||
## Maintaining the mod | ||
|
||
See [MAINTAINING.md](docs/MAINTAINING.md) for more information on how to maintain the mod. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,112 +1,112 @@ | ||
plugins { | ||
id "vfp.base-conventions" | ||
id "vfp.base-conventions" | ||
} | ||
|
||
base { | ||
archivesName = "ViaFabricPlus" | ||
archivesName = "ViaFabricPlus" | ||
} | ||
|
||
loom { | ||
accessWidenerPath = file("src/main/resources/viafabricplus.accesswidener") | ||
accessWidenerPath = file("src/main/resources/viafabricplus.accesswidener") | ||
} | ||
|
||
configurations { | ||
jij // jar in jar configuration | ||
modJij // jar in jar configuration for mods | ||
jij // jar in jar configuration | ||
modJij // jar in jar configuration for mods | ||
|
||
include.extendsFrom modJij | ||
modImplementation.extendsFrom modJij | ||
modCompileOnlyApi.extendsFrom modJij | ||
include.extendsFrom modJij | ||
modImplementation.extendsFrom modJij | ||
modCompileOnlyApi.extendsFrom modJij | ||
|
||
// Include VV dependencies as jij | ||
jij.extendsFrom vvDependencies | ||
// Include VV dependencies as jij | ||
jij.extendsFrom vvDependencies | ||
} | ||
|
||
dependencies { | ||
// Fabric API | ||
modJij fabricApi.module("fabric-api-base", project.fabric_api_version) | ||
modJij fabricApi.module("fabric-resource-loader-v0", project.fabric_api_version) | ||
modJij fabricApi.module("fabric-networking-api-v1", project.fabric_api_version) | ||
modJij fabricApi.module("fabric-command-api-v2", project.fabric_api_version) | ||
modJij fabricApi.module("fabric-lifecycle-events-v1", project.fabric_api_version) | ||
modJij fabricApi.module("fabric-particles-v1", project.fabric_api_version) | ||
modJij fabricApi.module("fabric-registry-sync-v0", project.fabric_api_version) | ||
|
||
// Sub projects, since they are Fabric mods as well (mainly to access the game code) we have to first | ||
// implement the namedElements (raw output) to compile against, then include the mappedElements into the output jar | ||
implementation compileOnlyApi(project(path: ":viafabricplus-api", configuration: "namedElements")) | ||
implementation compileOnlyApi(project(path: ":viafabricplus-api-legacy", configuration: "namedElements")) | ||
implementation compileOnlyApi(project(path: ":viafabricplus-visuals", configuration: "namedElements")) | ||
|
||
include project(":viafabricplus-api") | ||
include project(":viafabricplus-api-legacy") | ||
include project(":viafabricplus-visuals") | ||
|
||
// Dependencies exclusively to the root mod | ||
jij ("net.raphimc:MinecraftAuth:4.1.1") { | ||
exclude group: "com.google.code.gson", module: "gson" | ||
exclude group: "org.slf4j", module: "slf4j-api" | ||
} | ||
jij "net.lenni0451:Reflect:1.4.0" | ||
jij("net.lenni0451:MCPing:1.4.2") { | ||
exclude group: "com.google.code.gson", module: "gson" | ||
} | ||
jij("org.cloudburstmc.netty:netty-transport-raknet:1.0.0.CR3-SNAPSHOT") { | ||
exclude group: "io.netty" | ||
} | ||
jij "de.florianmichael:Classic4J:2.1.1-SNAPSHOT" | ||
|
||
// Only to compile against for the ModMenu integration | ||
modCompileOnly "com.terraformersmc:modmenu:12.0.0" | ||
|
||
// Fabric's jar in jar system doesn't support transitive dependencies, so we have to manually add them | ||
afterEvaluate { | ||
configurations.jij.incoming.resolutionResult.allDependencies.each { | ||
dependencies.include(dependencies.implementation(dependencies.compileOnlyApi(it.requested.toString()) { | ||
transitive = false | ||
})) | ||
} | ||
} | ||
// Fabric API | ||
modJij fabricApi.module("fabric-api-base", project.fabric_api_version) | ||
modJij fabricApi.module("fabric-resource-loader-v0", project.fabric_api_version) | ||
modJij fabricApi.module("fabric-networking-api-v1", project.fabric_api_version) | ||
modJij fabricApi.module("fabric-command-api-v2", project.fabric_api_version) | ||
modJij fabricApi.module("fabric-lifecycle-events-v1", project.fabric_api_version) | ||
modJij fabricApi.module("fabric-particles-v1", project.fabric_api_version) | ||
modJij fabricApi.module("fabric-registry-sync-v0", project.fabric_api_version) | ||
|
||
// Sub projects, since they are Fabric mods as well (mainly to access the game code) we have to first | ||
// implement the namedElements (raw output) to compile against, then include the mappedElements into the output jar | ||
implementation compileOnlyApi(project(path: ":viafabricplus-api", configuration: "namedElements")) | ||
implementation compileOnlyApi(project(path: ":viafabricplus-api-legacy", configuration: "namedElements")) | ||
implementation compileOnlyApi(project(path: ":viafabricplus-visuals", configuration: "namedElements")) | ||
|
||
include project(":viafabricplus-api") | ||
include project(":viafabricplus-api-legacy") | ||
include project(":viafabricplus-visuals") | ||
|
||
// Dependencies exclusively to the root mod | ||
jij("net.raphimc:MinecraftAuth:4.1.1") { | ||
exclude group: "com.google.code.gson", module: "gson" | ||
exclude group: "org.slf4j", module: "slf4j-api" | ||
} | ||
jij "net.lenni0451:Reflect:1.4.0" | ||
jij("net.lenni0451:MCPing:1.4.2") { | ||
exclude group: "com.google.code.gson", module: "gson" | ||
} | ||
jij("org.cloudburstmc.netty:netty-transport-raknet:1.0.0.CR3-SNAPSHOT") { | ||
exclude group: "io.netty" | ||
} | ||
jij "de.florianmichael:Classic4J:2.1.1-SNAPSHOT" | ||
|
||
// Only to compile against for the ModMenu integration | ||
modCompileOnly "com.terraformersmc:modmenu:12.0.0" | ||
|
||
// Fabric's jar in jar system doesn't support transitive dependencies, so we have to manually add them | ||
afterEvaluate { | ||
configurations.jij.incoming.resolutionResult.allDependencies.each { | ||
dependencies.include(dependencies.implementation(dependencies.compileOnlyApi(it.requested.toString()) { | ||
transitive = false | ||
})) | ||
} | ||
} | ||
} | ||
|
||
processResources { | ||
filesMatching("fabric.mod.json") { | ||
expand( | ||
"version": project.version, | ||
"description": project.description, | ||
"implVersion": "git-${project.name}-${project.version}:${latestCommitHash().get()}", | ||
"mcVersion": mcVersion() | ||
) | ||
} | ||
filesMatching("fabric.mod.json") { | ||
expand( | ||
"version": project.version, | ||
"description": project.description, | ||
"implVersion": "git-${project.name}-${project.version}:${latestCommitHash().get()}", | ||
"mcVersion": mcVersion() | ||
) | ||
} | ||
} | ||
|
||
String mcVersion() { | ||
if (project.supported_versions.isEmpty()) { | ||
return project.minecraft_version | ||
} else { | ||
return project.supported_versions | ||
} | ||
if (project.supported_versions.isEmpty()) { | ||
return project.minecraft_version | ||
} else { | ||
return project.supported_versions | ||
} | ||
} | ||
|
||
Provider<String> latestCommitHash() { | ||
return providers.exec { | ||
commandLine = ["git", "rev-parse", "--short", "HEAD"] | ||
}.standardOutput.getAsText().map(String::trim) | ||
return providers.exec { | ||
commandLine = ["git", "rev-parse", "--short", "HEAD"] | ||
}.standardOutput.getAsText().map(String::trim) | ||
} | ||
|
||
jar { | ||
// Rename the project's license file to LICENSE_<project_name> to avoid conflicts | ||
from("LICENSE") { | ||
rename { | ||
"${it}_${project.archivesBaseName}" | ||
} | ||
} | ||
// Rename the project's license file to LICENSE_<project_name> to avoid conflicts | ||
from("LICENSE") { | ||
rename { | ||
"${it}_${project.archivesBaseName}" | ||
} | ||
} | ||
} | ||
|
||
idea { | ||
module { | ||
["run"].each { | ||
excludeDirs << file("$it") | ||
} | ||
} | ||
module { | ||
["run"].each { | ||
excludeDirs << file("$it") | ||
} | ||
} | ||
} |
Oops, something went wrong.