Fixed 'sponge' module test errors

This commit is contained in:
Rsl1122 2019-03-31 14:04:06 +03:00
parent e835d61aef
commit abd6b04b8d
2 changed files with 12 additions and 4 deletions

View File

@ -5,7 +5,7 @@ dependencies {
compile "com.djrapitops:Extension-BanManager:5.15.0-R0.4"
compile "com.djrapitops:Extension-DiscordSRV:1.16.6-R0.2"
compile "com.djrapitops:Extension-EssentialsX:2.15.0-R0.3"
compile "com.djrapitops:Extension-Sponge-Economy:7.1.0-R0.1"
compile "com.djrapitops:Extension-Sponge-Economy:7.1.0-R0.2"
}
shadowJar {

View File

@ -79,12 +79,20 @@ public class SpongeListenerSystem extends ListenerSystem {
@Override
protected void unregisterListeners() {
Sponge.getEventManager().unregisterPluginListeners(plugin);
try {
Sponge.getEventManager().unregisterPluginListeners(plugin);
} catch (IllegalStateException ignore) {
/* Ignore, Sponge is not initialized */
}
}
@Override
public void callEnableEvent(PlanPlugin plugin) {
Event event = new PlanSpongeEnableEvent((PlanSponge) plugin);
Sponge.getEventManager().post(event);
try {
Event event = new PlanSpongeEnableEvent((PlanSponge) plugin);
Sponge.getEventManager().post(event);
} catch (IllegalStateException ignore) {
/* Ignore, Sponge is not initialized */
}
}
}