mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-22 18:15:39 +01:00
Fix 1.20.2 -> 1.20.1 brand custom payloads properly (#3440)
This commit is contained in:
parent
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);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -298,4 +303,4 @@ public final class Protocol1_20_2To1_20 extends AbstractProtocol<ClientboundPack
|
|||||||
public ItemRewriter<Protocol1_20_2To1_20> getItemRewriter() {
|
public ItemRewriter<Protocol1_20_2To1_20> getItemRewriter() {
|
||||||
return itemPacketRewriter;
|
return itemPacketRewriter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user