3
0
Mirror von https://github.com/ViaVersion/ViaVersion.git synchronisiert 2024-12-27 16:40:10 +01:00

Fix 1.20.2 -> 1.20.1 brand custom payloads properly (#3440)

Dieser Commit ist enthalten in:
RK_01 2023-09-25 00:52:17 +02:00 committet von GitHub
Ursprung f91e6a83f9
Commit ed1852ba40
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23

Datei anzeigen

@ -48,9 +48,10 @@ import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.Configur
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.ConfigurationState.BridgePhase;
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.LastResourcePack;
import com.viaversion.viaversion.rewriter.SoundRewriter;
import java.util.UUID;
import org.checkerframework.checker.nullness.qual.Nullable;
import java.util.UUID;
public final class Protocol1_20_2To1_20 extends AbstractProtocol<ClientboundPackets1_19_4, ClientboundPackets1_20_2, ServerboundPackets1_19_4, ServerboundPackets1_20_2> {
public static final MappingData MAPPINGS = new MappingDataBase("1.20", "1.20.2");
@ -73,11 +74,15 @@ public final class Protocol1_20_2To1_20 extends AbstractProtocol<ClientboundPack
registerClientbound(ClientboundPackets1_19_4.PLUGIN_MESSAGE, wrapper -> {
final String channel = wrapper.passthrough(Type.STRING);
if (channel.equals("minecraft:brand")) {
final String brand = wrapper.passthrough(Type.STRING);
// TODO No idea what's going on here
if (!brand.matches("[a-zA-Z0-9]+")) {
wrapper.cancel();
wrapper.passthrough(Type.STRING);
wrapper.read(Type.REMAINING_BYTES);
}
});
registerServerbound(ServerboundPackets1_20_2.PLUGIN_MESSAGE, wrapper -> {
final String channel = wrapper.passthrough(Type.STRING);
if (channel.equals("minecraft:brand")) {
wrapper.passthrough(Type.STRING);
wrapper.read(Type.REMAINING_BYTES);
}
});