Cleanup mod metadata and update mappings (#91)

This commit is contained in:
Howard ZHY 2024-05-06 23:09:15 +08:00 committed by GitHub
parent 0530b3f2e9
commit e46d3df947
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 7 additions and 12 deletions

View File

@ -39,7 +39,7 @@ repositories {
minecraft {
version = "1.8.9-11.15.1.2318-1.8.9"
runDir = "run"
mappings = "stable_20"
mappings = "stable_22"
makeObfSourceJar = false
clientJvmArgs += ["-Dfml.coreMods.load=de.florianmichael.viaforge.mixin.MixinLoader"]
}

View File

@ -29,7 +29,7 @@ import net.raphimc.vialegacy.protocols.release.protocol1_8to1_7_6_10.providers.G
import java.io.File;
import java.util.function.Supplier;
@Mod(modid = "viaforge")
@Mod(modid = "viaforge", name = "ViaForge", acceptableRemoteVersions = "*", clientSideOnly=true, useMetadata=true)
public class ViaForge189 implements VFPlatform {
public static final ViaForge189 PLATFORM = new ViaForge189();

View File

@ -27,7 +27,6 @@ import net.minecraft.network.NettyEncryptingDecoder;
import net.minecraft.network.NettyEncryptingEncoder;
import net.minecraft.network.NetworkManager;
import net.minecraft.util.CryptManager;
import net.minecraft.util.IChatComponent;
import net.minecraft.util.LazyLoadBase;
import net.raphimc.vialegacy.api.LegacyProtocolVersion;
import net.raphimc.vialoader.netty.VLLegacyPipeline;
@ -78,7 +77,7 @@ public class MixinNetworkManager implements VFNetworkManager {
}
}
@Inject(method = "func_181124_a", at = @At(value = "INVOKE", target = "Lio/netty/bootstrap/Bootstrap;group(Lio/netty/channel/EventLoopGroup;)Lio/netty/bootstrap/AbstractBootstrap;"), locals = LocalCapture.CAPTURE_FAILHARD)
@Inject(method = "createNetworkManagerAndConnect", at = @At(value = "INVOKE", target = "Lio/netty/bootstrap/Bootstrap;group(Lio/netty/channel/EventLoopGroup;)Lio/netty/bootstrap/AbstractBootstrap;"), locals = LocalCapture.CAPTURE_FAILHARD)
private static void setTargetVersion(InetAddress address, int serverPort, boolean useNativeTransport, CallbackInfoReturnable<NetworkManager> cir, NetworkManager networkmanager, Class oclass, LazyLoadBase lazyloadbase) {
final VFNetworkManager mixinNetworkManager = (VFNetworkManager) networkmanager;
mixinNetworkManager.viaForge$setTrackedVersion(VersionTracker.getServerProtocolVersion(address));

View File

@ -45,7 +45,7 @@ public class MixinServerPinger {
viaForge$serverData = server;
}
@Redirect(method = "ping", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/NetworkManager;func_181124_a(Ljava/net/InetAddress;IZ)Lnet/minecraft/network/NetworkManager;"))
@Redirect(method = "ping", at = @At(value = "INVOKE", target = "Lnet/minecraft/network/NetworkManager;createNetworkManagerAndConnect(Ljava/net/InetAddress;IZ)Lnet/minecraft/network/NetworkManager;"))
public NetworkManager trackVersion(InetAddress address, int i, boolean b) {
ProtocolVersion version = ((ExtendedServerData) viaForge$serverData).viaForge$getVersion();
if (version == null) {
@ -54,7 +54,7 @@ public class MixinServerPinger {
VersionTracker.storeServerProtocolVersion(address, version);
viaForge$serverData = null;
return NetworkManager.func_181124_a(address, i, b);
return NetworkManager.createNetworkManagerAndConnect(address, i, b);
}
}

View File

@ -4,15 +4,11 @@
"name": "ViaForge",
"description": "Client-side Implementation of the Via* projects for Minecraft Forge",
"version": "${version}",
"mcversion": "[1.8]",
"mcversion": "[1.8.8,)",
"url": "https://github.com/ViaVersion/ViaForge",
"updateUrl": "",
"authorList": [
"FlorianMichael/EnZaXD"
],
"credits": "https://github.com/FlorianMichael/",
"logoFile": "",
"screenshots": [],
"dependencies": []
"credits": "https://github.com/FlorianMichael/"
}
]