Collection<Chunk> chunks = world.getForceLoadedChunks(); have problem
This commit is contained in:
parent
9885c62232
commit
9f617e046e
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>EssentialsD</artifactId>
|
||||
<version>1.12.6</version>
|
||||
<version>1.12.8</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>EssentialsD</name>
|
||||
|
@ -47,17 +47,18 @@ public class ConfigManager {
|
||||
|
||||
public void ApplyForceLoadChunks() {
|
||||
// remove all force loaded chunks
|
||||
AtomicInteger count = new AtomicInteger();
|
||||
EssentialsD.globalScheduler.run(EssentialsD.instance, (instance) -> {
|
||||
int count = 0;
|
||||
for (World world : EssentialsD.instance.getServer().getWorlds()) {
|
||||
Collection<Chunk> chunks = world.getForceLoadedChunks();
|
||||
XLogger.debug("清除所有强加载区块: " + world.getName());
|
||||
Collection<Chunk> chunks = world.getForceLoadedChunks(); // todo 这里有问题
|
||||
for (Chunk chunk : chunks) {
|
||||
count.getAndIncrement();
|
||||
count++;
|
||||
world.setChunkForceLoaded(chunk.getX(), chunk.getZ(), false);
|
||||
}
|
||||
}
|
||||
XLogger.info("清除所有强加载区块: " + count);
|
||||
});
|
||||
XLogger.info("清除 " + count.get() + " 个强加载区块");
|
||||
// world:0:0
|
||||
for (String s : _force_load_chunks) {
|
||||
String[] split = s.split(":");
|
||||
|
Loading…
Reference in New Issue
Block a user