summaryrefslogtreecommitdiff
path: root/src/main/kotlin/io/dico/parcels2/command/ParcelCommandReceivers.kt
diff options
context:
space:
mode:
authorDico <dico.karssiens@gmail.com>2018-09-24 09:09:23 +0100
committerDico <dico.karssiens@gmail.com>2018-09-24 09:09:23 +0100
commit98395542a507e40a9058d2ed6332853ec20b23fc (patch)
treec823479c6553b624b6214504d9fb21647839e86a /src/main/kotlin/io/dico/parcels2/command/ParcelCommandReceivers.kt
parentf2d88b3c54c83f1b826ebb3e483c599b64ad39bf (diff)
Fix compile errors
Diffstat (limited to 'src/main/kotlin/io/dico/parcels2/command/ParcelCommandReceivers.kt')
-rw-r--r--src/main/kotlin/io/dico/parcels2/command/ParcelCommandReceivers.kt7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/main/kotlin/io/dico/parcels2/command/ParcelCommandReceivers.kt b/src/main/kotlin/io/dico/parcels2/command/ParcelCommandReceivers.kt
index 443adfb..0ef5264 100644
--- a/src/main/kotlin/io/dico/parcels2/command/ParcelCommandReceivers.kt
+++ b/src/main/kotlin/io/dico/parcels2/command/ParcelCommandReceivers.kt
@@ -30,10 +30,7 @@ annotation class SuspensionTimeout(val millis: Int)
open class WorldScope(val world: ParcelWorld) : ICommandReceiver
open class ParcelScope(val parcel: Parcel) : WorldScope(parcel.world) {
- fun checkCanManage(player: Player, action: String) = Validate.isTrue(
- player.hasPermAdminManage || parcel.hasPrivilegeToManage(player),
- "You must own this parcel to $action"
- )
+ fun checkCanManage(player: Player, action: String) = Validate.isTrue(parcel.canManage(player), "You must own this parcel to $action")
}
fun getParcelCommandReceiver(parcelProvider: ParcelProvider, context: ExecutionContext, method: Method, cmdName: String): ICommandReceiver {
@@ -65,7 +62,7 @@ fun ParcelProvider.getParcelRequired(player: Player, privilege: Privilege? = nul
OWNER ->
Validate.isTrue(parcel.isOwner(player.uuid), "You must own this parcel to use that command")
CAN_MANAGE ->
- Validate.isTrue(parcel.hasPrivilegeToManage(player), "You must have management privileges on this parcel to use that command")
+ Validate.isTrue(parcel.canManage(player), "You must have management privileges on this parcel to use that command")
}
}