Skip to content

Commit

Permalink
Update Via* API usage
Browse files Browse the repository at this point in the history
  • Loading branch information
FlorianMichael committed Jan 1, 2025
1 parent 153ae7a commit ef763be
Show file tree
Hide file tree
Showing 21 changed files with 36 additions and 38 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@
import com.viaversion.viafabricplus.ViaFabricPlus;
import com.viaversion.viafabricplus.api.settings.AbstractSetting;
import com.viaversion.viafabricplus.api.settings.SettingGroup;
import com.viaversion.vialoader.util.VersionRange;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.minecraft.text.MutableText;
import net.raphimc.vialoader.util.VersionRange;

public class VersionedBooleanSetting extends AbstractSetting<Integer> {

Expand Down
16 changes: 7 additions & 9 deletions build-logic/src/main/groovy/vfp.base-conventions.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ repositories {
}

configurations {
// Workaround Gradle 8+ not supporting including a configuration as dependency by
// just extending a defined configuration later to other configurations :)
vvDependencies

compileOnly.extendsFrom vvDependencies
Expand All @@ -53,18 +51,18 @@ dependencies {
mappings "net.fabricmc:yarn:${project.yarn_version}:v2"
modImplementation "net.fabricmc:fabric-loader:${project.loader_version}"

vvDependencies "com.viaversion:viaversion-common:5.2.1-SNAPSHOT"
vvDependencies "com.viaversion:viabackwards-common:5.2.1-SNAPSHOT"
vvDependencies "net.raphimc:viaaprilfools-common:3.0.4"
vvDependencies "com.viaversion:viaversion-common:5.2.1"
vvDependencies "com.viaversion:viabackwards-common:5.2.1"
vvDependencies "com.viaversion:viaaprilfools-common:4.0.0"
vvDependencies ("com.viaversion:vialoader:4.0.0") {
exclude group: "com.google.guava", module: "guava"
exclude group: "org.slf4j", module: "slf4j-api"
}
vvDependencies "net.raphimc:ViaLegacy:3.0.7-SNAPSHOT"
vvDependencies ("net.raphimc:ViaBedrock:0.0.14-SNAPSHOT") {
exclude group: "io.jsonwebtoken"
exclude group: "com.mojang", module: "brigadier"
}
vvDependencies ("net.raphimc:ViaLoader:3.0.4") {
exclude group: "com.google.guava", module: "guava"
exclude group: "org.slf4j", module: "slf4j-api"
}
}

java {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

package com.viaversion.viafabricplus.features;

import com.viaversion.viaaprilfools.api.AprilFoolsProtocolVersion;
import com.viaversion.viafabricplus.api.events.LoadingCycleCallback;
import com.viaversion.viafabricplus.base.Events;
import com.viaversion.viafabricplus.features.emulation.armor_hud.ArmorHudEmulation1_8;
Expand All @@ -33,7 +34,6 @@
import com.viaversion.viafabricplus.features.emulation.recipe.Recipes1_11_2;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.minecraft.client.MinecraftClient;
import net.raphimc.viaaprilfools.api.AprilFoolsProtocolVersion;

public final class FeaturesLoading {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

package com.viaversion.viafabricplus.features.item.filter_creative_tabs;

import com.viaversion.vialoader.util.VersionRange;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.injection.access.base.IClientConnection;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
Expand All @@ -29,17 +30,16 @@
import net.minecraft.item.Item;
import net.raphimc.vialegacy.protocol.classic.c0_30cpetoc0_28_30.data.ClassicProtocolExtension;
import net.raphimc.vialegacy.protocol.classic.c0_30cpetoc0_28_30.storage.ExtensionProtocolMetadataStorage;
import net.raphimc.vialoader.util.VersionRange;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

import static com.viaversion.vialoader.util.VersionRange.*;
import static com.viaversion.viaversion.api.protocol.version.ProtocolVersion.*;
import static net.minecraft.item.Items.*;
import static net.raphimc.vialegacy.api.LegacyProtocolVersion.*;
import static net.raphimc.vialoader.util.VersionRange.*;

/**
* Class file which contains the {@link VersionRange} for every item added in the game.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@
import com.llamalad7.mixinextras.injector.wrapoperation.Operation;
import com.llamalad7.mixinextras.injector.wrapoperation.WrapOperation;
import com.llamalad7.mixinextras.sugar.Local;
import com.viaversion.vialoader.netty.CompressionReorderEvent;
import com.viaversion.vialoader.netty.VLLegacyPipeline;
import com.viaversion.vialoader.netty.VLPipeline;
import com.viaversion.vialoader.netty.viabedrock.PingEncapsulationCodec;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.injection.access.base.IClientConnection;
Expand All @@ -45,10 +49,6 @@
import net.minecraft.util.profiler.MultiValueDebugSampleLogImpl;
import net.raphimc.viabedrock.api.BedrockProtocolVersion;
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
import net.raphimc.vialoader.netty.CompressionReorderEvent;
import net.raphimc.vialoader.netty.VLLegacyPipeline;
import net.raphimc.vialoader.netty.VLPipeline;
import net.raphimc.vialoader.netty.viabedrock.PingEncapsulationCodec;
import org.cloudburstmc.netty.channel.raknet.RakChannelFactory;
import org.jetbrains.annotations.NotNull;
import org.spongepowered.asm.mixin.Mixin;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@

package com.viaversion.viafabricplus.injection.mixin.features.april_fools_8bit_sound;

import com.viaversion.viaaprilfools.api.AprilFoolsProtocolVersion;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import net.minecraft.client.sound.StaticSound;
import net.raphimc.viaaprilfools.api.AprilFoolsProtocolVersion;
import org.spongepowered.asm.mixin.Final;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
import com.mojang.brigadier.builder.LiteralArgumentBuilder;
import com.mojang.brigadier.builder.RequiredArgumentBuilder;
import com.viaversion.viafabricplus.base.Events;
import com.viaversion.vialoader.ViaLoader;
import com.viaversion.vialoader.impl.platform.ViaAprilFoolsPlatformImpl;
import com.viaversion.vialoader.impl.platform.ViaBackwardsPlatformImpl;
import com.viaversion.vialoader.impl.platform.ViaBedrockPlatformImpl;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.connection.ProtocolInfo;
import com.viaversion.viaversion.api.connection.UserConnection;
Expand Down Expand Up @@ -58,10 +62,6 @@
import net.minecraft.network.ClientConnection;
import net.raphimc.viabedrock.api.BedrockProtocolVersion;
import net.raphimc.viabedrock.protocol.data.ProtocolConstants;
import net.raphimc.vialoader.ViaLoader;
import net.raphimc.vialoader.impl.platform.ViaAprilFoolsPlatformImpl;
import net.raphimc.vialoader.impl.platform.ViaBackwardsPlatformImpl;
import net.raphimc.vialoader.impl.platform.ViaBedrockPlatformImpl;
import org.cloudburstmc.netty.channel.raknet.config.RakChannelOption;

import java.nio.file.FileAlreadyExistsException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
import com.mojang.brigadier.suggestion.SuggestionsBuilder;
import com.viaversion.viafabricplus.protocoltranslator.impl.command.classic.ListExtensionsCommand;
import com.viaversion.viafabricplus.protocoltranslator.impl.command.classic.SetTimeCommand;
import com.viaversion.vialoader.impl.viaversion.VLCommandHandler;
import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource;
import net.raphimc.vialoader.impl.viaversion.VLCommandHandler;

import java.util.concurrent.CompletableFuture;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package com.viaversion.viafabricplus.protocoltranslator.impl.platform;

import net.raphimc.vialoader.impl.platform.ViaLegacyPlatformImpl;
import com.viaversion.vialoader.impl.platform.ViaLegacyPlatformImpl;

public final class ViaFabricPlusViaLegacyPlatformImpl extends ViaLegacyPlatformImpl {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

package com.viaversion.viafabricplus.protocoltranslator.impl.platform;

import com.viaversion.vialoader.impl.platform.ViaVersionPlatformImpl;
import com.viaversion.viaversion.configuration.AbstractViaConfig;
import com.viaversion.viaversion.libs.gson.JsonArray;
import com.viaversion.viaversion.libs.gson.JsonObject;
Expand All @@ -29,7 +30,6 @@
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import com.viaversion.viafabricplus.protocoltranslator.impl.viaversion.ViaFabricPlusVLViaConfig;
import net.fabricmc.loader.api.FabricLoader;
import net.raphimc.vialoader.impl.platform.ViaVersionPlatformImpl;

import java.io.File;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

package com.viaversion.viafabricplus.protocoltranslator.impl.provider.viabedrock;

import com.viaversion.vialoader.netty.VLPipeline;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viafabricplus.protocoltranslator.netty.ViaFabricPlusVLLegacyPipeline;
import io.netty.channel.Channel;
import net.raphimc.viabedrock.api.io.compression.ProtocolCompression;
import net.raphimc.viabedrock.netty.AesEncryptionCodec;
import net.raphimc.viabedrock.netty.CompressionCodec;
import net.raphimc.viabedrock.protocol.provider.NettyPipelineProvider;
import net.raphimc.vialoader.netty.VLPipeline;

import javax.crypto.SecretKey;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@

package com.viaversion.viafabricplus.protocoltranslator.impl.viaversion;

import net.raphimc.vialoader.impl.viaversion.VLInjector;
import net.raphimc.vialoader.netty.VLLegacyPipeline;
import com.viaversion.vialoader.impl.viaversion.VLInjector;
import com.viaversion.vialoader.netty.VLLegacyPipeline;

public final class ViaFabricPlusVLInjector extends VLInjector {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import com.viaversion.viafabricplus.base.Events;
import com.viaversion.viafabricplus.protocoltranslator.impl.provider.vialegacy.*;
import com.viaversion.viafabricplus.protocoltranslator.impl.provider.viaversion.*;
import com.viaversion.vialoader.impl.viaversion.VLLoader;
import com.viaversion.viaversion.api.Via;
import com.viaversion.viaversion.api.minecraft.signature.SignableCommandArgumentsProvider;
import com.viaversion.viaversion.api.platform.providers.ViaProviders;
Expand All @@ -43,7 +44,6 @@
import net.raphimc.vialegacy.protocol.release.r1_2_4_5tor1_3_1_2.provider.OldAuthProvider;
import net.raphimc.vialegacy.protocol.release.r1_6_4tor1_7_2_5.provider.EncryptionProvider;
import net.raphimc.vialegacy.protocol.release.r1_7_6_10tor1_8.provider.GameProfileFetcher;
import net.raphimc.vialoader.impl.viaversion.VLLoader;

public final class ViaFabricPlusVLLoader extends VLLoader {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@

package com.viaversion.viafabricplus.protocoltranslator.impl.viaversion;

import net.raphimc.vialoader.impl.viaversion.VLViaConfig;
import com.viaversion.vialoader.impl.viaversion.VLViaConfig;

import java.io.File;
import java.util.logging.Logger;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@

package com.viaversion.viafabricplus.protocoltranslator.netty;

import com.viaversion.vialoader.netty.CompressionReorderEvent;
import com.viaversion.vialoader.netty.VLLegacyPipeline;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.ViaFabricPlusImpl;
import com.viaversion.viafabricplus.protocoltranslator.protocol.ViaFabricPlusProtocol;
import io.netty.channel.ChannelHandler;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.network.handler.HandlerNames;
import net.raphimc.vialoader.netty.CompressionReorderEvent;
import net.raphimc.vialoader.netty.VLLegacyPipeline;

public final class ViaFabricPlusVLLegacyPipeline extends VLLegacyPipeline {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,14 @@

package com.viaversion.viafabricplus.protocoltranslator.netty;

import com.viaversion.vialoader.netty.ViaDecoder;
import com.viaversion.viaversion.api.connection.UserConnection;
import com.viaversion.viafabricplus.ViaFabricPlusImpl;
import com.viaversion.viafabricplus.settings.impl.GeneralSettings;
import com.viaversion.viafabricplus.util.ChatUtil;
import io.netty.channel.ChannelHandlerContext;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.raphimc.vialoader.netty.ViaDecoder;

public final class ViaFabricPlusViaDecoder extends ViaDecoder {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@
*/
package com.viaversion.viafabricplus.protocoltranslator.util;

import com.viaversion.vialoader.util.ProtocolVersionList;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.lenni0451.mcping.MCPing;
import net.lenni0451.mcping.responses.MCPingResponse;
import net.minecraft.util.Formatting;
import net.raphimc.vialoader.util.ProtocolVersionList;

import java.net.InetSocketAddress;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

package com.viaversion.viafabricplus.screen.impl;

import com.viaversion.vialoader.util.ProtocolVersionList;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.screen.VFPList;
import com.viaversion.viafabricplus.screen.VFPListEntry;
Expand All @@ -32,7 +33,6 @@
import net.minecraft.text.MutableText;
import net.minecraft.text.Text;
import net.minecraft.util.Formatting;
import net.raphimc.vialoader.util.ProtocolVersionList;

import java.util.function.Consumer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

package com.viaversion.viafabricplus.screen.impl;

import com.viaversion.vialoader.util.ProtocolVersionList;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.protocoltranslator.ProtocolTranslator;
import com.viaversion.viafabricplus.screen.VFPList;
Expand All @@ -33,7 +34,6 @@
import net.minecraft.client.gui.widget.ButtonWidget;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.text.Text;
import net.raphimc.vialoader.util.ProtocolVersionList;

import java.awt.*;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
import com.viaversion.viafabricplus.api.settings.SettingGroup;
import com.viaversion.viafabricplus.api.settings.type.BooleanSetting;
import com.viaversion.viafabricplus.api.settings.type.VersionedBooleanSetting;
import com.viaversion.vialoader.util.VersionRange;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import net.minecraft.text.Text;
import net.raphimc.vialoader.util.VersionRange;

public final class DebugSettings extends SettingGroup {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

package com.viaversion.viafabricplus.visuals.settings;

import com.viaversion.vialoader.util.VersionRange;
import com.viaversion.viaversion.api.protocol.version.ProtocolVersion;
import com.viaversion.viafabricplus.api.settings.type.BooleanSetting;
import com.viaversion.viafabricplus.api.settings.type.ModeSetting;
Expand All @@ -30,7 +31,6 @@
import net.minecraft.client.font.FontStorage;
import net.minecraft.text.Text;
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
import net.raphimc.vialoader.util.VersionRange;

public final class VisualSettings extends SettingGroup {

Expand Down

0 comments on commit ef763be

Please sign in to comment.