Updated Via*

This commit is contained in:
FlorianMichael 2023-04-05 18:47:42 +02:00
parent 679495bb0e
commit 28ce2ebc32
5 changed files with 10 additions and 6 deletions

View File

@ -70,7 +70,7 @@ It should work fine with most if not all mods and modpacks.
- ***[Krypton](https://github.com/astei/krypton)***
## Supported Server versions
- Release (1.0.0 - 1.20 [23w13a])
- Release (1.0.0 - 1.20 [23w14a])
- Beta (b1.0 - b1.8.1)
- Alpha (a1.0.15 - a1.2.6)
- Classic (c0.0.15 - c0.30 including [CPE](https://wiki.vg/Classic_Protocol_Extension))

View File

@ -18,8 +18,8 @@ vialoadingbase_version=ae89fec4ab
raknet_transport_version=1.0.0.CR1-SNAPSHOT
# viaversion (and required) libs
viaversion_version=4.7.0-23w13a-SNAPSHOT
viabackwards_version=4.7.0-23w13a-SNAPSHOT
viaversion_version=4.7.0-23w14a-SNAPSHOT
viabackwards_version=4.7.0-23w14a-SNAPSHOT
snake_yml_version=2.0
# raphimc libs

View File

@ -44,7 +44,7 @@ public class MixinAddServerScreen extends Screen {
@Inject(method = "init", at = @At("RETURN"))
public void injectButton(CallbackInfo ci) {
final ComparableProtocolVersion forcedVersion = ((IServerInfo) server).viafabricplus_forcedVersion();
this.addDrawableChild(ButtonWidget.builder(Text.literal(forcedVersion == null ? "Set version for this server" :forcedVersion.getName()), button ->
this.addDrawableChild(ButtonWidget.builder(Text.literal(forcedVersion == null ? "Set version for this server" : forcedVersion.getName()), button ->
client.setScreen(new ForceVersionScreen(this, version -> ((IServerInfo) server).viafabricplus_forceVersion(version)))).
position(width - (forcedVersion == null ? 150 : 98) - 5, 5).size(forcedVersion == null ? 150 : 98, 20).build());
}

View File

@ -59,7 +59,11 @@ public class MixinServerInfo implements IServerInfo {
@Inject(method = "fromNbt", at = @At("TAIL"), locals = LocalCapture.CAPTURE_FAILHARD)
private static void loadForcedVersion(NbtCompound root, CallbackInfoReturnable<ServerInfo> cir, ServerInfo serverInfo) {
if (root.contains("viafabricplus_forcedversion")) {
((IServerInfo) serverInfo).viafabricplus_forceVersion(ViaLoadingBase.fromProtocolId(root.getInt("viafabricplus_forcedversion")));
try {
((IServerInfo) serverInfo).viafabricplus_forceVersion(ViaLoadingBase.fromProtocolId(root.getInt("viafabricplus_forcedversion")));
} catch (Exception ignored) {
// Version doesn't exist anymore
}
}
}

View File

@ -45,7 +45,7 @@ public abstract class MixinProtocolVersion {
viafabricplus_remaps.put("1.16.4/5", new Pair<>("1.16.4-1.16.5", null));
viafabricplus_remaps.put("1.18/1.18.1", new Pair<>("1.18-1.18.1", null));
viafabricplus_remaps.put("1.19.1/2", new Pair<>("1.19.1-1.19.2", null));
viafabricplus_remaps.put("1.20", new Pair<>("23w13a", null));
viafabricplus_remaps.put("1.20", new Pair<>("23w14a", null));
}
@Redirect(method = "<clinit>", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/version/ProtocolVersion;register(ILjava/lang/String;)Lcom/viaversion/viaversion/api/protocol/version/ProtocolVersion;"))