-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
服务器权威移动误判 #263
Comments
补充视频信息: 45733f6-32c-a414-ee74-eeaf87f102a3.mp4 |
set player.setCheckMovement(false); and cancel PlayerInvalidMoveEvent |
在 PlayerInvalidMoveEvent 之前有一个 可以看下面这段从 Player.java 摘录的片段。 protected void handleMovement(Vector3 clientPos) {
if (!this.isAlive() || !this.spawned || this.teleportPosition != null || this.isSleeping()) {
return;
}
boolean invalidMotion = false;
Location revertPos = this.getLocation().clone();
double distance = clientPos.distanceSquared(this);
if (!this.level.isChunkGenerated(clientPos.getChunkX(), clientPos.getChunkZ())) {
invalidMotion = true;
this.nextChunkOrderRun = 0;
} else if (distance > 128) {
invalidMotion = true;
getServer().getLogger().warning(String.format("%s moved too far (%.2f)", this.getName(), distance));
}
if (invalidMotion) {
this.revertClientMotion(revertPos);
return;
}
// more code... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
🐞 Bug Feedback | BUG反馈
📝 Bug Description | BUG描述
开启创造模式,快速的飞行。
服务器会出现此类警告:
且 server.properties 配置中的
server-authoritative-movement
项没有实际应用。即便从
server-auth
更改为client-auth
也无法关闭拉回。The text was updated successfully, but these errors were encountered: