mirror of
https://github.com/EssentialsX/Essentials.git
synced 2024-08-26 07:22:56 +02:00
Added event handling to manage new world creation at runtime.
This commit is contained in:
parent
1f6daa7424
commit
d2c02569d0
|
@ -31,4 +31,5 @@ v 1.2:
|
|||
(one op will not be able to alter another op's settings)
|
||||
- GM will now create all relevant world data files for non mirrored worlds.
|
||||
(for all worlds named in config.yml)
|
||||
- Attempt to stop GM wiping groups/users yml's on a bad shut down.
|
||||
- Attempt to stop GM wiping groups/users yml's on a bad shut down.
|
||||
- Added event handling to manage new world creation at runtime.
|
|
@ -24,6 +24,7 @@ import java.util.concurrent.TimeUnit;
|
|||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import org.anjocaido.groupmanager.dataholder.worlds.WorldsHolder;
|
||||
import org.anjocaido.groupmanager.events.GMWorldListener;
|
||||
import org.anjocaido.groupmanager.utils.GMLoggerHandler;
|
||||
import org.anjocaido.groupmanager.utils.PermissionCheckResult;
|
||||
import org.anjocaido.groupmanager.utils.Tasks;
|
||||
|
@ -32,9 +33,12 @@ import org.bukkit.command.Command;
|
|||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.command.ConsoleCommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.Event;
|
||||
import org.bukkit.event.world.WorldListener;
|
||||
import org.bukkit.plugin.PluginDescriptionFile;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
/**
|
||||
*
|
||||
|
@ -55,6 +59,7 @@ public class GroupManager extends JavaPlugin {
|
|||
private GMConfiguration config;
|
||||
private GMLoggerHandler ch;
|
||||
public static BukkitPermissions BukkitPermissions;
|
||||
private WorldListener WorldEvents;
|
||||
public static final Logger logger = Logger.getLogger(GroupManager.class.getName());
|
||||
|
||||
//PERMISSIONS FOR COMMAND BEING LOADED
|
||||
|
@ -94,8 +99,12 @@ public class GroupManager extends JavaPlugin {
|
|||
throw new IllegalStateException("An error ocurred while loading GroupManager");
|
||||
}
|
||||
|
||||
// Setup the world listener and bukkit permissions to handle events.
|
||||
WorldEvents = new GMWorldListener(this);
|
||||
BukkitPermissions = new BukkitPermissions(this);
|
||||
|
||||
|
||||
this.getServer().getPluginManager().registerEvent(Event.Type.WORLD_INIT, WorldEvents, Event.Priority.Lowest, this);
|
||||
|
||||
enableScheduler();
|
||||
|
||||
/*
|
||||
|
@ -111,6 +120,8 @@ public class GroupManager extends JavaPlugin {
|
|||
//setLoaded(true);
|
||||
System.out.println(pdfFile.getName() + " version " + pdfFile.getVersion() + " is enabled!");
|
||||
}
|
||||
|
||||
|
||||
|
||||
public static boolean isLoaded() {
|
||||
return isLoaded;
|
||||
|
|
|
@ -22,7 +22,6 @@ import org.anjocaido.groupmanager.dataholder.OverloadedWorldHolder;
|
|||
import org.anjocaido.groupmanager.permissions.AnjoPermissionsHandler;
|
||||
import org.anjocaido.groupmanager.utils.Tasks;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.util.config.ConfigurationNode;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -275,7 +274,7 @@ public class WorldsHolder {
|
|||
|
||||
}
|
||||
|
||||
private void setupWorldFolder(String worldName) {
|
||||
public void setupWorldFolder(String worldName) {
|
||||
worldsFolder = new File(plugin.getDataFolder(), "worlds");
|
||||
if (!worldsFolder.exists()) {
|
||||
worldsFolder.mkdirs();
|
||||
|
|
Loading…
Reference in New Issue
Block a user