diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 06672b55..afeb3374 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,3 +1,3 @@ github: FlorianMichael -custom: ["https://florianmichael.de/donate"] +custom: [ "https://florianmichael.de/donate" ] ko_fi: rk_01 diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index a6ef8440..15082b47 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -1,6 +1,6 @@ name: Bug Report description: Report a bug in ViaFabricPlus -labels: [bug] +labels: [ bug ] body: - type: markdown diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 916552a7..ca1fc8ba 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,5 +1,5 @@ name: Build -on: [pull_request, push, workflow_dispatch] +on: [ pull_request, push, workflow_dispatch ] jobs: build: diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index cc8de439..706588ad 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,7 +1,10 @@ # 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`. @@ -9,37 +12,47 @@ ViaFabricPlus uses Gradle, to make sure that it is installed properly you can ch 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. \ No newline at end of file diff --git a/README.md b/README.md index d2108e4d..cffbcbf5 100644 --- a/README.md +++ b/README.md @@ -9,19 +9,24 @@ #### Fabric mod to connect to EVERY Minecraft server version (Release, Beta, Alpha, Classic, Snapshots, Bedrock) with QoL fixes to the gameplay + # Why another protocol translator? -ViaFabricPlus implements the [ViaVersion projects](https://github.com/ViaVersion) into Fabric and provides tons of fixes to the existing protocol translation which can't be implemented in the original ViaVersion project. + +ViaFabricPlus implements the [ViaVersion projects](https://github.com/ViaVersion) into Fabric and provides tons of fixes +to the existing protocol translation which can't be implemented in the original ViaVersion project. These fixes consist of movement changes, block/entity collisions, rendering changes, and many more. -At the time of writing, ViaFabricPlus is the only mod that supports joining all Minecraft server versions down to the first multiplayer version while implementing +At the time of writing, ViaFabricPlus is the only mod that supports joining all Minecraft server versions down to the +first multiplayer version while implementing legacy combat mechanics, movement, and rendering changes to make the gameplay feel more like the old days. **On the other hand, ViaFabricPlus supports only the latest Minecraft client version, and only Fabric.** If you need ViaFabricPlus for older versions of the game, you can use [ViaFabric](https://viaversion.com/fabric) ## Supported Server versions + - Release (1.0.0 - 1.21.4) - Beta (b1.0 - b1.8.1) - Alpha (a1.0.15 - a1.2.6) @@ -31,28 +36,36 @@ If you need ViaFabricPlus for older versions of the game, you can use [ViaFabric - Bedrock Edition 1.21.50 ([Some features are missing](https://github.com/RaphiMC/ViaBedrock#features)) ## How to (Users) + - [A detailed guide on how to install and use the mod](docs/USAGE.md) - If you encounter any issues, please report them on either: - - [the issue tracker](https://github.com/ViaVersion/ViaFabricPlus/issues) - - [the ViaVersion Discord](https://discord.gg/viaversion) + - [the issue tracker](https://github.com/ViaVersion/ViaFabricPlus/issues) + - [the ViaVersion Discord](https://discord.gg/viaversion) ## How to (Developers) + - [Detailed guidelines for contributions as well as setting up a dev environment](CONTRIBUTING.md) - [API and integration examples for developers](docs/DEVELOPER_API.md) ## ViaFabric -[ViaFabric](https://github.com/ViaVersion/ViaFabric) can be used for server-side purposes or when using older versions of the game. + +[ViaFabric](https://github.com/ViaVersion/ViaFabric) can be used for server-side purposes or when using older versions +of the game. ### Does it work with ViaFabricPlus: - No, ViaFabricPlus cannot be used with ViaFabric. ### Differences with ViaFabric: + https://github.com/ViaVersion/ViaFabric?tab=readme-ov-file#differences-with-viafabricplus ## Credits + Special thanks to all our [Contributors](https://github.com/ViaVersion/ViaFabricPllus/graphs/contributors). ## Disclaimer -It cannot be guaranteed that this mod is allowed on specific servers as it can possibly cause problems with anti-cheat plugins.\ + +It cannot be guaranteed that this mod is allowed on specific servers as it can possibly cause problems with anti-cheat +plugins.\ ***(USE ONLY WITH CAUTION!)*** diff --git a/api/src/main/java/com/viaversion/viafabricplus/api/settings/AbstractSetting.java b/api/src/main/java/com/viaversion/viafabricplus/api/settings/AbstractSetting.java index 53f0cd82..09f2e852 100644 --- a/api/src/main/java/com/viaversion/viafabricplus/api/settings/AbstractSetting.java +++ b/api/src/main/java/com/viaversion/viafabricplus/api/settings/AbstractSetting.java @@ -53,6 +53,7 @@ public abstract class AbstractSetting { } public abstract void write(final JsonObject object); + public abstract void read(final JsonObject object); public void onValueChanged() { diff --git a/api/src/main/java/com/viaversion/viafabricplus/api/settings/type/ButtonSetting.java b/api/src/main/java/com/viaversion/viafabricplus/api/settings/type/ButtonSetting.java index 2d099f47..5fcfad1a 100644 --- a/api/src/main/java/com/viaversion/viafabricplus/api/settings/type/ButtonSetting.java +++ b/api/src/main/java/com/viaversion/viafabricplus/api/settings/type/ButtonSetting.java @@ -38,9 +38,11 @@ public class ButtonSetting extends AbstractSetting { } @Override - public void write(JsonObject object) {} + public void write(JsonObject object) { + } @Override - public void read(JsonObject object) {} + public void read(JsonObject object) { + } } diff --git a/build-logic/src/main/groovy/vfp.base-conventions.gradle b/build-logic/src/main/groovy/vfp.base-conventions.gradle index 9abdde7d..0ca13ede 100644 --- a/build-logic/src/main/groovy/vfp.base-conventions.gradle +++ b/build-logic/src/main/groovy/vfp.base-conventions.gradle @@ -54,12 +54,12 @@ dependencies { vvDependencies "com.viaversion:viaversion-common:5.2.1" vvDependencies "com.viaversion:viabackwards-common:5.2.1" vvDependencies "com.viaversion:viaaprilfools-common:4.0.0" - vvDependencies ("com.viaversion:vialoader:4.0.0") { + vvDependencies("com.viaversion:vialoader:4.0.0") { exclude group: "com.google.guava", module: "guava" exclude group: "org.slf4j", module: "slf4j-api" } vvDependencies "net.raphimc:ViaLegacy:3.0.7-SNAPSHOT" - vvDependencies ("net.raphimc:ViaBedrock:0.0.14-SNAPSHOT") { + vvDependencies("net.raphimc:ViaBedrock:0.0.14-SNAPSHOT") { exclude group: "io.jsonwebtoken" exclude group: "com.mojang", module: "brigadier" } diff --git a/build.gradle b/build.gradle index 80f8e2a6..da808774 100644 --- a/build.gradle +++ b/build.gradle @@ -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) + // 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")) + // 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") + 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" + // 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" + // 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'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 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_ to avoid conflicts - from("LICENSE") { - rename { - "${it}_${project.archivesBaseName}" - } - } + // Rename the project's license file to LICENSE_ to avoid conflicts + from("LICENSE") { + rename { + "${it}_${project.archivesBaseName}" + } + } } idea { - module { - ["run"].each { - excludeDirs << file("$it") - } - } + module { + ["run"].each { + excludeDirs << file("$it") + } + } } diff --git a/docs/DEVELOPER_API.md b/docs/DEVELOPER_API.md index f5550067..82ad79cd 100644 --- a/docs/DEVELOPER_API.md +++ b/docs/DEVELOPER_API.md @@ -1,14 +1,19 @@ # Developer API + ViaFabricPlus provides events and various utility functions for other mods to interface with it. Note that including ViaFabricPlus in your project comes with some requirements: + - The target version is Java 17 - Fabric loom setup (As ViaFabricPlus is a Minecraft mod and has no API-only dependency like other projects) ## How to include the mod as dependency -If you are targetting to only use the provided API, you should include the ```viafabricplus-api``` artifact. For including the internals use + +If you are targetting to only use the provided API, you should include the ```viafabricplus-api``` artifact. For +including the internals use ```viafabricplus```. Including the internals will also provide the legacy compatibility layer. ### Gradle + ```groovy repositories { mavenCentral() @@ -36,6 +41,7 @@ dependencies { ``` ### Maven + ```xml @@ -62,10 +68,13 @@ dependencies { ``` ## Using the API -Get the general API using ``ViaFabricPlus.getImpl()`` which will return a ``ViaFabricPlusBase`` interface reflecting API functions for mods to use. + +Get the general API using ``ViaFabricPlus.getImpl()`` which will return a ``ViaFabricPlusBase`` interface reflecting API +functions for mods to use. All functions provided there are safe to use and will most likely never be removed. #### Example + ```java final ViaFabricPlusBase platform = ViaFabricPlus.getImpl(); ``` @@ -73,8 +82,10 @@ final ViaFabricPlusBase platform = ViaFabricPlus.getImpl(); ## Using event callbacks The API provides two event callbacks which can be used: + - ``LoadingCycleCallback`` fired in various loading stages of ViaFabricPlus such as config or settings loading. -- ``ChangeProtocolVersionCallback`` fired when the user changes the target version in the screen, or if the user joins a server with a different version. +- ``ChangeProtocolVersionCallback`` fired when the user changes the target version in the screen, or if the user joins a + server with a different version. Event callbacks can be registered through the API: @@ -88,7 +99,8 @@ platform.registerOnChangeProtocolVersionCallback((oldVersion, newVersion) -> { ### Using the loading cycle callback -As your mod might load after ViaFabricPlus, you will need to register the loading cycle callback inside a `ViaFabricPlusLoadEntrypoint` marked as `viafabricplus` +As your mod might load after ViaFabricPlus, you will need to register the loading cycle callback inside a +`ViaFabricPlusLoadEntrypoint` marked as `viafabricplus` in your `fabric.mod.json` file. The entrypoint also acts as `INITAL_LOAD` stage. ```java @@ -121,7 +133,8 @@ public class Example implements ViaFabricPlusLoadEntrypoint { ## More extensive API -For any version specific functionality, ViaFabricPlus provides common API functions. ViaFabricPlus uses [ViaVersion](https://github.com/ViaVersion/ViaVersion) +For any version specific functionality, ViaFabricPlus provides common API functions. ViaFabricPlus +uses [ViaVersion](https://github.com/ViaVersion/ViaVersion) for protocol translation, so the ViaVersion API can be used as well. ### Getting the current target version diff --git a/docs/MAINTAINING.md b/docs/MAINTAINING.md index c1618d87..853146e7 100644 --- a/docs/MAINTAINING.md +++ b/docs/MAINTAINING.md @@ -1,5 +1,7 @@ # Updating instructions for the project -These steps are the usual process for updating ViaFabricPlus to a new version of the game. If you're unsure about something, ask in the ViaVersion discord. + +These steps are the usual process for updating ViaFabricPlus to a new version of the game. If you're unsure about +something, ask in the ViaVersion discord. 1. Update all upstream versions in `gradle.properties`. The main versions you need to update are: - `minecraft_version` @@ -8,96 +10,118 @@ These steps are the usual process for updating ViaFabricPlus to a new version of - `fabric_api_version` - `supported_versions` (if necessary) - + As well as the versions in the `dependencies` block in the `build.gradle` file. 2. Increment the version number in `gradle.properties` by at least a minor version (e.g. 1.0.0 -> 1.1.0) -3. Check all data dumps and diffs in the fixes/data package and update them if necessary, here is a list of some critical ones: +3. Check all data dumps and diffs in the fixes/data package and update them if necessary, here is a list of some + critical ones: - `ResourcePackHeaderDiff` (add the new version at the top of the list) - `ItemRegistryDiff` (add all new items/blocks added in the new version) - `EntityDimensionDiff` (add entity dimension changes) 4. Update the `NATIVE_VERSION` field in the ProtocolTranslator class to the new version 5. Update protocol constants in the `ViaFabricPlusProtocol` class + ------------- + 6. Check all mixins in the injection package if they still apply correctly, here is a list of some critical ones: - `MixinClientWorld#tickEntity` and `MixinClientWorld#tickPassenger` - `MixinPlayer#getBlockBreakingSpeed` 7. mDecompile the game source code with the tool of your choice. 8. Try to compile the mod and start porting the code until all existing fixes are working again. -9. Diff the game code with the code of the previous version (e.g. using git) and implement all changes that could be relevant for ViaFabricPlus, those are: +9. Diff the game code with the code of the previous version (e.g. using git) and implement all changes that could be + relevant for ViaFabricPlus, those are: - General logic changes (e.g. `if (a && b)` -> `if (b || a)`) - Changes to the movement code (e.g. `player.yaw` -> `player.headYaw`) - Networking changes (e.g. sending a new packet / changing the packet structure) - Changes to visuals (e.g. animation changes) - - Note: ViaVersion already implements most gameplay related changes for us, but you should always check for edge-cases. Since ViaVersion - is primarily a server side plugin, it does not take care of client-side related / deeper changes. ViaFabricPlus often has to inject into + - Note: ViaVersion already implements most gameplay related changes for us, but you should always check for + edge-cases. Since ViaVersion + is primarily a server side plugin, it does not take care of client-side related / deeper changes. ViaFabricPlus + often has to inject into ViaVersion code to improve funcitonality for the client. - - **Read more about which fixes should be added [HERE](../CONTRIBUTING.md#adding-protocol-new-fixes---which-are-important-and-which-arent)** - - From experience, the following packages contain the usual important changes (mojang mappings): - - `net.minecraft` - - `net.minecraft.client` - - `net.minecraft.client.gui` - - `net.minecraft.client.multiplayer` - - `net.minecraft.client.player` - - `net.minecraft.util` - - `net.minecraft.world` - - `net.minecraft.world.entity` - - `net.minecraft.world.inventory` - - `net.minecraft.world.item` - - `net.minecraft.world.level` - - `net.minecraft.world.level.block` + **Read more about which fixes should be + added [HERE](../CONTRIBUTING.md#adding-protocol-new-fixes---which-are-important-and-which-arent)** - - While the following packages (mojang mappings) can be skipped completely (most of the time): - - `com.mojang` - - `net.minecraft.advancements` - - `net.minecraft.commands` - - `net.minecraft.data` - - `net.minecraft.gametest` - - `net.minecraft.realms` - - `net.minecraft.recipebook` - - `net.minecraft.references` - - `net.minecraft.resources` - - `net.minecraft.server` - - `net.minecraft.sounds` - - `net.minecraft.stats` - - `net.minecraft.tags` + - From experience, the following packages contain the usual important changes (mojang mappings): + - `net.minecraft` + - `net.minecraft.client` + - `net.minecraft.client.gui` + - `net.minecraft.client.multiplayer` + - `net.minecraft.client.player` + - `net.minecraft.util` + - `net.minecraft.world` + - `net.minecraft.world.entity` + - `net.minecraft.world.inventory` + - `net.minecraft.world.item` + - `net.minecraft.world.level` + - `net.minecraft.world.level.block` -10. Check the ViaVersion/upstream protocol implementation for issues and report them if necessary or if these issues can't be fixed, - without tons of work, implement a workaround in ViaFabricPlus. + - While the following packages (mojang mappings) can be skipped completely (most of the time): + - `com.mojang` + - `net.minecraft.advancements` + - `net.minecraft.commands` + - `net.minecraft.data` + - `net.minecraft.gametest` + - `net.minecraft.realms` + - `net.minecraft.recipebook` + - `net.minecraft.references` + - `net.minecraft.resources` + - `net.minecraft.server` + - `net.minecraft.sounds` + - `net.minecraft.stats` + - `net.minecraft.tags` + +10. Check the ViaVersion/upstream protocol implementation for issues and report them if necessary or if these issues + can't be fixed, + without tons of work, implement a workaround in ViaFabricPlus. 11. Run the game and check all GUIs and other visuals for issues. -12. Clean your code and make sure it is readable and understandable, clientside fixes are sorted by their protocol versions, having - newer fixes at the top of the file. +12. Clean your code and make sure it is readable and understandable, clientside fixes are sorted by their protocol + versions, having + newer fixes at the top of the file. + ------------- + 13. Create a pull request and wait for it to be reviewed and merged. 14. You're done, congrats! ## Git branches + - `main`: The main branch, this is where all changes are merged into - `dev`: Used for changes which needs reviewing by all developers, usually merged into `main` shortly after - `update/*`: Update branches, these are used to port ViaFabricPlus to newer versions of the game - ``: Final release branches sorted by their Minecraft version (e.g. `1.8.9`, `1.16.5`, `1.17.1`, ...) There are also older formats which aren't used anymore: -- `recode/*`: Recode branches, these are used to port ViaFabricPlus to newer versions of the game or rewrite big parts of the code + +- `recode/*`: Recode branches, these are used to port ViaFabricPlus to newer versions of the game or rewrite big parts + of the code - `backport/*`: Backport branches, these are used to backport newer ViaFabricPlus versions to older versions of the game ## Project structure -Every change made to the game is called a `feature`. Each feature has its package under both `features/` and `injection/mixin/features/`, organizing utility and mixin classes for easier project maintenance and porting + +Every change made to the game is called a `feature`. Each feature has its package under both `features/` and +`injection/mixin/features/`, organizing utility and mixin classes for easier project maintenance and porting Loading of features is done via `static` blocks and dummy `init` function called in the `FeaturesLoading` class. ## Versioning + The versioning should only be updated every release and should only have one update between each release. + - The versioning scheme is `major.minor.patch`, where: - `major` is incremented when breaking changes are made - `minor` is incremented when new features are added - `patch` is incremented when bug fixes are made This scheme is used as follows: -- `Major` versions are only incremented with breaking and fundamental changes to the existing codebase, such as migrating mappings -or refactoring the entire codebase. -- `Minor` versions are incremented when the mod gets ported to a new version of the game or when huge features are added / -upstream changes are implemented. +- `Major` versions are only incremented with breaking and fundamental changes to the existing codebase, such as + migrating mappings + or refactoring the entire codebase. -- `Patch` versions are incremented when bug fixes are made or small features are added, they are the usual version increment. \ No newline at end of file +- `Minor` versions are incremented when the mod gets ported to a new version of the game or when huge features are + added / + upstream changes are implemented. + +- `Patch` versions are incremented when bug fixes are made or small features are added, they are the usual version + increment. \ No newline at end of file diff --git a/docs/USAGE.md b/docs/USAGE.md index 29fa7eed..47880b59 100644 --- a/docs/USAGE.md +++ b/docs/USAGE.md @@ -1,33 +1,44 @@ # Usage for ViaFabricPlus ## Introduction -At the top left of the multiplayer screen is the ViaFabricPlus button, with it you can enter the main menu of the mod + +At the top left of the multiplayer screen is the ViaFabricPlus button, with it you can enter the main menu of the mod where you can change the settings and set the protocol version, the position of the button can be changed in the Settings -> General -> multiplayer screen button orientation. ![](preview/multiplayer.png) ![](preview/protocol_selection.png) -In the Add/Edit Server screen there is a button where you can select a specific version for this server, when you ping or connect to this server, +In the Add/Edit Server screen there is a button where you can select a specific version for this server, when you ping +or connect to this server, ViaFabricPlus will use the version set there, the versions are stored in the servers.dat too ![](preview/set_version_for_server.png) -If you don't want to specify a specific version anymore, you can simply press the button and select **"Cancel and reset"**. +If you don't want to specify a specific version anymore, you can simply press the button and select **"Cancel and reset" +**. ## Commands -You can use the ViaVersion commands with **/viafabricplus** or **/viaversion**, and a few classic only commands are also implemented: + +You can use the ViaVersion commands with **/viafabricplus** or **/viaversion**, and a few classic only commands are also +implemented: + - **/viafabricplus settime