Skip to content

Commit

Permalink
4.7.0: MC 1.21, ViaVersion/ViaBackwards 5, ViaRewind 4 support
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Jun 26, 2024
1 parent 1d4e4e1 commit 87a3f51
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 102 deletions.
10 changes: 4 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ repositories {
dependencies {
// https://ci.viaversion.com/
implementation "com.viaversion:viaversion-common:4.9.0-24w09a-SNAPSHOT"
implementation "com.viaversion:viabackwards-common:4.9.0-24w09a-SNAPSHOT"
implementation "com.viaversion:viarewind-common:3.0.7-24w09a-SNAPSHOT"
implementation "com.viaversion:viaversion-common:5.0.2-SNAPSHOT"
implementation "com.viaversion:viabackwards-common:5.0.2-SNAPSHOT"
implementation "com.viaversion:viarewind-common:4.0.1-SNAPSHOT"
implementation "org.yaml:snakeyaml:2.2"
implementation "com.github.FlorianMichael:ViaLoadingBase:4.6.0" // https://jitpack.io/#FlorianMichael/ViaLoadingBase
implementation "com.github.FlorianMichael:ViaLoadingBase:4.7.0" // https://jitpack.io/#FlorianMichael/ViaLoadingBase
// You also need Netty, Guava and Log4j in your class path, but they should be there if your project is based on Minecraft.
implementation "com.google.guava:guava:31.1-jre"
Expand Down Expand Up @@ -152,5 +152,3 @@ public class ExampleImplementation {
}
}
```

For some example implementations and applications you can have a look at the code in [ViaFabricPlus](https://github.com/FlorianMichael/ViaFabricPlus)
8 changes: 4 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ plugins {
}

archivesBaseName = "ViaLoadingBase"
version = "4.6.0"
version = "4.7.0"
group = "de.florianmichael"

repositories {
Expand Down Expand Up @@ -33,9 +33,9 @@ java {

dependencies {
// Via Version
compileOnly("com.viaversion:viaversion-common:4.10.0-24w09a-SNAPSHOT")
compileOnly("com.viaversion:viabackwards-common:4.10.0-24w09a-SNAPSHOT")
compileOnly("com.viaversion:viarewind-common:3.0.7-24w09a-SNAPSHOT")
compileOnly("com.viaversion:viaversion-common:5.0.2-SNAPSHOT")
compileOnly("com.viaversion:viabackwards-common:5.0.2-SNAPSHOT")
compileOnly("com.viaversion:viarewind-common:4.0.1-SNAPSHOT")

compileOnly("org.yaml:snakeyaml:2.2")
compileOnly("com.google.guava:guava:31.1-jre")
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) throws E
if (PipelineUtil.containsCause(cause, CancelCodecException.class)) return;

if ((PipelineUtil.containsCause(cause, InformativeException.class)
&& user.getProtocolInfo().getState() != State.HANDSHAKE)
&& user.getProtocolInfo().getServerState() != State.HANDSHAKE)
|| Via.getManager().debugHandler().enabled()) {
cause.printStackTrace();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,7 @@ public class ViaRewindPlatformImpl implements ViaRewindPlatform {
private final File directory;

public ViaRewindPlatformImpl(final File directory) {
this.directory = directory;
this.init(new File(getDataFolder(), "viarewind.yml"));
this.init(new File(this.directory = directory, "viarewind.yml"));
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class ViaVersionPlatformImpl implements ViaPlatform<UserConnection> {

public ViaVersionPlatformImpl(final Logger logger) {
this.logger = logger;
config = new VLBViaConfig(new File(ViaLoadingBase.getInstance().getRunDirectory(), "viaversion.yml"));
config = new VLBViaConfig(new File(ViaLoadingBase.getInstance().getRunDirectory(), "viaversion.yml"), logger);
}

public static List<ProtocolVersion> createVersionList() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,7 @@
package de.florianmichael.vialoadingbase.platform.viaversion;

import com.viaversion.viaversion.commands.ViaCommandHandler;
import de.florianmichael.vialoadingbase.command.impl.LeakDetectSubCommand;

public class VLBViaCommandHandler extends ViaCommandHandler {

public VLBViaCommandHandler() {
super();
this.registerVLBDefaults();
}

public void registerVLBDefaults() {
this.registerSubCommand(new LeakDetectSubCommand());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,26 @@
import com.viaversion.viaversion.configuration.AbstractViaConfig;

import java.io.File;
import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;

public class VLBViaConfig extends AbstractViaConfig {

// Stolen from Sponge
private final static List<String> UNSUPPORTED = Arrays.asList("anti-xray-patch", "bungee-ping-interval",
"bungee-ping-save", "bungee-servers", "quick-move-action-fix", "nms-player-ticking",
"velocity-ping-interval", "velocity-ping-save", "velocity-servers",
private final static List<String> UNSUPPORTED = Arrays.asList("anti-xray-patch", "quick-move-action-fix",
"nms-player-ticking", "velocity-ping-interval", "velocity-ping-save", "velocity-servers",
"blockconnection-method", "change-1_9-hitbox", "change-1_14-hitbox",
"show-shield-when-sword-in-hand", "left-handed-handling");


public VLBViaConfig(File configFile) {
super(configFile);
public VLBViaConfig(File configFile, Logger logger) {
super(configFile, logger);

this.reload();
}

@Override
public URL getDefaultConfigURL() {
return getClass().getClassLoader().getResource("assets/viaversion/config.yml");
}

@Override
protected void handleConfig(Map<String, Object> config) {
// Nothing Currently
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.protocols.base.BaseVersionProvider;
import com.viaversion.viaversion.protocol.version.BaseVersionProvider;
import de.florianmichael.vialoadingbase.ViaLoadingBase;

public class VLBBaseVersionProvider extends BaseVersionProvider {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
import com.viaversion.viaversion.api.scheduler.Task;
import com.viaversion.viaversion.api.scheduler.TaskStatus;

import java.util.concurrent.Future;

public class VLBTask implements PlatformTask<Task> {

private final Task object;
Expand All @@ -33,7 +31,7 @@ public VLBTask(Task object) {
this.object = object;
}

@Override
@Deprecated
public Task getObject() {
return object;
}
Expand All @@ -43,6 +41,7 @@ public void cancel() {
object.cancel();
}

@Deprecated
public TaskStatus getStatus() {
return this.getObject().status();
}
Expand Down

0 comments on commit 87a3f51

Please sign in to comment.