Skip to content

Commit

Permalink
PC-1050 Adds ClaimPermission.onRegister
Browse files Browse the repository at this point in the history
  • Loading branch information
Polyana committed Dec 22, 2023
1 parent 9507f21 commit 7d6bf31
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,6 @@ class CorePermissionService: PermissionService {
if(old == null) permission
else error("Permission ${permission.id} already registered")
}
ClaimPermission.onRegister(permission)
}
}

0 comments on commit 7d6bf31

Please sign in to comment.