mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-29 19:41:47 +01:00
Do not retrieve all chunks when teleporting in the same chunk
This commit is contained in:
parent
f7753ab447
commit
59b4b7996d
@ -1631,7 +1631,9 @@ public class Player extends LivingEntity implements CommandSender {
|
||||
|
||||
@Override
|
||||
public void teleport(@NotNull Position position, @Nullable Runnable callback) {
|
||||
final long[] chunks = ChunkUtils.getChunksInRange(position, getChunkRange());
|
||||
final boolean sameChunk = getPosition().inSameChunk(position);
|
||||
final long[] chunks = sameChunk ? null :
|
||||
ChunkUtils.getChunksInRange(position, getChunkRange());
|
||||
teleport(position, chunks, callback);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user