9
0
mirror of https://github.com/Xiao-MoMi/Custom-Crops.git synced 2025-12-29 11:59:15 +00:00

add an async option

This commit is contained in:
XiaoMoMi
2024-10-24 01:38:07 +08:00
parent c36996efa7
commit 0941070944
5 changed files with 12 additions and 3 deletions

View File

@@ -146,6 +146,7 @@ public class BukkitConfigManager extends ConfigManager {
worldeditSupport = config.getBoolean("other-settings.worldedit-support", false);
interveneAntiGrief = config.getBoolean("other-settings.intervene-anti-grief", false);
asyncWorldSaving = config.getBoolean("other-settings.async-world-saving", true);
offsets.clear();
Section section = config.getSection("mechanics.hologram-offset-correction");

View File

@@ -232,7 +232,7 @@ public class BukkitWorldManager implements WorldManager, Listener {
@EventHandler
public void onWorldSave(WorldSaveEvent event) {
final World world = event.getWorld();
getWorld(world).ifPresent(world1 -> world1.save(true, false));
getWorld(world).ifPresent(world1 -> world1.save(ConfigManager.asyncWorldSaving(), false));
}
@EventHandler (priority = EventPriority.HIGH)

View File

@@ -149,4 +149,6 @@ other-settings:
# Sometimes some anti-grief plugins are not supported by custom item plugins, but they are supported by CustomCrops
# If you enable this option, CustomCrops will also protect those unsupported anti-grief plugins
# Supported plugins can be found on https://github.com/Xiao-MoMi/AntiGriefLib/blob/main/README.md
intervene-anti-grief: false
intervene-anti-grief: false
# Decides whether the process of saving is async
async-world-saving: true