diff --git a/src/main/java/net/minestom/server/entity/Player.java b/src/main/java/net/minestom/server/entity/Player.java index cd7bf6433..d8a5426e3 100644 --- a/src/main/java/net/minestom/server/entity/Player.java +++ b/src/main/java/net/minestom/server/entity/Player.java @@ -706,14 +706,14 @@ public class Player extends LivingEntity implements CommandSender, Localizable, (x, z) -> chunkQueue.add(ChunkUtils.getChunkIndex(x, z))); var iter = chunkQueue.iterator(); Supplier taskRunnable = () -> { - for (int i = 0; i < 50; i++) { + for (int i = 0; i < ChunkUtils.NEW_CHUNK_COUNT_PER_INTERVAL; i++) { if (!iter.hasNext()) return TaskSchedule.stop(); var next = iter.nextLong(); chunkAdder.accept(ChunkUtils.getChunkCoordX(next), ChunkUtils.getChunkCoordZ(next)); } - return TaskSchedule.tick(20); + return TaskSchedule.tick(ChunkUtils.NEW_CHUNK_SEND_INTERVAL); }; scheduler().submitTask(taskRunnable); } else { diff --git a/src/main/java/net/minestom/server/utils/chunk/ChunkUtils.java b/src/main/java/net/minestom/server/utils/chunk/ChunkUtils.java index e5a03af9e..67d5bfa77 100644 --- a/src/main/java/net/minestom/server/utils/chunk/ChunkUtils.java +++ b/src/main/java/net/minestom/server/utils/chunk/ChunkUtils.java @@ -17,6 +17,8 @@ import java.util.function.Consumer; public final class ChunkUtils { public static final boolean USE_NEW_CHUNK_SENDING = Boolean.getBoolean("minestom.use-new-chunk-sending"); + public static final int NEW_CHUNK_COUNT_PER_INTERVAL = Integer.getInteger("minestom.new-chunk-sending-count-per-interval", 50); + public static final int NEW_CHUNK_SEND_INTERVAL = Integer.getInteger("minestom.new-chunk-sending-send-interval", 20); private ChunkUtils() { }