mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-10-05 01:57:28 +02:00
Updated WorldGuard to catch a missing WorldEdit.
This commit is contained in:
parent
44fc802e8b
commit
d1cb628473
@ -45,7 +45,14 @@ public class WorldGuard extends Plugin {
|
|||||||
* Initialize the plugin.
|
* Initialize the plugin.
|
||||||
*/
|
*/
|
||||||
public WorldGuard() {
|
public WorldGuard() {
|
||||||
listener = new WorldGuardListener(this);
|
try {
|
||||||
|
listener = new WorldGuardListener(this);
|
||||||
|
} catch (NoClassDefFoundError e) {
|
||||||
|
logger.severe("*** WORLDGUARD FAILED TO LOAD. ALL PROTECTION IS DISABLED!");
|
||||||
|
logger.severe("*** YOUR SERVER WILL BE SAVED AND STOPPED TO PREVENT DAMAGE TO YOUR WORLD. DISABLE WORLDGUARD OR CORRECT THE PROBLEM.");
|
||||||
|
logger.severe("*** WorldEdit must be placed into the plugins/ directory");
|
||||||
|
etc.getServer().useConsoleCommand("stop");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -53,6 +60,10 @@ public WorldGuard() {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void initialize() {
|
public void initialize() {
|
||||||
|
if (listener == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
List<String> missingFeatures = new ArrayList<String>();
|
List<String> missingFeatures = new ArrayList<String>();
|
||||||
|
|
||||||
registerHook("COMMAND", PluginListener.Priority.MEDIUM);
|
registerHook("COMMAND", PluginListener.Priority.MEDIUM);
|
||||||
@ -110,6 +121,10 @@ public boolean registerHook(String name, PluginListener.Priority priority) {
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void enable() {
|
public void enable() {
|
||||||
|
if (listener == null) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
logger.log(Level.INFO, "WorldGuard version " + getVersion() + " loaded");
|
logger.log(Level.INFO, "WorldGuard version " + getVersion() + " loaded");
|
||||||
listener.loadConfiguration();
|
listener.loadConfiguration();
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user