diff --git a/src/main/kotlin/gg/obsidian/discoursegroupsync/DiscourseGroupSync.kt b/src/main/kotlin/gg/obsidian/discoursegroupsync/DiscourseGroupSync.kt index 6590a28..40171fa 100644 --- a/src/main/kotlin/gg/obsidian/discoursegroupsync/DiscourseGroupSync.kt +++ b/src/main/kotlin/gg/obsidian/discoursegroupsync/DiscourseGroupSync.kt @@ -38,7 +38,7 @@ class DiscourseGroupSync : JavaPlugin(), Listener { } fun setupPermissions(): Boolean { - val rsp: RegisteredServiceProvider = getServer().getServicesManager().getRegistration(Permission::class.java) + val rsp: RegisteredServiceProvider = server.servicesManager.getRegistration(Permission::class.java) permissions = rsp.provider return permissions != null } diff --git a/src/main/kotlin/gg/obsidian/discoursegroupsync/UserManger.kt b/src/main/kotlin/gg/obsidian/discoursegroupsync/UserManger.kt index a0b3d89..b190007 100644 --- a/src/main/kotlin/gg/obsidian/discoursegroupsync/UserManger.kt +++ b/src/main/kotlin/gg/obsidian/discoursegroupsync/UserManger.kt @@ -23,14 +23,14 @@ class UserManager(val plugin: DiscourseGroupSync) { val bodyString = response.body().string() val body = JSONValue.parse(bodyString) as JSONObject - val user = body["user"] as JSONObject - val customGroups = user["custom_groups"] as JSONArray + val user = body.getRaw("user") as JSONObject + val customGroups = user.getRaw("custom_groups") as JSONArray val discourseGroups = HashSet() for (g in customGroups) { val group = g as JSONObject - val id = group.get("id") as Long + val id = group.getRaw("id") as Long discourseGroups.add(id.toInt()) } @@ -82,12 +82,12 @@ class UserManager(val plugin: DiscourseGroupSync) { } for (group in groupsToAdd) { - plugin.logger.info("Adding " + username + " to group " + group) + plugin.logger.info("Adding $username to group $group") plugin.permissions?.playerAddGroup(player, group) } for (group in groupsToRemove) { - plugin.logger.info("Removing " + username + " from group " + group) + plugin.logger.info("Removing $username from group $group") plugin.permissions?.playerRemoveGroup(player, group) } }