Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-28 09:00:09 +01:00
Fix 1.20.2 -> 1.20.1 brand custom payloads properly (#3440)
Dieser Commit ist enthalten in:
Ursprung
f91e6a83f9
Commit
ed1852ba40
@ -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.ConfigurationState.BridgePhase;
|
||||||
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.LastResourcePack;
|
import com.viaversion.viaversion.protocols.protocol1_20_2to1_20.storage.LastResourcePack;
|
||||||
import com.viaversion.viaversion.rewriter.SoundRewriter;
|
import com.viaversion.viaversion.rewriter.SoundRewriter;
|
||||||
import java.util.UUID;
|
|
||||||
import org.checkerframework.checker.nullness.qual.Nullable;
|
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 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");
|
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 -> {
|
registerClientbound(ClientboundPackets1_19_4.PLUGIN_MESSAGE, wrapper -> {
|
||||||
final String channel = wrapper.passthrough(Type.STRING);
|
final String channel = wrapper.passthrough(Type.STRING);
|
||||||
if (channel.equals("minecraft:brand")) {
|
if (channel.equals("minecraft:brand")) {
|
||||||
final String brand = wrapper.passthrough(Type.STRING);
|
wrapper.passthrough(Type.STRING);
|
||||||
// TODO No idea what's going on here
|
wrapper.read(Type.REMAINING_BYTES);
|
||||||
if (!brand.matches("[a-zA-Z0-9]+")) {
|
}
|
||||||
wrapper.cancel();
|
});
|
||||||
}
|
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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren