mirror of
https://github.com/Minestom/Minestom.git
synced 2024-09-28 22:47:41 +02: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) {
|
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!");
|
Check.stateCondition(instance == null, "You need to use Entity#setInstance before teleporting an entity!");
|
||||||
final Runnable endCallback = () -> {
|
final Runnable endCallback = () -> {
|
||||||
refreshPosition(position);
|
this.position = position;
|
||||||
previousPosition = position;
|
this.previousPosition = position;
|
||||||
|
refreshCoordinate(position);
|
||||||
synchronizePosition(true);
|
synchronizePosition(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user