mirror of
https://github.com/Minestom/Minestom.git
synced 2025-01-04 23:47:59 +01:00
hollow-cube/chunk-sending-rate-config
This commit is contained in:
parent
b572709a2d
commit
a981bd78ff
@ -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<TaskSchedule> 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 {
|
||||
|
@ -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() {
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user