TCheckpoint
This commit is contained in:
parent
2845cc512f
commit
c5b686aeb5
55 changed files with 453 additions and 213 deletions
|
|
@ -1,12 +1,18 @@
|
|||
package org.gsdistance.grimmsServer.Indexers;
|
||||
|
||||
import com.google.common.base.Stopwatch;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.WorldCreator;
|
||||
import org.bukkit.WorldType;
|
||||
import org.gsdistance.grimmsServer.Config.ConfigKey;
|
||||
import org.gsdistance.grimmsServer.Constructable.WorldConstructor;
|
||||
import org.gsdistance.grimmsServer.GrimmsServer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import static org.gsdistance.grimmsServer.Config.ActiveConfig.getConfigValue;
|
||||
|
||||
public class DynamicDimensionGen {
|
||||
public static void newDimension(WorldConstructor worldConstructor) {
|
||||
GrimmsServer.logger.info("Creating new world: " + worldConstructor.name() + " with type: " + worldConstructor.type());
|
||||
|
|
@ -47,4 +53,19 @@ public class DynamicDimensionGen {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void unLoadWorlds(){
|
||||
Stopwatch sw = Stopwatch.createStarted();
|
||||
GrimmsServer.logger.info("Unloading worlds...");
|
||||
for (String worldName : (List<String>)getConfigValue(ConfigKey.DISABLED_DIMENSIONS, List.class)){
|
||||
World world = Bukkit.getWorld(worldName);
|
||||
if (world != null) {
|
||||
GrimmsServer.logger.info("Unloading world: " + worldName);
|
||||
Bukkit.unloadWorld(world, false);
|
||||
} else {
|
||||
GrimmsServer.logger.warning("World with name '" + worldName + "' does not exist or is already unloaded.");
|
||||
}
|
||||
}
|
||||
GrimmsServer.logger.info("Unloaded worlds (" + sw.stop() + ")");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue