diff --git a/api/src/main/kotlin/br/com/gamemods/minecity/api/service/permission/ClaimPermission.kt b/api/src/main/kotlin/br/com/gamemods/minecity/api/service/permission/ClaimPermission.kt index ce80634..c0b6647 100644 --- a/api/src/main/kotlin/br/com/gamemods/minecity/api/service/permission/ClaimPermission.kt +++ b/api/src/main/kotlin/br/com/gamemods/minecity/api/service/permission/ClaimPermission.kt @@ -1,5 +1,6 @@ package br.com.gamemods.minecity.api.service.permission +import br.com.gamemods.minecity.api.annotation.internal.InternalMineCityApi import br.com.gamemods.minecity.api.id.ClaimPermissionId import net.kyori.adventure.text.Component @@ -14,4 +15,13 @@ public abstract class ClaimPermission( public val id: ClaimPermissionId, public val name: Component, public val description: Component, -) +) { + protected abstract fun onRegister() + + public companion object { + @InternalMineCityApi + public fun onRegister(claimPermission: ClaimPermission) { + claimPermission.onRegister() + } + } +} diff --git a/core/src/main/kotlin/br/com/gamemods/minecity/core/service/permission/CorePermissionService.kt b/core/src/main/kotlin/br/com/gamemods/minecity/core/service/permission/CorePermissionService.kt index 665bcbe..dce7e80 100644 --- a/core/src/main/kotlin/br/com/gamemods/minecity/core/service/permission/CorePermissionService.kt +++ b/core/src/main/kotlin/br/com/gamemods/minecity/core/service/permission/CorePermissionService.kt @@ -16,5 +16,6 @@ class CorePermissionService: PermissionService { if(old == null) permission else error("Permission ${permission.id} already registered") } + ClaimPermission.onRegister(permission) } }