Easy to use ViaVersion, (and optional ViaBackwards, ViaRewind and ViaLegacy) platform implementation.
ViaProtocolHack is not usable by itself as a standalone software, as it is an implementation of a ViaVersion platform.
ViaProtocolHack is intended to be implemented in a ViaVersion based protocol translator.
### Projects implementing ViaProtocolHack
- [ViaProxy](https://github.com/RaphiMC/ViaProxy): Standalone proxy which uses ViaVersion to translate between minecraft versions. Allows Minecraft 1.7+ clients to join to any version server.
To use ViaProtocolHack with Gradle/Maven you can use this [Maven server](https://maven.lenni0451.net/#/releases/net/raphimc/ViaProtocolHack) or [Jitpack](https://jitpack.io/#RaphiMC/ViaProtocolHack).
To include ViaLegacy and ViaAprilFools, you can look at their READMEs: [ViaLegacy](https://github.com/RaphiMC/ViaLegacy/blob/main/README.md#releases) and [ViaAprilFools](https://github.com/RaphiMC/ViaAprilFools/blob/main/README.md#releases)
The only default value you have to change is the ``VPHLoader`` argument. The loader is used to register all the providers for the Via* platforms.
To override the default you first create a new class which extends ``VPHLoader`` and overrides the ``load`` method (Make sure to call the super method).
Within the ``load`` method you have to register a ``VersionProvider`` implementation which will be used to determine the target server version of a given connection.
Here is an example implementation:
```java
Via.getManager().getProviders().use(VersionProvider.class, new BaseVersionProvider() {
@Override
public int getClosestServerProtocol(UserConnection connection) {
return ProtocolVersion.v1_8.getVersion(); // Change the logic here to select the target server version
}
});
```
Then you have to create a new instance of your loader class and pass it to the ``ViaProtocolHack.init`` call.
To do this you can call the ``ViaProtocolHack.init()`` method somewhere suitable in your project (You can do that async) with your desired argument values:
If you are using ViaLegacy, you should read its README to see what changes you need to make to the netty pipeline for it to work.
Depending on where you are implementing ViaProtocolHack you might need to ensure that the pipeline is held in the correct order.
Minecraft clients modify the pipeline order when adding the compression handlers. You have to ensure that the Via* handlers are always on their correct location.
Now you should have a working protocol translator implementation in your project.
## Contact
If you encounter any issues, please report them on the