Better handling on missing plugins.

This commit is contained in:
Tobias Ottenweller 2014-02-07 10:54:33 +01:00
parent 162921b934
commit 776c523bde
2 changed files with 7 additions and 3 deletions

View File

@ -1,8 +1,8 @@
name: ${project.name}
version: ${project.version}
description: A plugin to create gates for fast traveling.
depend: [Craft Inc. Gates, dynmap]
softdepend: [Craft Inc. Gates, dynmap]
author: tomco
website: FIXME
website: http://dev.bukkit.org/bukkit-plugins/craftinc-gates/
main: de.craftinc.gates.dynmap.Plugin
database: false

View File

@ -57,6 +57,7 @@ public class Plugin extends JavaPlugin implements GateChangeListener
super.onEnable();
if (!loadAPI()) {
Logger.log(Level.SEVERE, "Error while enabling! Stopping now!");
return;
}
@ -69,7 +70,10 @@ public class Plugin extends JavaPlugin implements GateChangeListener
@Override
public void onDisable()
{
if (this.gatesPlugin != null) {
this.gatesPlugin.getGatesManager().removeGateChangeListener(this);
}
super.onDisable();
}