clear force load chunks before load
Some checks failed
Java CI-CD with Maven / build (push) Failing after 1h5m27s
Some checks failed
Java CI-CD with Maven / build (push) Failing after 1h5m27s
This commit is contained in:
parent
7d673906cf
commit
f97823af79
2
pom.xml
2
pom.xml
@ -6,7 +6,7 @@
|
||||
|
||||
<groupId>cn.lunadeer</groupId>
|
||||
<artifactId>EssentialsD</artifactId>
|
||||
<version>1.12.1</version>
|
||||
<version>1.12.2</version>
|
||||
<packaging>jar</packaging>
|
||||
|
||||
<name>EssentialsD</name>
|
||||
|
@ -5,6 +5,7 @@ import org.bukkit.World;
|
||||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.concurrent.atomic.AtomicInteger;
|
||||
|
||||
public class ConfigManager {
|
||||
public ConfigManager(EssentialsD plugin) {
|
||||
@ -43,6 +44,17 @@ public class ConfigManager {
|
||||
}
|
||||
|
||||
public void ApplyForceLoadChunks() {
|
||||
// remove all force loaded chunks
|
||||
AtomicInteger count = new AtomicInteger();
|
||||
for (World world : _plugin.getServer().getWorlds()) {
|
||||
world.getForceLoadedChunks().forEach((chunk) -> {
|
||||
count.getAndIncrement();
|
||||
EssentialsD.globalScheduler.run(EssentialsD.instance, (instance) -> {
|
||||
world.setChunkForceLoaded(chunk.getX(), chunk.getZ(), false);
|
||||
});
|
||||
});
|
||||
}
|
||||
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