mirror of
https://github.com/ViaVersion/ViaVersion.git
synced 2024-11-05 18:20:17 +01:00
Merge pull request #2052 from UnicraftNetwork/IOB-1.13-at-recipe-request-fix
Fix IOB in 1.13 recipe request
This commit is contained in:
commit
b6358cf83c
@ -826,7 +826,17 @@ public class Protocol1_13To1_12_2 extends Protocol<ClientboundPackets1_12_1, Cli
|
||||
@Override
|
||||
public void registerMap() {
|
||||
map(Type.BYTE); // Window id
|
||||
handler(wrapper -> wrapper.write(Type.VAR_INT, Integer.parseInt(wrapper.read(Type.STRING).substring(18))));
|
||||
|
||||
handler(wrapper -> {
|
||||
String s = wrapper.read(Type.STRING);
|
||||
Integer id;
|
||||
if (s.length() < 19 || (id = Ints.tryParse(s.substring(18))) == null) {
|
||||
wrapper.cancel();
|
||||
return;
|
||||
}
|
||||
|
||||
wrapper.write(Type.VAR_INT, id);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user