mirror of
https://github.com/plan-player-analytics/Plan.git
synced 2024-12-27 03:27:37 +01:00
Registered NucleusExtension
This commit is contained in:
parent
f172c88321
commit
64e26aa84d
@ -12,6 +12,7 @@ dependencies {
|
|||||||
compile "com.djrapitops:Extension-GriefPreventionPlus:13.3-R0.1"
|
compile "com.djrapitops:Extension-GriefPreventionPlus:13.3-R0.1"
|
||||||
compile "com.djrapitops:Extension-McMMO:2.1.44-R0.1"
|
compile "com.djrapitops:Extension-McMMO:2.1.44-R0.1"
|
||||||
compile 'com.djrapitops:Extension-MinigamesLib:1.14.17-R0.1'
|
compile 'com.djrapitops:Extension-MinigamesLib:1.14.17-R0.1'
|
||||||
|
compile 'com.djrapitops:Extension-Nucleus:1.9.2-R0.1'
|
||||||
compile "com.djrapitops:Extension-Sponge-Economy:7.1.0-R0.2"
|
compile "com.djrapitops:Extension-Sponge-Economy:7.1.0-R0.2"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -22,7 +22,6 @@ import com.djrapitops.plan.extension.ExtensionService;
|
|||||||
|
|
||||||
import javax.inject.Inject;
|
import javax.inject.Inject;
|
||||||
import javax.inject.Singleton;
|
import javax.inject.Singleton;
|
||||||
import java.util.function.Function;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* In charge of registering built in {@link com.djrapitops.plan.extension.DataExtension} implementations.
|
* In charge of registering built in {@link com.djrapitops.plan.extension.DataExtension} implementations.
|
||||||
@ -48,22 +47,27 @@ public class ExtensionRegister {
|
|||||||
new BanManagerExtensionFactory().createExtension().ifPresent(extensionService::register);
|
new BanManagerExtensionFactory().createExtension().ifPresent(extensionService::register);
|
||||||
new CoreProtectExtensionFactory().createExtension().ifPresent(extensionService::register);
|
new CoreProtectExtensionFactory().createExtension().ifPresent(extensionService::register);
|
||||||
new DiscordSRVExtensionFactory().createExtension().ifPresent(extensionService::register);
|
new DiscordSRVExtensionFactory().createExtension().ifPresent(extensionService::register);
|
||||||
|
registerEssentialsExtension(extensionService);
|
||||||
EssentialsExtensionFactory essentials = new EssentialsExtensionFactory();
|
|
||||||
essentials.createExtension()
|
|
||||||
.map(extensionService::register).flatMap(Function.identity()) // If the extension was registered this is present.
|
|
||||||
.ifPresent(essentials::registerUpdateListeners);
|
|
||||||
|
|
||||||
new GriefPreventionExtensionFactory().createExtension().ifPresent(extensionService::register);
|
new GriefPreventionExtensionFactory().createExtension().ifPresent(extensionService::register);
|
||||||
new GriefPreventionSpongeExtensionFactory().createExtension().ifPresent(extensionService::register);
|
new GriefPreventionSpongeExtensionFactory().createExtension().ifPresent(extensionService::register);
|
||||||
new GriefPreventionPlusExtensionFactory().createExtension().ifPresent(extensionService::register);
|
new GriefPreventionPlusExtensionFactory().createExtension().ifPresent(extensionService::register);
|
||||||
new McMMOExtensionFactory().createExtension().ifPresent(extensionService::register);
|
new McMMOExtensionFactory().createExtension().ifPresent(extensionService::register);
|
||||||
|
registerMinigameLibExtensions(extensionService);
|
||||||
for (DataExtension minigame : new MinigameLibExtensionFactory().createExtensions()) {
|
new NucleusExtensionFactory().createExtension().ifPresent(extensionService::register);
|
||||||
extensionService.register(minigame);
|
|
||||||
}
|
|
||||||
|
|
||||||
new SpongeEconomyExtensionFactory().createExtension().ifPresent(extensionService::register);
|
new SpongeEconomyExtensionFactory().createExtension().ifPresent(extensionService::register);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void registerEssentialsExtension(ExtensionService extensionService) {
|
||||||
|
EssentialsExtensionFactory essentials = new EssentialsExtensionFactory();
|
||||||
|
essentials.createExtension()
|
||||||
|
.flatMap(extensionService::register) // If the extension was registered this is present.
|
||||||
|
.ifPresent(essentials::registerUpdateListeners);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void registerMinigameLibExtensions(ExtensionService extensionService) {
|
||||||
|
for (DataExtension minigame : new MinigameLibExtensionFactory().createExtensions()) {
|
||||||
|
extensionService.register(minigame);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user