Registered ViaVersion extension

This commit is contained in:
Rsl1122 2019-07-28 17:34:46 +03:00
parent cbfc2e9b3f
commit 710f8ec5bd
4 changed files with 21 additions and 1 deletions

View File

@ -27,6 +27,7 @@ import com.djrapitops.plan.system.database.DBSystem;
import com.djrapitops.plan.system.info.server.ServerInfo;
import com.djrapitops.plan.system.processing.Processing;
import com.djrapitops.plan.system.settings.config.PlanConfig;
import com.djrapitops.plugin.api.Check;
import com.djrapitops.plugin.logging.L;
import com.djrapitops.plugin.logging.console.PluginLogger;
import com.djrapitops.plugin.logging.error.ErrorHandler;
@ -82,6 +83,8 @@ public class ExtensionServiceImplementation implements ExtensionService {
public void register() {
extensionRegister.registerBuiltInExtensions();
if (Check.isBukkitAvailable()) extensionRegister.registerBukkitExtensions();
if (Check.isBungeeAvailable()) extensionRegister.registerBungeeExtensions();
}
@Override

View File

@ -144,8 +144,8 @@ public class PlanSystem implements SubSystem {
taskSystem,
hookHandler
);
extensionService.register();
queryService.register();
extensionService.register();
enabled = true;
}

View File

@ -17,6 +17,7 @@ dependencies {
compile "com.djrapitops:Extension-Sponge-Economy:7.1.0-R0.3"
compile "com.djrapitops:Extension-SuperbVote:0.5.4-R0.1"
compile "com.djrapitops:Extension-Vault:1.7-R0.2"
compile "com.djrapitops:Extension-ViaVersion:2.1.3-R0.3"
}
shadowJar {

View File

@ -60,6 +60,22 @@ public class ExtensionRegister {
new VaultExtensionFactory().createExtension().ifPresent(extensionService::register);
}
public void registerBukkitExtensions() {
// No need to catch exceptions here,
// registerBuiltInExtensions method will not be called unless Plan has enabled properly
ExtensionService extensionService = ExtensionService.getInstance();
new ViaVersionBukkitExtensionFactory().createExtension().ifPresent(extensionService::register);
}
public void registerBungeeExtensions() {
// No need to catch exceptions here,
// registerBuiltInExtensions method will not be called unless Plan has enabled properly
ExtensionService extensionService = ExtensionService.getInstance();
new ViaVersionBungeeExtensionFactory().createExtension().ifPresent(extensionService::register);
}
private void registerEssentialsExtension(ExtensionService extensionService) {
EssentialsExtensionFactory essentials = new EssentialsExtensionFactory();
essentials.createExtension()