Optimize protocol path finding
Not perfect, but better. This prevents the path checks from exponentially increasing (if it weren't for the maxProtocolPathSize fail safe).

By default, a path will never go to a protocol version that puts it farther from the desired server protocol version, even if a path existed.
Otherwise as well as previously, *all* possible paths will be checked until a fitting one is found.

Negative examples if the new boolean is set to true:
    A possible path from 3 to 5 in order of 3->10->5 will be dismissed.
    A possible path from 5 to 3 in order of 5->0->3 will be dismissed.

Negative examples if set to false:
    While searching for a path from 3 to 5, 3->2->1 could be checked first before 3->4->5 is found.
    While searching for a path from 5 to 3, 5->6->7 could be checked first before 5->4->3 is found.

Assuming custom platforms like Bedrock protocol use the normal registering methods, they will have to change the boolean to false to revert to previous behavior (tho still somewhat better optimized).
10 files changed
tree: 5b4f911e11bb77418bd5cdb7aebb798a138b2142
  1. .github/
  2. .gitignore
  3. LICENSE
  4. README.md
  5. adventure/
  6. api-legacy/
  7. api/
  8. build-logic/
  9. build.gradle.kts
  10. bukkit-legacy/
  11. bukkit/
  12. bungee/
  13. common/
  14. fabric/
  15. gradle.properties
  16. gradle/
  17. gradlew
  18. gradlew.bat
  19. java-compat/
  20. licenses/
  21. settings.gradle.kts
  22. sponge-legacy/
  23. sponge/
  24. universal/
  25. velocity/
README.md

ViaVersion - Spigot, Sponge, BungeeCord, Velocity

Latest Release Build Status Discord

Allows the connection of higher client versions to lower server versions

Supported Versions:

Table (https://i.imgur.com/uDM9HR8.png)

On Paper you may also use ProtocolSupport, but ensure you have the right build for your server version.

User Docs: https://docs.viaversion.com/display/VIAVERSION/

Sources:

wiki.vg (Used for information regarding packet structure, we also contribute back)

Burger (See PAaaS)

OpenNBT

Releases / Dev Builds:

You can find official releases here:

https://www.spigotmc.org/resources/viaversion.19254/history


You can find official dev builds here:

Jenkins: https://ci.viaversion.com

JavaDocs: https://jd.viaversion.com

Maven Repository:

<repository>
    <id>viaversion-repo</id>
    <url>https://repo.viaversion.com</url>
</repository>

API-artifact:

<dependency>
    <groupId>com.viaversion</groupId>
    <artifactId>viaversion-api</artifactId>
    <version>LATEST</version>
    <scope>provided</scope>
</dependency>

Replace the version depending on your needs.

If you need access to the existing protocol or platform implementations, use the parent artifact viaversion. Please note the differences in licensing.

Building:

After cloning this repository, build the project with Gradle by running ./gradlew build and take the created jar out of the build/libs directory.

License:

The entirety of the API directory (including the legacy API directory) is licensed under the MIT License; see licenses/MIT.md for details.

Everything else, unless explicitly stated otherwise, is licensed under the GNU General Public License, including the end product as a whole; see licenses/GPL.md for details.

Special thanks to all our Contributors.