Merge pull request #2993 from Multiverse/fix-binding

Fix binding plugin and bump MockBukkit
This commit is contained in:
Ben Woo 2023-09-06 23:33:11 +08:00 committed by GitHub
commit 12aedc1942
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 1 deletions

View File

@ -55,10 +55,16 @@ repositories {
name = 'glaremasters repo'
url = 'https://repo.glaremasters.me/repository/towny/'
}
maven {
name = 'PlaceholderAPI'
url = 'https://repo.extendedclip.com/content/repositories/placeholderapi/'
}
maven {
name = 'papermc repo'
url = 'https://repo.papermc.io/repository/maven-public/'
}
}
configurations {
@ -117,7 +123,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.19.2'
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);
}