1
0
Fork 0
mirror of https://github.com/PaperMC/Paper.git synced 2025-04-12 08:57:39 +02:00

Set old position / rotation for newly created entities

Set the old pos/rot to be the same as the current pos/rot for new
entities as the default value for the old pos/rot is zero.

Fixes https://github.com/PaperMC/Folia/issues/302
This commit is contained in:
Spottedleaf 2025-03-08 06:33:29 -08:00
parent ce30016218
commit 4519857817

View file

@ -1072,6 +1072,14 @@
@Override
public CrashReportCategory fillReportDetails(CrashReport report) {
CrashReportCategory crashReportCategory = super.fillReportDetails(report);
@@ -1714,6 +_,7 @@
final class EntityCallbacks implements LevelCallback<Entity> {
@Override
public void onCreated(Entity entity) {
+ entity.setOldPosAndRot(); // Paper - update old pos / rot for new entities as it will default to Vec3.ZERO
}
@Override
@@ -1723,24 +_,32 @@
@Override