diff --git a/build.gradle b/build.gradle index 3c4753a..db95639 100644 --- a/build.gradle +++ b/build.gradle @@ -96,9 +96,10 @@ mixin { jar { manifest.attributes( "MixinConfigs": "mixins.${maven_name}.json", - "tweakClass": "org.spongepowered.asm.launch.MixinTweaker", + "TweakClass": "org.spongepowered.asm.launch.MixinTweaker", "TweakOrder": 0, - "FMLCorePluginContainsFMLMod": "de.florianmichael.viaforge.mixin.MixinLoader" + "FMLCorePlugin": "de.florianmichael.viaforge.mixin.MixinLoader", + "FMLCorePluginContainsFMLMod": "true" ) enabled = false diff --git a/gradle.properties b/gradle.properties index 3a42f1d..c67826d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -4,13 +4,13 @@ org.gradle.daemon=false # Project Details maven_name=viaforge-mc189 -maven_version=3.6.2-SNAPSHOT +maven_version=3.6.2 maven_group=de.florianmichael # ViaVersion -viaversion_version=4.10.1 -viabackwards_version=4.10.1 -viarewind_version=3.1.1 +viaversion_version=4.10.3-SNAPSHOT +viabackwards_version=4.10.3-SNAPSHOT +viarewind_version=3.1.2 vialegacy_version=2.2.23-SNAPSHOT viaaprilfools_version=2.0.13-SNAPSHOT vialoader_version=2.2.14-SNAPSHOT diff --git a/src/main/java/de/florianmichael/viaforge/mixin/impl/fixes/patcher/MixinProtocolVersionDetector.java b/src/main/java/de/florianmichael/viaforge/mixin/impl/fixes/patcher/MixinProtocolVersionDetector.java new file mode 100644 index 0000000..e185edc --- /dev/null +++ b/src/main/java/de/florianmichael/viaforge/mixin/impl/fixes/patcher/MixinProtocolVersionDetector.java @@ -0,0 +1,41 @@ +/* + * This file is part of ViaForge - https://github.com/FlorianMichael/ViaForge + * Copyright (C) 2021-2024 FlorianMichael/EnZaXD and contributors + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package de.florianmichael.viaforge.mixin.impl.fixes.patcher; + +import com.viaversion.viaversion.api.protocol.version.ProtocolVersion; +import de.florianmichael.viaforge.common.ViaForgeCommon; +import org.spongepowered.asm.mixin.Dynamic; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Pseudo; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +@Pseudo +@Mixin(targets = "club.sk1er.patcher.util.status.ProtocolVersionDetector", remap = false) +public abstract class MixinProtocolVersionDetector { + + @SuppressWarnings("rawtypes, unchecked") + @Dynamic + @Inject(method = "isCompatibleWithVersion", at = @At("HEAD"), cancellable = true) + private void viaforge$setCompatible(String ip, int version, CallbackInfoReturnable cir) { + cir.setReturnValue(ViaForgeCommon.getManager().getTargetVersion().newerThanOrEqualTo(ProtocolVersion.v1_11)); + } + +} diff --git a/src/main/resources/mixins.viaforge-mc189.json b/src/main/resources/mixins.viaforge-mc189.json index 94a834b..259d110 100644 --- a/src/main/resources/mixins.viaforge-mc189.json +++ b/src/main/resources/mixins.viaforge-mc189.json @@ -10,13 +10,14 @@ "MixinGuiOverlayDebug", "MixinGuiScreenAddServer", "MixinGuiScreenServerList", + "MixinServerData", + "connect.MixinGuiConnecting_1", "connect.MixinNetHandlerLoginClient", "connect.MixinNetworkManager", "connect.MixinNetworkManager_5", - "MixinServerData", "connect.MixinServerPinger", "fixes.MixinEntityPlayerSP", - "connect.MixinGuiConnecting_1" + "fixes.patcher.MixinProtocolVersionDetector" ], "verbose": true }