Renamed project to ViaLoader

This commit is contained in:
RaphiMC 2023-05-28 19:19:59 +02:00
parent 02968d8cea
commit f6c2b60aab
33 changed files with 183 additions and 158 deletions

View File

@ -1,29 +1,56 @@
# ViaProtocolHack
# ViaLoader
Easy to use ViaVersion, (and optional ViaBackwards, ViaRewind, ViaLegacy and ViaAprilFools) platform implementation.
ViaProtocolHack is not usable by itself as a standalone software, as it is an implementation of a ViaVersion platform.
ViaLoader is not usable by itself as a standalone software, as it is an implementation of a ViaVersion platform.
### 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.
### Projects implementing ViaLoader
- [ViaProxy](https://github.com/ViaVersion/ViaProxy): Standalone proxy which allows players to join EVERY Minecraft server version (Classic, Alpha, Beta, Release, Bedrock).
- [ViaForge](https://github.com/ViaVersion/ViaForge): Clientside ViaVersion, ViaBackwards and ViaRewind implementation for Forge.
- [ViaFabricPlus](https://github.com/ViaVersion/ViaFabricPlus): Fabric mod to connect to EVERY Minecraft server version (Release, Beta, Alpha, Classic, Snapshots, Bedrock) with QoL fixes to the gameplay.
## Releases
### Gradle/Maven
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).
You can also find instructions how to implement it into your build script there.
To use ViaLoader with Gradle/Maven you can use the ViaVersion maven server:
```groovy
repositories {
maven { url "https://repo.viaversion.com" }
}
dependencies {
implementation("net.raphimc:ViaLoader:2.2.5-SNAPSHOT") // Get latest version from releases
}
```
```xml
<repositories>
<repository>
<id>viaversion</id>
<url>https://repo.viaversion.com</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>net.raphimc</groupId>
<artifactId>ViaLoader</artifactId>
<version>2.2.5-SNAPSHOT</version> <!-- Get latest version from releases -->
</dependency>
</dependencies>
```
### Jar File
If you just want the latest jar file you can download it from this [Jenkins](https://build.lenni0451.net/job/ViaProtocolHack/).
If you just want the latest jar file you can download it from this [Jenkins](https://ci.viaversion.com/view/All/job/ViaLoader/).
## Usage
To use ViaProtocolHack in your project you need to decide what components of Via* you want to use.
ViaProtocolHack is split into 5 different components:
- ViaVersion (Is the base component of ViaProtocolHack [required])
To use ViaLoader in your project you need to decide what components of Via* you want to use.
ViaLoader is split into 5 different components:
- ViaVersion (Is the base component of ViaLoader [required])
- ViaBackwards (Allows older clients to join to newer server versions [needs ViaVersion])
- ViaRewind (Allows 1.8.x and 1.7.x clients to join to 1.9+ servers [needs ViaBackwards])
- ViaLegacy (Allows clients to join to <= 1.7.10 servers [needs ViaVersion])
- ViaAprilFools (Allows clients to join to some notable Minecraft snapshots [needs ViaBackwards])
To include ViaVersion/ViaBackwards/ViaRewind you have to add the ViaVersion maven repository to your build script:
To include the subcomponents you have to add the ViaVersion maven repository to your build script:
```groovy
repositories {
maven {
@ -32,27 +59,25 @@ repositories {
}
}
```
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)
Here is an example dependency configuration for all components:
```groovy
implementation "com.viaversion:viaversion:4.7.0-23w17a-SNAPSHOT"
implementation("com.viaversion:viabackwards-common:4.7.0-23w17a-SNAPSHOT") {
implementation "com.viaversion:viaversion:4.7.0-1.20-pre6-SNAPSHOT"
implementation("com.viaversion:viabackwards-common:4.7.0-1.20-pre5-SNAPSHOT") {
exclude group: "com.viaversion", module: "viaversion" // Exclude transitive dependency. Include manually for more control
exclude group: "io.netty", module: "netty-all" // Don't include the outdated netty version
}
implementation "com.viaversion:viarewind-core:2.0.4-SNAPSHOT"
implementation "net.raphimc:ViaLegacy:2.2.16"
implementation "net.raphimc:ViaAprilFools:2.0.6"
implementation "net.raphimc:ViaLegacy:2.2.17-SNAPSHOT"
implementation "net.raphimc:ViaAprilFools:2.0.7-SNAPSHOT"
```
## Implementation
To implement ViaProtocolHack into your project you need to initialize the Via* platforms first.
ViaProtocolHack provides a wrapper class with default values for that. To use a default value you can just pass ``null`` to that argument.
To implement ViaLoader into your project you need to initialize the Via* platforms first.
ViaLoader provides a wrapper class with default values for that. To use a default value you can just pass ``null`` to that argument.
If you want to change the default value you should create your own class which extends the base class and overrides the methods you want to change.
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).
The only default value you have to change is the ``VLLoader`` 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 ``VLLoader`` 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
@ -63,14 +88,14 @@ Via.getManager().getProviders().use(VersionProvider.class, new BaseVersionProvid
}
});
```
Then you have to create a new instance of your loader class and pass it to the ``ViaProtocolHack.init`` call.
Then you have to create a new instance of your loader class and pass it to the ``ViaLoader.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:
To do this you can call the ``ViaLoader.init()`` method somewhere suitable in your project (You can do that async) with your desired argument values:
```java
ViaProtocolHack.init(null/*ViaPlatform*/, new CustomVPHLoaderImpl(), null/*ViaInjector*/, null/*ViaCommandHandler*/, ViaBackwardsPlatformImpl::new, ViaLegacyPlatformImpl::new, ViaAprilFoolsPlatformImpl::new);
ViaLoader.init(null/*ViaPlatform*/, new CustomVLLoaderImpl(), null/*ViaInjector*/, null/*ViaCommandHandler*/, ViaBackwardsPlatformImpl::new, ViaLegacyPlatformImpl::new, ViaAprilFoolsPlatformImpl::new);
```
After you have initialized the Via* platforms you can start implementing ViaProtocolHack into your project.
After you have initialized the Via* platforms you can start implementing ViaLoader into your project.
The most important part is the modification of your netty pipeline. This is needed for ViaVersion to translate the packets in both ways.
Here is an example implementation:
@ -78,16 +103,16 @@ Here is an example implementation:
final UserConnection user = new UserConnectionImpl(channel, true);
new ProtocolPipelineImpl(user);
channel.pipeline().addBefore("packet_codec", VPHPipeline.VIA_CODEC_NAME, new ViaCodec(user));
channel.pipeline().addBefore("packet_codec", VLPipeline.VIA_CODEC_NAME, new ViaCodec(user));
```
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.
Depending on where you are implementing ViaLoader 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.
## Configuring the protocol translation
To change the protocol translation settings/features you can look into the ViaProtocolHack folder.
To change the protocol translation settings/features you can look into the ViaLoader folder.
You can find 5 config files there depending on the platforms loaded:
- viaversion.yml (ViaVersion)
- config.yml (ViaBackwards)
@ -97,6 +122,6 @@ You can find 5 config files there depending on the platforms loaded:
## Contact
If you encounter any issues, please report them on the
[issue tracker](https://github.com/RaphiMC/ViaProtocolHack/issues).
If you just want to talk or need help implementing ViaProtocolHack feel free to join my
[issue tracker](https://github.com/RaphiMC/ViaLoader/issues).
If you just want to talk or need help implementing ViaLoader feel free to join my
[Discord](https://discord.gg/dCzT9XHEWu).

View File

@ -36,8 +36,8 @@ repositories {
}
dependencies {
compileOnly "com.viaversion:viaversion:4.7.0-23w17a-SNAPSHOT"
compileOnly("com.viaversion:viabackwards-common:4.7.0-23w17a-SNAPSHOT") {
compileOnly "com.viaversion:viaversion:4.7.0-1.20-pre6-SNAPSHOT"
compileOnly("com.viaversion:viabackwards-common:4.7.0-1.20-pre5-SNAPSHOT") {
exclude group: "com.viaversion", module: "viaversion"
exclude group: "io.netty", module: "netty-all"
}
@ -52,7 +52,7 @@ dependencies {
}
blossom {
replaceToken("\${version}", project.version, "src/main/java/net/raphimc/viaprotocolhack/ViaProtocolHack.java")
replaceToken("\${version}", project.version, "src/main/java/net/raphimc/vialoader/ViaLoader.java")
}
java {
@ -69,8 +69,8 @@ jar {
publishing {
repositories {
maven {
name = "reposilite"
url = "https://maven.lenni0451.net/releases"
name = "Via"
url = "https://repo.viaversion.com/"
credentials(PasswordCredentials)
authentication {
basic(BasicAuthentication)

View File

@ -4,6 +4,6 @@ org.gradle.parallel=true
org.gradle.configureondemand=true
# Project properties
maven_name=ViaProtocolHack
maven_name=ViaLoader
maven_group=net.raphimc
maven_version=2.2.5
maven_version=2.2.5-SNAPSHOT

View File

@ -5,4 +5,4 @@ pluginManagement {
}
}
rootProject.name = "ViaProtocolHack"
rootProject.name = "ViaLoader"

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack;
package net.raphimc.vialoader;
import com.viaversion.viaversion.ViaManagerImpl;
import com.viaversion.viaversion.api.Via;
@ -24,29 +24,29 @@ import com.viaversion.viaversion.api.platform.ViaPlatform;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.commands.ViaCommandHandler;
import com.viaversion.viaversion.protocol.ProtocolManagerImpl;
import net.raphimc.viaprotocolhack.impl.platform.ViaVersionPlatformImpl;
import net.raphimc.viaprotocolhack.impl.viaversion.VPHCommandHandler;
import net.raphimc.viaprotocolhack.impl.viaversion.VPHInjector;
import net.raphimc.viaprotocolhack.impl.viaversion.VPHLoader;
import net.raphimc.viaprotocolhack.util.JLoggerToSLF4J;
import net.raphimc.vialoader.impl.platform.ViaVersionPlatformImpl;
import net.raphimc.vialoader.impl.viaversion.VLCommandHandler;
import net.raphimc.vialoader.impl.viaversion.VLInjector;
import net.raphimc.vialoader.impl.viaversion.VLLoader;
import net.raphimc.vialoader.util.JLoggerToSLF4J;
import org.slf4j.LoggerFactory;
import java.util.function.Supplier;
import java.util.logging.Level;
import java.util.logging.Logger;
public class ViaProtocolHack {
public class ViaLoader {
public static final String VERSION = "${version}";
private static final Logger LOGGER = new JLoggerToSLF4J(LoggerFactory.getLogger("ViaProtocolHack"));
private static final Logger LOGGER = new JLoggerToSLF4J(LoggerFactory.getLogger("ViaLoader"));
@SuppressWarnings("ReassignedVariable")
public static void init(ViaPlatform<?> platform, ViaPlatformLoader loader, ViaInjector injector, ViaCommandHandler commandHandler, final Supplier<?>... platformSuppliers) {
if (platform == null) platform = new ViaVersionPlatformImpl(null);
if (loader == null) loader = new VPHLoader();
if (injector == null) injector = new VPHInjector();
if (commandHandler == null) commandHandler = new VPHCommandHandler();
if (loader == null) loader = new VLLoader();
if (injector == null) injector = new VLInjector();
if (commandHandler == null) commandHandler = new VLCommandHandler();
Via.init(ViaManagerImpl.builder()
.platform(platform)

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.commands;
package net.raphimc.vialoader.commands;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.command.ViaCommandSender;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.commands.subs;
package net.raphimc.vialoader.commands.subs;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.command.ViaCommandSender;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.commands.subs;
package net.raphimc.vialoader.commands.subs;
import com.viaversion.viaversion.api.command.ViaCommandSender;
import com.viaversion.viaversion.api.command.ViaSubCommand;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,11 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.impl.platform;
package net.raphimc.vialoader.impl.platform;
import com.viaversion.viaversion.api.Via;
import net.raphimc.viaaprilfools.platform.ViaAprilFoolsPlatform;
import net.raphimc.viaprotocolhack.util.JLoggerToSLF4J;
import net.raphimc.vialoader.util.JLoggerToSLF4J;
import org.slf4j.LoggerFactory;
import java.io.File;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,11 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.impl.platform;
package net.raphimc.vialoader.impl.platform;
import com.viaversion.viabackwards.api.ViaBackwardsPlatform;
import com.viaversion.viaversion.api.Via;
import net.raphimc.viaprotocolhack.util.JLoggerToSLF4J;
import net.raphimc.vialoader.util.JLoggerToSLF4J;
import org.slf4j.LoggerFactory;
import java.io.File;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,11 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.impl.platform;
package net.raphimc.vialoader.impl.platform;
import com.viaversion.viaversion.api.Via;
import net.raphimc.viabedrock.platform.ViaBedrockPlatform;
import net.raphimc.viaprotocolhack.util.JLoggerToSLF4J;
import net.raphimc.vialoader.util.JLoggerToSLF4J;
import org.slf4j.LoggerFactory;
import java.io.File;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,11 +15,11 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.impl.platform;
package net.raphimc.vialoader.impl.platform;
import com.viaversion.viaversion.api.Via;
import net.raphimc.vialegacy.platform.ViaLegacyPlatform;
import net.raphimc.viaprotocolhack.util.JLoggerToSLF4J;
import net.raphimc.vialoader.util.JLoggerToSLF4J;
import org.slf4j.LoggerFactory;
import java.io.File;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,12 +15,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.impl.platform;
package net.raphimc.vialoader.impl.platform;
import com.viaversion.viaversion.api.Via;
import de.gerrygames.viarewind.api.ViaRewindConfigImpl;
import de.gerrygames.viarewind.api.ViaRewindPlatform;
import net.raphimc.viaprotocolhack.util.JLoggerToSLF4J;
import net.raphimc.vialoader.util.JLoggerToSLF4J;
import org.slf4j.LoggerFactory;
import java.io.File;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.impl.platform;
package net.raphimc.vialoader.impl.platform;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.ViaAPI;
@ -26,12 +26,12 @@ import com.viaversion.viaversion.api.platform.ViaPlatform;
import com.viaversion.viaversion.configuration.AbstractViaConfig;
import com.viaversion.viaversion.libs.gson.JsonObject;
import com.viaversion.viaversion.util.VersionInfo;
import net.raphimc.viaprotocolhack.ViaProtocolHack;
import net.raphimc.viaprotocolhack.commands.UserCommandSender;
import net.raphimc.viaprotocolhack.impl.viaversion.VPHApiBase;
import net.raphimc.viaprotocolhack.impl.viaversion.VPHViaConfig;
import net.raphimc.viaprotocolhack.util.JLoggerToSLF4J;
import net.raphimc.viaprotocolhack.util.VPHTask;
import net.raphimc.vialoader.ViaLoader;
import net.raphimc.vialoader.commands.UserCommandSender;
import net.raphimc.vialoader.impl.viaversion.VLApiBase;
import net.raphimc.vialoader.impl.viaversion.VLViaConfig;
import net.raphimc.vialoader.util.JLoggerToSLF4J;
import net.raphimc.vialoader.util.VLTask;
import org.slf4j.LoggerFactory;
import java.io.File;
@ -48,7 +48,7 @@ public class ViaVersionPlatformImpl implements ViaPlatform<UUID> {
private final ViaAPI<UUID> api;
public ViaVersionPlatformImpl(final File rootFolder) {
this.dataFolder = new File(rootFolder, "ViaProtocolHack");
this.dataFolder = new File(rootFolder, "ViaLoader");
this.config = this.createConfig();
this.api = this.createApi();
}
@ -60,12 +60,12 @@ public class ViaVersionPlatformImpl implements ViaPlatform<UUID> {
@Override
public String getPlatformName() {
return "ViaProtocolHack";
return "ViaLoader";
}
@Override
public String getPlatformVersion() {
return ViaProtocolHack.VERSION;
return ViaLoader.VERSION;
}
@Override
@ -74,27 +74,27 @@ public class ViaVersionPlatformImpl implements ViaPlatform<UUID> {
}
@Override
public VPHTask runAsync(Runnable runnable) {
return new VPHTask(Via.getManager().getScheduler().execute(runnable));
public VLTask runAsync(Runnable runnable) {
return new VLTask(Via.getManager().getScheduler().execute(runnable));
}
@Override
public VPHTask runRepeatingAsync(Runnable runnable, long period) {
return new VPHTask(Via.getManager().getScheduler().scheduleRepeating(runnable, 0, period * 50, TimeUnit.MILLISECONDS));
public VLTask runRepeatingAsync(Runnable runnable, long period) {
return new VLTask(Via.getManager().getScheduler().scheduleRepeating(runnable, 0, period * 50, TimeUnit.MILLISECONDS));
}
@Override
public VPHTask runSync(Runnable runnable) {
public VLTask runSync(Runnable runnable) {
return this.runAsync(runnable);
}
@Override
public VPHTask runSync(Runnable runnable, long delay) {
return new VPHTask(Via.getManager().getScheduler().schedule(runnable, delay * 50, TimeUnit.MILLISECONDS));
public VLTask runSync(Runnable runnable, long delay) {
return new VLTask(Via.getManager().getScheduler().schedule(runnable, delay * 50, TimeUnit.MILLISECONDS));
}
@Override
public VPHTask runRepeatingSync(Runnable runnable, long period) {
public VLTask runRepeatingSync(Runnable runnable, long period) {
return this.runRepeatingAsync(runnable, period);
}
@ -167,13 +167,13 @@ public class ViaVersionPlatformImpl implements ViaPlatform<UUID> {
}
protected AbstractViaConfig createConfig() {
final AbstractViaConfig config = new VPHViaConfig(new File(this.dataFolder, "viaversion.yml"));
final AbstractViaConfig config = new VLViaConfig(new File(this.dataFolder, "viaversion.yml"));
config.reloadConfig();
return config;
}
protected ViaAPI<UUID> createApi() {
return new VPHApiBase();
return new VLApiBase();
}
}

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.impl.providers;
package net.raphimc.vialoader.impl.providers;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.connection.UserConnection;
@ -29,7 +29,7 @@ import com.viaversion.viaversion.protocols.protocol1_9to1_8.storage.MovementTrac
import java.util.logging.Level;
public class VPHMovementTransmitterProvider extends MovementTransmitterProvider {
public class VLMovementTransmitterProvider extends MovementTransmitterProvider {
@Override
public Object getFlyingPacket() {

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,12 +15,12 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.impl.viaversion;
package net.raphimc.vialoader.impl.viaversion;
import com.viaversion.viaversion.ViaAPIBase;
import java.util.UUID;
public class VPHApiBase extends ViaAPIBase<UUID> {
public class VLApiBase extends ViaAPIBase<UUID> {
}

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,15 +15,15 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.impl.viaversion;
package net.raphimc.vialoader.impl.viaversion;
import com.viaversion.viaversion.commands.ViaCommandHandler;
import net.raphimc.viaprotocolhack.commands.subs.ConnectionsSubCommand;
import net.raphimc.viaprotocolhack.commands.subs.LeakDetectSubCommand;
import net.raphimc.vialoader.commands.subs.ConnectionsSubCommand;
import net.raphimc.vialoader.commands.subs.LeakDetectSubCommand;
public class VPHCommandHandler extends ViaCommandHandler {
public class VLCommandHandler extends ViaCommandHandler {
public VPHCommandHandler() {
public VLCommandHandler() {
this.registerSubCommand(new LeakDetectSubCommand());
this.registerSubCommand(new ConnectionsSubCommand());
}

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,16 +15,16 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.impl.viaversion;
package net.raphimc.vialoader.impl.viaversion;
import com.viaversion.viaversion.api.platform.ViaInjector;
import com.viaversion.viaversion.libs.fastutil.ints.IntLinkedOpenHashSet;
import com.viaversion.viaversion.libs.fastutil.ints.IntSortedSet;
import com.viaversion.viaversion.libs.gson.JsonObject;
import net.raphimc.viaprotocolhack.netty.VPHPipeline;
import net.raphimc.viaprotocolhack.util.VersionEnum;
import net.raphimc.vialoader.netty.VLPipeline;
import net.raphimc.vialoader.util.VersionEnum;
public class VPHInjector implements ViaInjector {
public class VLInjector implements ViaInjector {
@Override
public void inject() {
@ -50,12 +50,12 @@ public class VPHInjector implements ViaInjector {
@Override
public String getEncoderName() {
return VPHPipeline.VIA_CODEC_NAME;
return VLPipeline.VIA_CODEC_NAME;
}
@Override
public String getDecoderName() {
return VPHPipeline.VIA_CODEC_NAME;
return VLPipeline.VIA_CODEC_NAME;
}
@Override

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,18 +15,18 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.impl.viaversion;
package net.raphimc.vialoader.impl.viaversion;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.MovementTransmitterProvider;
import net.raphimc.viaprotocolhack.impl.providers.VPHMovementTransmitterProvider;
import net.raphimc.vialoader.impl.providers.VLMovementTransmitterProvider;
public class VPHLoader implements ViaPlatformLoader {
public class VLLoader implements ViaPlatformLoader {
@Override
public void load() {
Via.getManager().getProviders().use(MovementTransmitterProvider.class, new VPHMovementTransmitterProvider());
Via.getManager().getProviders().use(MovementTransmitterProvider.class, new VLMovementTransmitterProvider());
}
@Override

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.impl.viaversion;
package net.raphimc.vialoader.impl.viaversion;
import com.google.common.collect.Lists;
@ -26,7 +26,7 @@ import java.util.Collections;
import java.util.List;
import java.util.Map;
public class VPHViaConfig extends AbstractViaConfig {
public class VLViaConfig extends AbstractViaConfig {
protected final List<String> UNSUPPORTED = Lists.newArrayList(
"checkforupdates", "bungee-ping-interval", "bungee-ping-save", "bungee-servers",
@ -37,7 +37,7 @@ public class VPHViaConfig extends AbstractViaConfig {
"use-new-deathmessages", "nms-player-ticking"
);
public VPHViaConfig(final File configFile) {
public VLViaConfig(final File configFile) {
super(configFile);
}

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.netty;
package net.raphimc.vialoader.netty;
public class CompressionReorderEvent {

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.netty;
package net.raphimc.vialoader.netty;
import com.viaversion.viaversion.api.connection.UserConnection;
import io.netty.channel.ChannelHandler;
@ -27,11 +27,11 @@ import net.raphimc.viabedrock.protocol.BedrockBaseProtocol;
import net.raphimc.vialegacy.netty.PreNettyLengthPrepender;
import net.raphimc.vialegacy.netty.PreNettyLengthRemover;
import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.baseprotocols.PreNettyBaseProtocol;
import net.raphimc.viaprotocolhack.netty.viabedrock.DisconnectHandler;
import net.raphimc.viaprotocolhack.netty.viabedrock.RakMessageEncapsulationCodec;
import net.raphimc.viaprotocolhack.util.VersionEnum;
import net.raphimc.vialoader.netty.viabedrock.DisconnectHandler;
import net.raphimc.vialoader.netty.viabedrock.RakMessageEncapsulationCodec;
import net.raphimc.vialoader.util.VersionEnum;
public abstract class VPHLegacyPipeline extends ChannelInboundHandlerAdapter {
public abstract class VLLegacyPipeline extends ChannelInboundHandlerAdapter {
public static final String VIA_DECODER_NAME = "via-decoder";
public static final String VIA_ENCODER_NAME = "via-encoder";
@ -46,7 +46,7 @@ public abstract class VPHLegacyPipeline extends ChannelInboundHandlerAdapter {
protected final UserConnection user;
protected final VersionEnum version;
public VPHLegacyPipeline(final UserConnection user, final VersionEnum version) {
public VLLegacyPipeline(final UserConnection user, final VersionEnum version) {
this.user = user;
this.version = version;
}

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.netty;
package net.raphimc.vialoader.netty;
import com.viaversion.viaversion.api.connection.UserConnection;
import io.netty.channel.ChannelHandler;
@ -27,11 +27,11 @@ import net.raphimc.viabedrock.netty.PacketEncapsulationCodec;
import net.raphimc.viabedrock.protocol.BedrockBaseProtocol;
import net.raphimc.vialegacy.netty.PreNettyLengthCodec;
import net.raphimc.vialegacy.protocols.release.protocol1_7_2_5to1_6_4.baseprotocols.PreNettyBaseProtocol;
import net.raphimc.viaprotocolhack.netty.viabedrock.DisconnectHandler;
import net.raphimc.viaprotocolhack.netty.viabedrock.RakMessageEncapsulationCodec;
import net.raphimc.viaprotocolhack.util.VersionEnum;
import net.raphimc.vialoader.netty.viabedrock.DisconnectHandler;
import net.raphimc.vialoader.netty.viabedrock.RakMessageEncapsulationCodec;
import net.raphimc.vialoader.util.VersionEnum;
public abstract class VPHPipeline extends ChannelInboundHandlerAdapter {
public abstract class VLPipeline extends ChannelInboundHandlerAdapter {
public static final String VIA_CODEC_NAME = "via-codec";
@ -44,7 +44,7 @@ public abstract class VPHPipeline extends ChannelInboundHandlerAdapter {
protected final UserConnection user;
protected final VersionEnum version;
public VPHPipeline(final UserConnection user, final VersionEnum version) {
public VLPipeline(final UserConnection user, final VersionEnum version) {
this.user = user;
this.version = version;
}

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.netty;
package net.raphimc.vialoader.netty;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.exception.CancelCodecException;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.netty;
package net.raphimc.vialoader.netty;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.exception.CancelCodecException;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.netty;
package net.raphimc.vialoader.netty;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.exception.CancelCodecException;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.netty.viabedrock;
package net.raphimc.vialoader.netty.viabedrock;
import io.netty.channel.ChannelHandlerContext;
import io.netty.channel.ChannelOutboundHandlerAdapter;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.netty.viabedrock;
package net.raphimc.vialoader.netty.viabedrock;
import io.netty.buffer.ByteBuf;
import io.netty.channel.ChannelHandlerContext;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.netty.viabedrock;
package net.raphimc.vialoader.netty.viabedrock;
import io.netty.buffer.ByteBuf;
import io.netty.buffer.CompositeByteBuf;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.util;
package net.raphimc.vialoader.util;
import java.text.MessageFormat;
import java.util.logging.Level;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,17 +15,17 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.util;
package net.raphimc.vialoader.util;
import com.viaversion.viaversion.api.platform.PlatformTask;
import com.viaversion.viaversion.api.scheduler.Task;
import com.viaversion.viaversion.api.scheduler.TaskStatus;
public class VPHTask implements PlatformTask<Task> {
public class VLTask implements PlatformTask<Task> {
private final Task task;
public VPHTask(final Task task) {
public VLTask(final Task task) {
this.task = task;
}

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.util;
package net.raphimc.vialoader.util;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;

View File

@ -1,5 +1,5 @@
/*
* This file is part of ViaProtocolHack - https://github.com/RaphiMC/ViaProtocolHack
* This file is part of ViaLoader - https://github.com/RaphiMC/ViaLoader
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
@ -15,7 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaprotocolhack.util;
package net.raphimc.vialoader.util;
public class VersionRange {