mirror of
https://github.com/Minestom/Minestom.git
synced 2025-02-15 11:51:53 +01:00
Optimize entity teleport, prevent movement packets from being sent with teleport ones
Signed-off-by: TheMode <themode@outlook.fr>
This commit is contained in:
parent
1d8addaea6
commit
93a62ba133
@ -242,8 +242,9 @@ public class Entity implements Viewable, Tickable, TagHandler, PermissionHandler
|
||||
public @NotNull CompletableFuture<Void> teleport(@NotNull Pos position, long @Nullable [] chunks) {
|
||||
Check.stateCondition(instance == null, "You need to use Entity#setInstance before teleporting an entity!");
|
||||
final Runnable endCallback = () -> {
|
||||
refreshPosition(position);
|
||||
previousPosition = position;
|
||||
this.position = position;
|
||||
this.previousPosition = position;
|
||||
refreshCoordinate(position);
|
||||
synchronizePosition(true);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user