Skip to content

Commit

Permalink
Update Requires.kt
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobkmar committed Sep 6, 2021
1 parent 91d025d commit 618c828
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/main/kotlin/net/axay/kspigot/commands/Requires.kt
Expand Up @@ -8,18 +8,16 @@ import org.bukkit.permissions.Permission
* Defines that the given [permission] is required to interact with this
* path of the command.
*/
fun ArgumentBuilder<ServerCommandSource, *>.requiresPermission(permission: String) {
fun ArgumentBuilder<ServerCommandSource, *>.requiresPermission(permission: String): ArgumentBuilder<*, *> =
requires {
it.bukkitSender.hasPermission(permission)
}
}

/**
* Defines that the given [permission] is required to interact with this
* path of the command.
*/
fun ArgumentBuilder<ServerCommandSource, *>.requiresPermission(permission: Permission) {
fun ArgumentBuilder<ServerCommandSource, *>.requiresPermission(permission: Permission): ArgumentBuilder<*, *> =
requires {
it.bukkitSender.hasPermission(permission)
}
}

0 comments on commit 618c828

Please sign in to comment.