Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
Cancel block change packets for removed actions
Dieser Commit ist enthalten in:
Ursprung
d58959fcca
Commit
9c81ba368f
@ -31,7 +31,17 @@ public class BlockRewriter {
|
|||||||
map(Type.UNSIGNED_BYTE); // Action id
|
map(Type.UNSIGNED_BYTE); // Action id
|
||||||
map(Type.UNSIGNED_BYTE); // Action param
|
map(Type.UNSIGNED_BYTE); // Action param
|
||||||
map(Type.VAR_INT); // Block id - /!\ NOT BLOCK STATE
|
map(Type.VAR_INT); // Block id - /!\ NOT BLOCK STATE
|
||||||
handler(wrapper -> wrapper.set(Type.VAR_INT, 0, blockRewriter.rewrite(wrapper.get(Type.VAR_INT, 0))));
|
handler(wrapper -> {
|
||||||
|
int id = wrapper.get(Type.VAR_INT, 0);
|
||||||
|
int mappedId = blockRewriter.rewrite(id);
|
||||||
|
if (mappedId == -1) {
|
||||||
|
// Block (action) has been removed
|
||||||
|
wrapper.cancel();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
wrapper.set(Type.VAR_INT, 0, mappedId);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren