From a76d8448b76452a1652c7591ff36b8c777d69670 Mon Sep 17 00:00:00 2001 From: Spottedleaf Date: Sun, 2 Feb 2025 10:49:05 -0800 Subject: [PATCH] Reset stored movementThisTick on teleport This fixes a possible problem where later the server will try to apply movement to blocks which may be off-region. This also correctly adhere's to Vanillas behavior, which is to clear movementThisTick when teleporting. --- .../sources/net/minecraft/world/entity/Entity.java.patch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/folia-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch b/folia-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch index 9a46161..e29c603 100644 --- a/folia-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch +++ b/folia-server/minecraft-patches/sources/net/minecraft/world/entity/Entity.java.patch @@ -200,7 +200,7 @@ if (!this.level().paperConfig().scoreboards.allowNonPlayerEntitiesOnScoreboards && !(this instanceof Player)) { return null; } // Paper - Perf: Disable Scoreboards for non players by default return this.level().getScoreboard().getPlayersTeam(this.getScoreboardName()); } -@@ -3722,8 +_,789 @@ +@@ -3722,8 +_,791 @@ this.portalProcess = entity.portalProcess; } @@ -467,6 +467,8 @@ + // We add additional logic to reset these before teleporting to prevent issues with them possibly tripping thread checks. + protected void resetStoredPositions() { + this.mainSupportingBlockPos = Optional.empty(); ++ // this is copied from teleportSetPosition ++ this.movementThisTick.clear(); + } + + protected void teleportSyncSameRegion(Vec3 pos, Float yaw, Float pitch, Vec3 velocity) {