Backport library and upstream updates to 1.20.4 (#407)

* Update Via* to 4.10.1

* Update ViaBedrock (1.20.80)

* Update gradle.properties

* Update ResourcePackHeaderDiff.java
This commit is contained in:
Howard ZHY 2024-05-06 02:20:43 +08:00 committed by GitHub
parent 8cead6bf4a
commit 0b89f00e6d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 9 additions and 79 deletions

View File

@ -16,13 +16,13 @@ ViaFabricPlus is a deep integration of ViaVersion on the Fabric platform, it imp
At the time of writing, VFP is the only protocol translation platform for the client with which you can play on all Minecraft multiplayer versions with many QoL features and get the feel of the old versions.
## Supported Server versions
- Release (1.0.0 - 1.20.5)
- Release (1.0.0 - 1.20.6)
- 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))
- April Fools (3D Shareware, 20w14infinite)
- Combat Snapshots (Combat Test 8c)
- Bedrock Edition 1.20.70 ([Some features are missing](https://github.com/RaphiMC/ViaBedrock#features))
- Bedrock Edition 1.20.80 ([Some features are missing](https://github.com/RaphiMC/ViaBedrock#features))
## For players
- Tutorial for installing and using the mod can be found [here](docs/USAGE.md)

View File

@ -14,16 +14,16 @@ maven_group=de.florianmichael
archives_base_name=ViaFabricPlus
# ViaVersion Libraries
viaversion_version=4.10.0
viabackwards_version=4.10.0
viaversion_version=4.10.1
viabackwards_version=4.10.1
vialegacy_version=2.2.22
viaaprilfools_version=2.0.11
viaaprilfools_version=2.0.12
vialoader_version=2.2.13
# RaphiMC Libraries
minecraftauth_version=4.0.0
viabedrock_version=0.0.6-SNAPSHOT
viabedrock_version=0.0.7-SNAPSHOT
raknet_transport_version=1.0.0.CR3-SNAPSHOT
# Lenni0451 Libraries

View File

@ -38,7 +38,7 @@ public class ResourcePackHeaderDiff {
private final static Map<ProtocolVersion, GameVersion> GAME_VERSION_DIFF = new HashMap<>();
static {
registerVersion(ProtocolVersion.v1_20_5, 32, "1.20.5");
registerVersion(ProtocolVersion.v1_20_5, 32, "1.20.6");
registerVersion(ProtocolVersion.v1_20_3, 22, "1.20.4");
registerVersion(ProtocolVersion.v1_20_2, 18, "1.20.2");
registerVersion(ProtocolVersion.v1_20, 15, "1.20.1");

View File

@ -40,14 +40,14 @@ public abstract class MixinJoinPackets {
return seed;
}
@Redirect(method = "lambda$register$8", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/packet/PacketWrapper;read(Lcom/viaversion/viaversion/api/type/Type;)Ljava/lang/Object;", ordinal = 55))
@Redirect(method = "lambda$register$8", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/packet/PacketWrapper;read(Lcom/viaversion/viaversion/api/type/Type;)Ljava/lang/Object;", ordinal = 56))
private static Object trackLevelId(PacketWrapper instance, Type<StringType> tType) throws Exception {
final Object levelId = instance.read(tType);
instance.user().get(JoinGameDataTracker.class).setLevelId((String) levelId);
return levelId;
}
@Redirect(method = "lambda$register$8", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/packet/PacketWrapper;read(Lcom/viaversion/viaversion/api/type/Type;)Ljava/lang/Object;", ordinal = 63))
@Redirect(method = "lambda$register$8", at = @At(value = "INVOKE", target = "Lcom/viaversion/viaversion/api/protocol/packet/PacketWrapper;read(Lcom/viaversion/viaversion/api/type/Type;)Ljava/lang/Object;", ordinal = 64))
private static Object trackEnchantmentSeed(PacketWrapper instance, Type<VarIntType> tType) throws Exception {
final Object enchantmentSeed = instance.read(tType);
instance.user().get(JoinGameDataTracker.class).setEnchantmentSeed((Integer) enchantmentSeed);

View File

@ -1,67 +0,0 @@
/*
* This file is part of ViaFabricPlus - https://github.com/FlorianMichael/ViaFabricPlus
* Copyright (C) 2021-2024 FlorianMichael/EnZaXD <florian.michael07@gmail.com> and RK_01/RaphiMC
* Copyright (C) 2023-2024 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 <http://www.gnu.org/licenses/>.
*/
package de.florianmichael.viafabricplus.protocoltranslator.impl.provider.viabedrock;
import com.viaversion.viaversion.api.connection.UserConnection;
import de.florianmichael.viafabricplus.settings.impl.BedrockSettings;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.gui.screen.ConfirmScreen;
import net.minecraft.client.gui.screen.TitleScreen;
import net.minecraft.client.gui.screen.multiplayer.ConnectScreen;
import net.minecraft.client.gui.screen.multiplayer.MultiplayerScreen;
import net.minecraft.client.network.ServerAddress;
import net.minecraft.client.network.ServerInfo;
import net.minecraft.text.Text;
import net.raphimc.viabedrock.protocol.providers.TransferProvider;
import java.net.InetSocketAddress;
public class ViaFabricPlusTransferProvider extends TransferProvider {
@Override
public void connectToServer(UserConnection user, InetSocketAddress newAddress) {
final var mc = MinecraftClient.getInstance();
mc.execute(() -> {
if (BedrockSettings.global().openPromptGUIToConfirmTransfer.getValue()) {
mc.setScreen(new ConfirmScreen((bl) -> {
if (bl) {
connect(newAddress);
} else {
mc.setScreen(null);
}
},
Text.of("ViaFabricPlus"),
Text.translatable("bedrock.viafabricplus.confirm_transfer_server_prompt", newAddress.getHostName() + ":" + newAddress.getPort())
));
} else {
connect(newAddress);
}
});
}
private void connect(final InetSocketAddress newAddress) {
final var mc = MinecraftClient.getInstance();
mc.world.disconnect();
final var serverInfo = new ServerInfo(newAddress.getHostName(), newAddress.getHostName() + ":" + newAddress.getPort(), ServerInfo.ServerType.OTHER);
ConnectScreen.connect(new MultiplayerScreen(new TitleScreen()), mc, ServerAddress.parse(serverInfo.address), serverInfo, false);
}
}

View File

@ -28,12 +28,10 @@ import com.viaversion.viaversion.protocols.protocol1_16to1_15_2.provider.PlayerA
import com.viaversion.viaversion.protocols.protocol1_19to1_18_2.provider.AckSequenceProvider;
import com.viaversion.viaversion.protocols.protocol1_9to1_8.providers.HandItemProvider;
import de.florianmichael.viafabricplus.protocoltranslator.impl.provider.viabedrock.ViaFabricPlusNettyPipelineProvider;
import de.florianmichael.viafabricplus.protocoltranslator.impl.provider.viabedrock.ViaFabricPlusTransferProvider;
import de.florianmichael.viafabricplus.protocoltranslator.impl.provider.vialegacy.*;
import de.florianmichael.viafabricplus.protocoltranslator.impl.provider.viaversion.*;
import de.florianmichael.viafabricplus.settings.impl.GeneralSettings;
import net.raphimc.viabedrock.protocol.providers.NettyPipelineProvider;
import net.raphimc.viabedrock.protocol.providers.TransferProvider;
import net.raphimc.vialegacy.protocols.alpha.protocolb1_0_1_1_1toa1_2_3_5_1_2_6.providers.AlphaInventoryProvider;
import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicMPPassProvider;
import net.raphimc.vialegacy.protocols.classic.protocola1_0_15toc0_28_30.providers.ClassicWorldHeightProvider;
@ -68,7 +66,6 @@ public class ViaFabricPlusVLLoader extends VLLoader {
}
providers.use(NettyPipelineProvider.class, new ViaFabricPlusNettyPipelineProvider());
providers.use(TransferProvider.class, new ViaFabricPlusTransferProvider());
}
}