Change PermissionService handling

This commit is contained in:
Luck 2016-11-22 21:57:51 +00:00
parent aeeb2820f9
commit f0ad32bc37
No known key found for this signature in database
GPG Key ID: EFA9B3EC5FD90F8B

View File

@ -210,13 +210,14 @@ public class LPSpongePlugin implements LuckPermsPlugin {
// register the PermissionService with Sponge
getLog().info("Registering PermissionService...");
service = new LuckPermsService(this);
if (game.getPluginManager().getPlugin("permissionsex").isPresent()) {
getLog().warn("Detected PermissionsEx - assuming it's loaded for migration.");
getLog().warn("Delaying LuckPerms PermissionService registration.");
lateLoad = true;
} else {
game.getServiceManager().setProvider(this, PermissionService.class, (service = new LuckPermsService(this)));
game.getServiceManager().setProvider(this, PermissionService.class, service);
}
// register with the LP API
@ -246,7 +247,7 @@ public class LPSpongePlugin implements LuckPermsPlugin {
public void onLateEnable(GamePreInitializationEvent event) {
if (lateLoad) {
getLog().info("Providing late registration of PermissionService...");
game.getServiceManager().setProvider(this, PermissionService.class, (service = new LuckPermsService(this)));
game.getServiceManager().setProvider(this, PermissionService.class, service);
}
}