Skip to content

Commit

Permalink
✅ 代码调整
Browse files Browse the repository at this point in the history
  • Loading branch information
1024-byteeeee committed Mar 22, 2024
1 parent 9ccc5ae commit e20d709
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -30,22 +30,22 @@

public class BlockChunkLoaderHelper {
public static void loadChunk(ServerWorld world, ChunkPos chunkPos) {
BlockChunkLoaderHelper.addTicket(world, chunkPos);
addTicket(world, chunkPos);
if (AmsServerSettings.blockChunkLoaderKeepWorldTickUpdate) {
BlockChunkLoaderHelper.resetIdleTimeout(world);
resetIdleTimeout(world);
}
}

private static void addTicket(ServerWorld world, ChunkPos chunkPos) {
int loadTime = AmsServerSettings.blockChunkLoaderTimeController; // Default: 300gt
int loadRange = AmsServerSettings.blockChunkLoaderRangeController; // Default: 3x3
ChunkTicketType<ChunkPos> BLOCK_LOADER =
ChunkTicketType<ChunkPos> blockLoader =
ChunkTicketType.create(
"block_loader",
Comparator.comparingLong(ChunkPos::toLong),
loadTime
);
world.getChunkManager().addTicket(BLOCK_LOADER, chunkPos, loadRange, chunkPos);
world.getChunkManager().addTicket(blockLoader, chunkPos, loadRange, chunkPos);
}

private static void resetIdleTimeout(ServerWorld world) {
Expand Down

0 comments on commit e20d709

Please sign in to comment.