diff options
Diffstat (limited to 'src/main/kotlin/io/dico/parcels2/command/ParcelCommandReceivers.kt')
-rw-r--r-- | src/main/kotlin/io/dico/parcels2/command/ParcelCommandReceivers.kt | 7 |
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") } } |