Fix binding plugin and bump MockBukkit

This commit is contained in:
Ben Woo 2023-09-06 23:07:16 +08:00
parent ec0000bc8a
commit 7246d433bc
No known key found for this signature in database
GPG Key ID: FB2A3645536E12C8
3 changed files with 6 additions and 1 deletions

View File

@ -117,7 +117,7 @@ dependencies {
// Tests
testImplementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.10'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.19:2.141.0'
testImplementation 'com.github.seeseemelk:MockBukkit-v1.20:3.20.0'
testImplementation('com.googlecode.json-simple:json-simple:1.1.1') {
exclude group: 'junit', module: 'junit'
}

View File

@ -151,6 +151,10 @@ public class MultiverseCore extends JavaPlugin implements MVCore {
*/
@Override
public void onDisable() {
if (serviceLocator == null) {
// TODO: This is a workaround while waiting for MockBukkit to fix their onDisable being called twice
return;
}
this.saveAllConfigs();
shutdownDependencyInjection();
Logging.shutdown();

View File

@ -30,6 +30,7 @@ public abstract class PluginBinder<T extends Plugin> extends AbstractBinder {
protected final void configure() {
var bindingBuilder = bindPlugin(getPlugin());
bindingBuilder.to(Plugin.class);
bindPluginClass(bindingBuilder);
bind(plugin.getLogger()).to(Logger.class);
}