Port to upstream changes (maybe)

This commit is contained in:
FlorianMichael 2024-05-15 00:49:33 +02:00
parent 9065c5260c
commit 9909c282fb
No known key found for this signature in database
GPG Key ID: C2FB87E71C425126
67 changed files with 139 additions and 126 deletions

View File

@ -2,7 +2,7 @@
org.gradle.jvmargs=-Xms32M -Xmx4G -XX:+UseG1GC -XX:+UseStringDeduplication
loader_version=0.15.11
viaver_version=4.10.2
viaver_version=5.0.0-SNAPSHOT
yaml_version=2.2
publish_mc_versions=1.20.6, 1.20.4, 1.20.1, 1.19.4, 1.18.2, 1.17.1, 1.16.5, 1.15.2, 1.14.4, 1.12.2, 1.8.9

View File

@ -25,7 +25,7 @@ import java.util.Arrays;
import java.util.List;
import java.util.stream.Collectors;
public class LeakDetectSubCommand extends ViaSubCommand {
public class LeakDetectSubCommand implements ViaSubCommand {
@Override
public String name() {
return "leakdetect";
@ -60,6 +60,6 @@ public class LeakDetectSubCommand extends ViaSubCommand {
.filter(it -> it.startsWith(args[0]))
.collect(Collectors.toList());
}
return super.onTabComplete(sender, args);
return ViaSubCommand.super.onTabComplete(sender, args);
}
}

View File

@ -25,6 +25,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
public class VFConfig extends Config {
public static final String ENABLE_CLIENT_SIDE = "enable-client-side";
@ -32,8 +33,8 @@ public class VFConfig extends Config {
public static final String CLIENT_SIDE_FORCE_DISABLE = "client-side-force-disable";
public static final String HIDE_BUTTON = "hide-button";
public VFConfig(File configFile) {
super(configFile);
public VFConfig(File configFile, Logger logger) {
super(configFile, logger);
reload();
}

View File

@ -84,7 +84,7 @@ public class FabricDecodeHandler extends MessageToMessageDecoder<ByteBuf> {
super.exceptionCaught(ctx, cause);
if ((PipelineUtil.containsCause(cause, InformativeException.class)
&& info.getProtocolInfo().getState() != State.HANDSHAKE)
&& info.getProtocolInfo().getServerState() != State.HANDSHAKE)
|| Via.getManager().debugHandler().enabled()) {
cause.printStackTrace();
}

View File

@ -24,6 +24,7 @@ import java.net.URL;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.logging.Logger;
public class FabricViaConfig extends AbstractViaConfig {
// Based on Sponge ViaVersion
@ -32,8 +33,8 @@ public class FabricViaConfig extends AbstractViaConfig {
"velocity-ping-interval", "velocity-ping-save", "velocity-servers",
"blockconnection-method", "change-1_9-hitbox", "change-1_14-hitbox");
public FabricViaConfig(File configFile) {
super(configFile);
public FabricViaConfig(File configFile, Logger logger) {
super(configFile, logger);
// Load config
reload();
}

View File

@ -24,6 +24,7 @@ import com.viaversion.viaversion.api.protocol.remapper.PacketHandlers;
import com.viaversion.viaversion.api.protocol.remapper.ValueTransformer;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.protocol.packet.State;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.protocols.base.ServerboundHandshakePackets;
public class HostnameParserProtocol extends AbstractSimpleProtocol {
@ -34,8 +35,8 @@ public class HostnameParserProtocol extends AbstractSimpleProtocol {
registerServerbound(State.HANDSHAKE, ServerboundHandshakePackets.CLIENT_INTENTION.getId(), ServerboundHandshakePackets.CLIENT_INTENTION.getId(), new PacketHandlers() {
@Override
protected void register() {
map(Type.VAR_INT); // Protocol version
map(Type.STRING, new ValueTransformer<String, String>(Type.STRING) {
map(Types.VAR_INT); // Protocol version
map(Types.STRING, new ValueTransformer<String, String>(Types.STRING) {
@Override
public String transform(PacketWrapper packetWrapper, String s) {
return new AddressParser().parse(s).serverAddress;

View File

@ -70,7 +70,7 @@ public abstract class AbstractFabricPlatform implements ViaPlatform<UserConnecti
installNativeVersionProvider();
Path configDir = FabricLoader.getInstance().getConfigDir().resolve("ViaFabric");
dataFolder = configDir.toFile();
config = new FabricViaConfig(configDir.resolve("viaversion.yml").toFile());
config = new FabricViaConfig(configDir.resolve("viaversion.yml").toFile(), logger);
}
protected abstract void installNativeVersionProvider();
@ -180,11 +180,6 @@ public abstract class AbstractFabricPlatform implements ViaPlatform<UserConnecti
return true;
}
@Override
public boolean isOldClientsAllowed() {
return true;
}
@Override
public JsonObject getDump() {
JsonObject platformSpecific = new JsonObject();

View File

@ -29,10 +29,11 @@ import com.viaversion.viaversion.api.protocol.packet.PacketWrapper;
import com.viaversion.viaversion.api.protocol.packet.State;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viaversion.api.type.Type;
import com.viaversion.viaversion.api.type.Types;
import com.viaversion.viaversion.exception.CancelException;
import com.viaversion.viaversion.protocol.version.BaseVersionProvider;
import com.viaversion.viaversion.protocols.base.BaseProtocol1_16;
import com.viaversion.viaversion.protocols.base.BaseProtocol1_7;
import com.viaversion.viaversion.protocols.base.BaseVersionProvider;
import com.viaversion.viaversion.protocols.base.ClientboundStatusPackets;
import io.netty.channel.ChannelPipeline;
import net.fabricmc.loader.api.FabricLoader;
@ -138,14 +139,14 @@ public abstract class AbstractFabricVersionProvider extends BaseVersionProvider
}
private void handleMulticonnectPing(UserConnection connection, ProtocolInfo info, boolean blocked, ProtocolVersion serverVer) throws Exception {
if (info.getState() == State.STATUS
if (info.getServerState() == State.STATUS
&& info.getProtocolVersion() == -1
&& isMulticonnectHandler(connection.getChannel().pipeline())
&& (blocked || ProtocolUtils.isSupported(serverVer, getVersionForMulticonnect(serverVer)))) { // Intercept the connection
ProtocolVersion multiconnectSuggestion = blocked ? ProtocolVersion.unknown : getVersionForMulticonnect(serverVer);
getLogger().info("Sending " + multiconnectSuggestion + " for multiconnect version detector");
PacketWrapper newAnswer = PacketWrapper.create(ClientboundStatusPackets.STATUS_RESPONSE, null, connection);
newAnswer.write(Type.STRING, "{\"version\":{\"name\":\"viafabric integration\",\"protocol\":" + multiconnectSuggestion.getVersion() + "}}");
newAnswer.write(Types.STRING, "{\"version\":{\"name\":\"viafabric integration\",\"protocol\":" + multiconnectSuggestion.getVersion() + "}}");
newAnswer.send(info.getPipeline().contains(BaseProtocol1_16.class) ? BaseProtocol1_16.class : BaseProtocol1_7.class);
throw CancelException.generate();
}

View File

@ -28,11 +28,6 @@ public class FutureTaskId implements PlatformTask<Future<?>> {
this.object = object;
}
@Override
public Future<?> getObject() {
return object;
}
@Override
public void cancel() {
object.cancel(false);

View File

@ -80,7 +80,7 @@ public class ViaFabric implements ModInitializer {
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
.resolve("viafabric.yml").toFile(), JLOGGER);
manager.onServerLoaded();

View File

@ -19,12 +19,12 @@ package com.viaversion.fabric.mc1122.platform;
import com.viaversion.fabric.mc1122.providers.VFHandItemProvider;
import com.viaversion.fabric.mc1122.providers.FabricVersionProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
public class VFLoader implements ViaPlatformLoader {
@Override

View File

@ -21,7 +21,7 @@ import com.viaversion.fabric.mc1122.ViaFabric;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientTickEvents;

View File

@ -94,7 +94,7 @@ public class ViaFabric implements ModInitializer {
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
.resolve("viafabric.yml").toFile(), JLOGGER);
manager.onServerLoaded();

View File

@ -20,6 +20,7 @@ package com.viaversion.fabric.mc1144.mixin.debug.client;
import com.viaversion.fabric.common.handler.CommonTransformer;
import com.viaversion.fabric.common.handler.FabricDecodeHandler;
import com.viaversion.viaversion.api.connection.ProtocolInfo;
import com.viaversion.viaversion.api.connection.UserConnection;
import io.netty.channel.ChannelHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.DebugHud;
@ -41,11 +42,12 @@ public class MixinDebugHud {
@SuppressWarnings("ConstantConditions") ChannelHandler viaDecoder = ((MixinClientConnectionAccessor) MinecraftClient.getInstance().getNetworkHandler()
.getConnection()).getChannel().pipeline().get(CommonTransformer.HANDLER_DECODER_NAME);
if (viaDecoder instanceof FabricDecodeHandler) {
ProtocolInfo protocol = ((FabricDecodeHandler) viaDecoder).getInfo().getProtocolInfo();
UserConnection connection = ((FabricDecodeHandler) viaDecoder).getInfo();
ProtocolInfo protocol = connection.getProtocolInfo();
if (protocol != null) {
ProtocolVersion serverVer = ProtocolVersion.getProtocol(protocol.getServerProtocolVersion());
ProtocolVersion clientVer = ProtocolVersion.getProtocol(protocol.getProtocolVersion());
line += " / C: " + clientVer + " S: " + serverVer + " A: " + protocol.getUser().isActive();
ProtocolVersion serverVer = protocol.serverProtocolVersion();
ProtocolVersion clientVer = protocol.protocolVersion();
line += " / C: " + clientVer + " S: " + serverVer + " A: " + connection.isActive();
}
}

View File

@ -20,13 +20,13 @@ package com.viaversion.fabric.mc1144.platform;
import com.viaversion.fabric.mc1144.providers.VFHandItemProvider;
import com.viaversion.fabric.mc1144.providers.FabricVersionProvider;
import com.viaversion.fabric.mc1144.providers.VFPlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
public class VFLoader implements ViaPlatformLoader {
@Override

View File

@ -19,6 +19,7 @@ package com.viaversion.fabric.mc1144.providers;
import com.viaversion.fabric.common.util.RemappingUtil;
import com.viaversion.fabric.mc1144.ViaFabric;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
@ -30,9 +31,9 @@ import net.minecraft.util.Identifier;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
public class VFHandItemProvider extends HandItemProvider {
public class VFHandItemProvider extends HandItemProvider
{
public Item clientItem = null;
@Override

View File

@ -19,7 +19,7 @@ package com.viaversion.fabric.mc1144.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.Position;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult;

View File

@ -94,7 +94,7 @@ public class ViaFabric implements ModInitializer {
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
.resolve("viafabric.yml").toFile(), JLOGGER);
manager.onServerLoaded();

View File

@ -20,6 +20,7 @@ package com.viaversion.fabric.mc1152.mixin.debug.client;
import com.viaversion.fabric.common.handler.CommonTransformer;
import com.viaversion.fabric.common.handler.FabricDecodeHandler;
import com.viaversion.viaversion.api.connection.ProtocolInfo;
import com.viaversion.viaversion.api.connection.UserConnection;
import io.netty.channel.ChannelHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.DebugHud;
@ -41,11 +42,12 @@ public class MixinDebugHud {
@SuppressWarnings("ConstantConditions") ChannelHandler viaDecoder = ((MixinClientConnectionAccessor) MinecraftClient.getInstance().getNetworkHandler()
.getConnection()).getChannel().pipeline().get(CommonTransformer.HANDLER_DECODER_NAME);
if (viaDecoder instanceof FabricDecodeHandler) {
ProtocolInfo protocol = ((FabricDecodeHandler) viaDecoder).getInfo().getProtocolInfo();
UserConnection connection = ((FabricDecodeHandler) viaDecoder).getInfo();
ProtocolInfo protocol = connection.getProtocolInfo();
if (protocol != null) {
ProtocolVersion serverVer = ProtocolVersion.getProtocol(protocol.getServerProtocolVersion());
ProtocolVersion clientVer = ProtocolVersion.getProtocol(protocol.getProtocolVersion());
line += " / C: " + clientVer + " S: " + serverVer + " A: " + protocol.getUser().isActive();
ProtocolVersion serverVer = protocol.serverProtocolVersion();
ProtocolVersion clientVer = protocol.protocolVersion();
line += " / C: " + clientVer + " S: " + serverVer + " A: " + connection.isActive();
}
}

View File

@ -20,13 +20,13 @@ package com.viaversion.fabric.mc1152.platform;
import com.viaversion.fabric.mc1152.providers.VFHandItemProvider;
import com.viaversion.fabric.mc1152.providers.FabricVersionProvider;
import com.viaversion.fabric.mc1152.providers.VFPlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
public class VFLoader implements ViaPlatformLoader {
@Override

View File

@ -22,7 +22,7 @@ import com.viaversion.fabric.mc1152.ViaFabric;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;

View File

@ -19,7 +19,7 @@ package com.viaversion.fabric.mc1152.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.Position;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult;

View File

@ -96,7 +96,7 @@ public class ViaFabric implements ModInitializer {
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
.resolve("viafabric.yml").toFile(), JLOGGER);
manager.onServerLoaded();

View File

@ -20,6 +20,7 @@ package com.viaversion.fabric.mc1165.mixin.debug.client;
import com.viaversion.fabric.common.handler.CommonTransformer;
import com.viaversion.fabric.common.handler.FabricDecodeHandler;
import com.viaversion.viaversion.api.connection.ProtocolInfo;
import com.viaversion.viaversion.api.connection.UserConnection;
import io.netty.channel.ChannelHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.DebugHud;
@ -41,11 +42,12 @@ public class MixinDebugHud {
@SuppressWarnings("ConstantConditions") ChannelHandler viaDecoder = ((MixinClientConnectionAccessor) MinecraftClient.getInstance().getNetworkHandler()
.getConnection()).getChannel().pipeline().get(CommonTransformer.HANDLER_DECODER_NAME);
if (viaDecoder instanceof FabricDecodeHandler) {
ProtocolInfo protocol = ((FabricDecodeHandler) viaDecoder).getInfo().getProtocolInfo();
UserConnection connection = ((FabricDecodeHandler) viaDecoder).getInfo();
ProtocolInfo protocol = connection.getProtocolInfo();
if (protocol != null) {
ProtocolVersion serverVer = ProtocolVersion.getProtocol(protocol.getServerProtocolVersion());
ProtocolVersion clientVer = ProtocolVersion.getProtocol(protocol.getProtocolVersion());
line += " / C: " + clientVer + " S: " + serverVer + " A: " + protocol.getUser().isActive();
ProtocolVersion serverVer = protocol.serverProtocolVersion();
ProtocolVersion clientVer = protocol.protocolVersion();
line += " / C: " + clientVer + " S: " + serverVer + " A: " + connection.isActive();
}
}

View File

@ -21,14 +21,14 @@ import com.viaversion.fabric.mc1165.providers.VFHandItemProvider;
import com.viaversion.fabric.mc1165.providers.FabricVersionProvider;
import com.viaversion.fabric.mc1165.providers.VFPlayerAbilitiesProvider;
import com.viaversion.fabric.mc1165.providers.VFPlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
public class VFLoader implements ViaPlatformLoader {
@Override

View File

@ -22,7 +22,7 @@ import com.viaversion.fabric.mc1165.ViaFabric;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1165.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import net.minecraft.client.MinecraftClient;
public class VFPlayerAbilitiesProvider extends PlayerAbilitiesProvider {

View File

@ -19,7 +19,7 @@ package com.viaversion.fabric.mc1165.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.Position;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult;

View File

@ -96,7 +96,7 @@ public class ViaFabric implements ModInitializer {
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
.resolve("viafabric.yml").toFile(), JLOGGER);
manager.onServerLoaded();

View File

@ -20,6 +20,7 @@ package com.viaversion.fabric.mc1171.mixin.debug.client;
import com.viaversion.fabric.common.handler.CommonTransformer;
import com.viaversion.fabric.common.handler.FabricDecodeHandler;
import com.viaversion.viaversion.api.connection.ProtocolInfo;
import com.viaversion.viaversion.api.connection.UserConnection;
import io.netty.channel.ChannelHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.DebugHud;
@ -41,11 +42,12 @@ public class MixinDebugHud {
@SuppressWarnings("ConstantConditions") ChannelHandler viaDecoder = ((MixinClientConnectionAccessor) MinecraftClient.getInstance().getNetworkHandler()
.getConnection()).getChannel().pipeline().get(CommonTransformer.HANDLER_DECODER_NAME);
if (viaDecoder instanceof FabricDecodeHandler) {
ProtocolInfo protocol = ((FabricDecodeHandler) viaDecoder).getInfo().getProtocolInfo();
UserConnection connection = ((FabricDecodeHandler) viaDecoder).getInfo();
ProtocolInfo protocol = connection.getProtocolInfo();
if (protocol != null) {
ProtocolVersion serverVer = ProtocolVersion.getProtocol(protocol.getServerProtocolVersion());
ProtocolVersion clientVer = ProtocolVersion.getProtocol(protocol.getProtocolVersion());
line += " / C: " + clientVer + " S: " + serverVer + " A: " + protocol.getUser().isActive();
ProtocolVersion serverVer = protocol.serverProtocolVersion();
ProtocolVersion clientVer = protocol.protocolVersion();
line += " / C: " + clientVer + " S: " + serverVer + " A: " + connection.isActive();
}
}

View File

@ -21,14 +21,14 @@ import com.viaversion.fabric.mc1171.providers.VFHandItemProvider;
import com.viaversion.fabric.mc1171.providers.FabricVersionProvider;
import com.viaversion.fabric.mc1171.providers.VFPlayerAbilitiesProvider;
import com.viaversion.fabric.mc1171.providers.VFPlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
public class VFLoader implements ViaPlatformLoader {
@Override

View File

@ -22,7 +22,7 @@ import com.viaversion.fabric.mc1171.ViaFabric;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1171.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import net.minecraft.client.MinecraftClient;
public class VFPlayerAbilitiesProvider extends PlayerAbilitiesProvider {

View File

@ -19,7 +19,7 @@ package com.viaversion.fabric.mc1171.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.Position;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult;

View File

@ -96,7 +96,7 @@ public class ViaFabric implements ModInitializer {
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
.resolve("viafabric.yml").toFile(), JLOGGER);
manager.onServerLoaded();

View File

@ -20,6 +20,7 @@ package com.viaversion.fabric.mc1182.mixin.debug.client;
import com.viaversion.fabric.common.handler.CommonTransformer;
import com.viaversion.fabric.common.handler.FabricDecodeHandler;
import com.viaversion.viaversion.api.connection.ProtocolInfo;
import com.viaversion.viaversion.api.connection.UserConnection;
import io.netty.channel.ChannelHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.DebugHud;
@ -41,11 +42,12 @@ public class MixinDebugHud {
@SuppressWarnings("ConstantConditions") ChannelHandler viaDecoder = ((MixinClientConnectionAccessor) MinecraftClient.getInstance().getNetworkHandler()
.getConnection()).getChannel().pipeline().get(CommonTransformer.HANDLER_DECODER_NAME);
if (viaDecoder instanceof FabricDecodeHandler) {
ProtocolInfo protocol = ((FabricDecodeHandler) viaDecoder).getInfo().getProtocolInfo();
UserConnection connection = ((FabricDecodeHandler) viaDecoder).getInfo();
ProtocolInfo protocol = connection.getProtocolInfo();
if (protocol != null) {
ProtocolVersion serverVer = ProtocolVersion.getProtocol(protocol.getServerProtocolVersion());
ProtocolVersion clientVer = ProtocolVersion.getProtocol(protocol.getProtocolVersion());
line += " / C: " + clientVer + " S: " + serverVer + " A: " + protocol.getUser().isActive();
ProtocolVersion serverVer = protocol.serverProtocolVersion();
ProtocolVersion clientVer = protocol.protocolVersion();
line += " / C: " + clientVer + " S: " + serverVer + " A: " + connection.isActive();
}
}

View File

@ -21,14 +21,14 @@ import com.viaversion.fabric.mc1182.providers.VFHandItemProvider;
import com.viaversion.fabric.mc1182.providers.FabricVersionProvider;
import com.viaversion.fabric.mc1182.providers.VFPlayerAbilitiesProvider;
import com.viaversion.fabric.mc1182.providers.VFPlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
public class VFLoader implements ViaPlatformLoader {
@Override

View File

@ -22,7 +22,7 @@ import com.viaversion.fabric.mc1182.ViaFabric;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1182.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import net.minecraft.client.MinecraftClient;
public class VFPlayerAbilitiesProvider extends PlayerAbilitiesProvider {

View File

@ -19,7 +19,7 @@ package com.viaversion.fabric.mc1182.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.Position;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.hit.HitResult;

View File

@ -96,7 +96,7 @@ public class ViaFabric implements ModInitializer {
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
.resolve("viafabric.yml").toFile(), JLOGGER);
manager.onServerLoaded();

View File

@ -20,6 +20,7 @@ package com.viaversion.fabric.mc1194.mixin.debug.client;
import com.viaversion.fabric.common.handler.CommonTransformer;
import com.viaversion.fabric.common.handler.FabricDecodeHandler;
import com.viaversion.viaversion.api.connection.ProtocolInfo;
import com.viaversion.viaversion.api.connection.UserConnection;
import io.netty.channel.ChannelHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.DebugHud;
@ -41,11 +42,12 @@ public class MixinDebugHud {
@SuppressWarnings("ConstantConditions") ChannelHandler viaDecoder = ((MixinClientConnectionAccessor) MinecraftClient.getInstance().getNetworkHandler()
.getConnection()).getChannel().pipeline().get(CommonTransformer.HANDLER_DECODER_NAME);
if (viaDecoder instanceof FabricDecodeHandler) {
ProtocolInfo protocol = ((FabricDecodeHandler) viaDecoder).getInfo().getProtocolInfo();
UserConnection connection = ((FabricDecodeHandler) viaDecoder).getInfo();
ProtocolInfo protocol = connection.getProtocolInfo();
if (protocol != null) {
ProtocolVersion serverVer = ProtocolVersion.getProtocol(protocol.getServerProtocolVersion());
ProtocolVersion clientVer = ProtocolVersion.getProtocol(protocol.getProtocolVersion());
line += " / C: " + clientVer + " S: " + serverVer + " A: " + protocol.getUser().isActive();
ProtocolVersion serverVer = protocol.serverProtocolVersion();
ProtocolVersion clientVer = protocol.protocolVersion();
line += " / C: " + clientVer + " S: " + serverVer + " A: " + connection.isActive();
}
}

View File

@ -21,14 +21,14 @@ import com.viaversion.fabric.mc1194.providers.VFHandItemProvider;
import com.viaversion.fabric.mc1194.providers.FabricVersionProvider;
import com.viaversion.fabric.mc1194.providers.VFPlayerAbilitiesProvider;
import com.viaversion.fabric.mc1194.providers.VFPlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
public class VFLoader implements ViaPlatformLoader {
@Override

View File

@ -22,7 +22,7 @@ import com.viaversion.fabric.mc1194.ViaFabric;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1194.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import net.minecraft.client.MinecraftClient;
public class VFPlayerAbilitiesProvider extends PlayerAbilitiesProvider {

View File

@ -19,7 +19,7 @@ package com.viaversion.fabric.mc1194.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.Position;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;

View File

@ -96,7 +96,7 @@ public class ViaFabric implements ModInitializer {
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
.resolve("viafabric.yml").toFile(), JLOGGER);
manager.onServerLoaded();

View File

@ -20,6 +20,7 @@ package com.viaversion.fabric.mc1201.mixin.debug.client;
import com.viaversion.fabric.common.handler.CommonTransformer;
import com.viaversion.fabric.common.handler.FabricDecodeHandler;
import com.viaversion.viaversion.api.connection.ProtocolInfo;
import com.viaversion.viaversion.api.connection.UserConnection;
import io.netty.channel.ChannelHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.DebugHud;
@ -41,11 +42,12 @@ public class MixinDebugHud {
@SuppressWarnings("ConstantConditions") ChannelHandler viaDecoder = ((MixinClientConnectionAccessor) MinecraftClient.getInstance().getNetworkHandler()
.getConnection()).getChannel().pipeline().get(CommonTransformer.HANDLER_DECODER_NAME);
if (viaDecoder instanceof FabricDecodeHandler) {
ProtocolInfo protocol = ((FabricDecodeHandler) viaDecoder).getInfo().getProtocolInfo();
UserConnection connection = ((FabricDecodeHandler) viaDecoder).getInfo();
ProtocolInfo protocol = connection.getProtocolInfo();
if (protocol != null) {
ProtocolVersion serverVer = ProtocolVersion.getProtocol(protocol.getServerProtocolVersion());
ProtocolVersion clientVer = ProtocolVersion.getProtocol(protocol.getProtocolVersion());
line += " / C: " + clientVer + " S: " + serverVer + " A: " + protocol.getUser().isActive();
ProtocolVersion serverVer = protocol.serverProtocolVersion();
ProtocolVersion clientVer = protocol.protocolVersion();
line += " / C: " + clientVer + " S: " + serverVer + " A: " + connection.isActive();
}
}

View File

@ -21,14 +21,14 @@ import com.viaversion.fabric.mc1201.providers.VFHandItemProvider;
import com.viaversion.fabric.mc1201.providers.FabricVersionProvider;
import com.viaversion.fabric.mc1201.providers.VFPlayerAbilitiesProvider;
import com.viaversion.fabric.mc1201.providers.VFPlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
public class VFLoader implements ViaPlatformLoader {
@Override

View File

@ -22,7 +22,7 @@ import com.viaversion.fabric.mc1201.ViaFabric;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1201.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import net.minecraft.client.MinecraftClient;
public class VFPlayerAbilitiesProvider extends PlayerAbilitiesProvider {

View File

@ -19,7 +19,7 @@ package com.viaversion.fabric.mc1201.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.Position;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;

View File

@ -96,7 +96,7 @@ public class ViaFabric implements ModInitializer {
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
.resolve("viafabric.yml").toFile(), JLOGGER);
manager.onServerLoaded();

View File

@ -20,6 +20,7 @@ package com.viaversion.fabric.mc1204.mixin.debug.client;
import com.viaversion.fabric.common.handler.CommonTransformer;
import com.viaversion.fabric.common.handler.FabricDecodeHandler;
import com.viaversion.viaversion.api.connection.ProtocolInfo;
import com.viaversion.viaversion.api.connection.UserConnection;
import io.netty.channel.ChannelHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.DebugHud;
@ -41,11 +42,12 @@ public class MixinDebugHud {
@SuppressWarnings("ConstantConditions") ChannelHandler viaDecoder = ((MixinClientConnectionAccessor) MinecraftClient.getInstance().getNetworkHandler()
.getConnection()).getChannel().pipeline().get(CommonTransformer.HANDLER_DECODER_NAME);
if (viaDecoder instanceof FabricDecodeHandler) {
ProtocolInfo protocol = ((FabricDecodeHandler) viaDecoder).getInfo().getProtocolInfo();
UserConnection connection = ((FabricDecodeHandler) viaDecoder).getInfo();
ProtocolInfo protocol = connection.getProtocolInfo();
if (protocol != null) {
ProtocolVersion serverVer = ProtocolVersion.getProtocol(protocol.getServerProtocolVersion());
ProtocolVersion clientVer = ProtocolVersion.getProtocol(protocol.getProtocolVersion());
line += " / C: " + clientVer + " S: " + serverVer + " A: " + protocol.getUser().isActive();
ProtocolVersion serverVer = protocol.serverProtocolVersion();
ProtocolVersion clientVer = protocol.protocolVersion();
line += " / C: " + clientVer + " S: " + serverVer + " A: " + connection.isActive();
}
}

View File

@ -21,14 +21,14 @@ import com.viaversion.fabric.mc1204.providers.VFHandItemProvider;
import com.viaversion.fabric.mc1204.providers.FabricVersionProvider;
import com.viaversion.fabric.mc1204.providers.VFPlayerAbilitiesProvider;
import com.viaversion.fabric.mc1204.providers.VFPlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
public class VFLoader implements ViaPlatformLoader {
@Override

View File

@ -22,7 +22,7 @@ import com.viaversion.fabric.mc1204.ViaFabric;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1204.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import net.minecraft.client.MinecraftClient;
public class VFPlayerAbilitiesProvider extends PlayerAbilitiesProvider {

View File

@ -19,7 +19,7 @@ package com.viaversion.fabric.mc1204.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.Position;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;

View File

@ -96,7 +96,7 @@ public class ViaFabric implements ModInitializer {
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
.resolve("viafabric.yml").toFile(), JLOGGER);
manager.onServerLoaded();

View File

@ -20,6 +20,7 @@ package com.viaversion.fabric.mc1206.mixin.debug.client;
import com.viaversion.fabric.common.handler.CommonTransformer;
import com.viaversion.fabric.common.handler.FabricDecodeHandler;
import com.viaversion.viaversion.api.connection.ProtocolInfo;
import com.viaversion.viaversion.api.connection.UserConnection;
import io.netty.channel.ChannelHandler;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.hud.DebugHud;
@ -41,11 +42,12 @@ public class MixinDebugHud {
@SuppressWarnings("ConstantConditions") ChannelHandler viaDecoder = ((MixinClientConnectionAccessor) MinecraftClient.getInstance().getNetworkHandler()
.getConnection()).getChannel().pipeline().get(CommonTransformer.HANDLER_DECODER_NAME);
if (viaDecoder instanceof FabricDecodeHandler) {
ProtocolInfo protocol = ((FabricDecodeHandler) viaDecoder).getInfo().getProtocolInfo();
UserConnection connection = ((FabricDecodeHandler) viaDecoder).getInfo();
ProtocolInfo protocol = connection.getProtocolInfo();
if (protocol != null) {
ProtocolVersion serverVer = ProtocolVersion.getProtocol(protocol.getServerProtocolVersion());
ProtocolVersion clientVer = ProtocolVersion.getProtocol(protocol.getProtocolVersion());
line += " / C: " + clientVer + " S: " + serverVer + " A: " + protocol.getUser().isActive();
ProtocolVersion serverVer = protocol.serverProtocolVersion();
ProtocolVersion clientVer = protocol.protocolVersion();
line += " / C: " + clientVer + " S: " + serverVer + " A: " + connection.isActive();
}
}

View File

@ -21,14 +21,14 @@ import com.viaversion.fabric.mc1206.providers.VFHandItemProvider;
import com.viaversion.fabric.mc1206.providers.FabricVersionProvider;
import com.viaversion.fabric.mc1206.providers.VFPlayerAbilitiesProvider;
import com.viaversion.fabric.mc1206.providers.VFPlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
public class VFLoader implements ViaPlatformLoader {
@Override

View File

@ -22,7 +22,7 @@ import com.viaversion.fabric.mc1206.ViaFabric;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;

View File

@ -18,7 +18,7 @@
package com.viaversion.fabric.mc1206.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerAbilitiesProvider;
import com.viaversion.viaversion.protocols.v1_15_2to1_16.provider.PlayerAbilitiesProvider;
import net.minecraft.client.MinecraftClient;
public class VFPlayerAbilitiesProvider extends PlayerAbilitiesProvider {

View File

@ -19,7 +19,7 @@ package com.viaversion.fabric.mc1206.providers;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.Position;
import com.viaversion.viaversion.protocols.protocol1_13to1_12_2.providers.PlayerLookTargetProvider;
import com.viaversion.viaversion.protocols.v1_12_2to1_13.provider.PlayerLookTargetProvider;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.hit.BlockHitResult;
import net.minecraft.util.math.BlockPos;

View File

@ -80,7 +80,7 @@ public class ViaFabric implements ModInitializer {
registerCommandsV1();
config = new VFConfig(FabricLoader.getInstance().getConfigDir().resolve("ViaFabric")
.resolve("viafabric.yml").toFile());
.resolve("viafabric.yml").toFile(), JLOGGER);
manager.onServerLoaded();

View File

@ -19,12 +19,12 @@ package com.viaversion.fabric.mc189.platform;
import com.viaversion.fabric.mc189.providers.VFHandItemProvider;
import com.viaversion.fabric.mc189.providers.FabricVersionProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.loader.api.FabricLoader;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.platform.ViaPlatformLoader;
import com.viaversion.viaversion.api.protocol.version.VersionProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
public class VFLoader implements ViaPlatformLoader {
@Override

View File

@ -21,7 +21,7 @@ import com.viaversion.fabric.mc189.ViaFabric;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.minecraft.item.DataItem;
import com.viaversion.viaversion.api.minecraft.item.Item;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import com.viaversion.viaversion.protocols.v1_8to1_9.provider.HandItemProvider;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.legacyfabric.fabric.api.client.event.lifecycle.v1.ClientTickEvents;