mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2024-08-21 10:52:01 +00:00
Added the ability to handle unknown worlds at server start.
(GM will create the data files for any worlds it finds which are not in the config.yml)
This commit is contained in:
parent
0e867df195
commit
3030093907
|
@ -33,3 +33,5 @@ v 1.2:
|
|||
(for all worlds named in config.yml)
|
||||
- Attempt to stop GM wiping groups/users yml's on a bad shut down.
|
||||
- Added event handling to manage new world creation at runtime.
|
||||
- Added the ability to handle unknown worlds at server start.
|
||||
(GM will create the data files for any worlds it finds which are not in the config.yml)
|
|
@ -21,6 +21,7 @@ import org.anjocaido.groupmanager.dataholder.WorldDataHolder;
|
|||
import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder;
|
||||
import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler;
|
||||
import org.anjocaido.groupmanager.utils.Tasks;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
/**
|
||||
|
@ -70,20 +71,38 @@ public class WorldsHolder {
|
|||
}
|
||||
|
||||
private void initialWorldLoading() {
|
||||
//LOAD EVERY WORLD POSSIBLE
|
||||
//Load the default world
|
||||
loadWorld(serverDefaultWorldName);
|
||||
defaultWorld = worldsData.get(serverDefaultWorldName);
|
||||
}
|
||||
|
||||
private void loadAllSearchedWorlds() {
|
||||
|
||||
/*
|
||||
* Read all known worlds from Bukkit
|
||||
* Create the data files if they don't already exist,
|
||||
* and they are not mirrored.
|
||||
*/
|
||||
for (World world: plugin.getServer().getWorlds())
|
||||
if ((!worldsData.containsKey(world.getName().toLowerCase()))
|
||||
&& (!mirrors.containsKey(world.getName().toLowerCase())))
|
||||
setupWorldFolder(world.getName());
|
||||
/*
|
||||
* Loop over all folders within the worlds folder
|
||||
* and attempt to load the world data
|
||||
*/
|
||||
for (File folder : worldsFolder.listFiles()) {
|
||||
if (folder.isDirectory())
|
||||
if (folder.isDirectory()) {
|
||||
GroupManager.logger.info("World Found: " + folder.getName());
|
||||
|
||||
if (worldsData.containsKey(folder.getName().toLowerCase())) {
|
||||
/*
|
||||
* don't load any worlds which are already loaded
|
||||
* or mirrored worlds that don't need data.
|
||||
*/
|
||||
if (worldsData.containsKey(folder.getName().toLowerCase())
|
||||
|| mirrors.containsKey(folder.getName().toLowerCase())) {
|
||||
continue;
|
||||
}
|
||||
if (folder.isDirectory()) {
|
||||
loadWorld(folder.getName());
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue