Prevent players from placing blocks inside themselves

This commit is contained in:
2026-09-29 19:09:20 -03:00
parent f76cf2bf38
commit f0cf4e4eeb
5 changed files with 93 additions and 3 deletions
+6
View File
@@ -188,6 +188,12 @@ export class LocalPlayer extends Player {
}
}
// tells the server where it is right away, before something that depends on it like placing a block, so the
// server doesn't decide with where it was up to SEND_POSITION_TICKS ago
send_position_now() {
this.#send_position(true);
}
#send_position(now: boolean) {
this.#ticks_since_sent += 1;
if (!now && this.#ticks_since_sent < SEND_POSITION_TICKS) {