mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-12-23 08:57:39 +01:00
Clear input buffer instead of reading remaining bytes (#3471)
This commit is contained in:
parent
868c5ba203
commit
0c3d709456
@ -49,9 +49,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");
|
||||
@ -75,14 +76,14 @@ public final class Protocol1_20_2To1_20 extends AbstractProtocol<ClientboundPack
|
||||
final String channel = wrapper.passthrough(Type.STRING);
|
||||
if (channel.equals("minecraft:brand")) {
|
||||
wrapper.passthrough(Type.STRING);
|
||||
wrapper.read(Type.REMAINING_BYTES);
|
||||
wrapper.clearInputBuffer();
|
||||
}
|
||||
});
|
||||
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);
|
||||
wrapper.clearInputBuffer();
|
||||
}
|
||||
});
|
||||
|
||||
|
@ -268,10 +268,9 @@ public class PlayerPackets {
|
||||
handler(wrapper -> {
|
||||
String name = wrapper.get(Type.STRING, 0);
|
||||
if (name.equalsIgnoreCase("MC|BOpen")) {
|
||||
wrapper.read(Type.REMAINING_BYTES); // Not used anymore
|
||||
wrapper.clearInputBuffer();
|
||||
wrapper.write(Type.VAR_INT, 0);
|
||||
}
|
||||
if (name.equalsIgnoreCase("MC|TrList")) {
|
||||
} else if (name.equalsIgnoreCase("MC|TrList")) {
|
||||
wrapper.passthrough(Type.INT); // ID
|
||||
|
||||
Short size = wrapper.passthrough(Type.UNSIGNED_BYTE);
|
||||
|
Loading…
Reference in New Issue
Block a user