Merge pull request #57 from FlorianMichael/main

Fixed 1.8 -> 1.7 update score translation
This commit is contained in:
RK_01 2024-01-12 23:43:56 +01:00 committed by GitHub
commit 92457695f2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1056,8 +1056,9 @@ public class Protocol1_8to1_7_6_10 extends AbstractProtocol<ClientboundPackets1_
@Override
public void register() {
map(Type.STRING); // name
map(Type.BYTE, Type.VAR_INT); // mode
handler(wrapper -> {
final byte mode = wrapper.passthrough(Type.BYTE); // mode
final int mode = wrapper.get(Type.VAR_INT, 0); // mode
if (mode == 0/*UPDATE*/) {
wrapper.passthrough(Type.STRING); // objective
wrapper.write(Type.VAR_INT, wrapper.read(Type.INT)); // score