mirror of
https://github.com/Xiao-MoMi/Custom-Crops.git
synced 2025-12-27 19:09:09 +00:00
3.6.17
This commit is contained in:
@@ -194,9 +194,10 @@ public interface CustomCropsWorld<W> {
|
||||
/**
|
||||
* Saves the world data to a file.
|
||||
*
|
||||
* @param async async or not
|
||||
* @param async async or not
|
||||
* @param disabling is the server disabled
|
||||
*/
|
||||
void save(boolean async);
|
||||
void save(boolean async, boolean disabling);
|
||||
|
||||
/**
|
||||
* Sets whether the ticking task is ongoing.
|
||||
|
||||
@@ -186,11 +186,15 @@ public class CustomCropsWorldImpl<W> implements CustomCropsWorld<W> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void save(boolean async) {
|
||||
if (async) {
|
||||
public void save(boolean async, boolean disabling) {
|
||||
if (async && !disabling) {
|
||||
this.scheduler.async().execute(this::save);
|
||||
} else {
|
||||
BukkitCustomCropsPlugin.getInstance().getScheduler().sync().run(this::save, null);
|
||||
if (disabling) {
|
||||
save();
|
||||
} else {
|
||||
BukkitCustomCropsPlugin.getInstance().getScheduler().sync().run(this::save, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -66,10 +66,11 @@ public interface WorldManager extends Reloadable {
|
||||
/**
|
||||
* Unloads the CustomCrops world associated with the specified Bukkit world.
|
||||
*
|
||||
* @param world The Bukkit world to unload.
|
||||
* @param world The Bukkit world to unload.
|
||||
* @param disabling
|
||||
* @return True if the world was successfully unloaded, false otherwise.
|
||||
*/
|
||||
boolean unloadWorld(World world);
|
||||
boolean unloadWorld(World world, boolean disabling);
|
||||
|
||||
/**
|
||||
* Retrieves a CustomCrops world based on the specified Bukkit world, if loaded.
|
||||
|
||||
@@ -129,7 +129,7 @@ public abstract class AbstractRequirementManager<T> implements RequirementManage
|
||||
if (inner != null) {
|
||||
requirements.add(parseRequirement(inner, runActions));
|
||||
} else {
|
||||
plugin.getPluginLogger().warn("Section " + typeOrName + " is misconfigured");
|
||||
plugin.getPluginLogger().warn("Section " + section.getRouteAsString() + "." + typeOrName + " is misconfigured");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user