diff options
author | Dico <dico.karssiens@gmail.com> | 2018-08-02 18:22:36 +0100 |
---|---|---|
committer | Dico <dico.karssiens@gmail.com> | 2018-08-02 18:22:36 +0100 |
commit | 0af2e615d3fa1d8509be46e14f99d40dc9cdb342 (patch) | |
tree | 3864043218969a67b5df17784a05c6af424e3617 /src/main/kotlin/io/dico/parcels2/command/AbstractParcelCommands.kt | |
parent | 6513ad9237dbda0244a52608ae639fee5822b3ee (diff) |
Refactor and improve a lot of the API. Move default implementations into a package. Reformatting.
Diffstat (limited to 'src/main/kotlin/io/dico/parcels2/command/AbstractParcelCommands.kt')
-rw-r--r-- | src/main/kotlin/io/dico/parcels2/command/AbstractParcelCommands.kt | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/kotlin/io/dico/parcels2/command/AbstractParcelCommands.kt b/src/main/kotlin/io/dico/parcels2/command/AbstractParcelCommands.kt index f712d00..2fceb5b 100644 --- a/src/main/kotlin/io/dico/parcels2/command/AbstractParcelCommands.kt +++ b/src/main/kotlin/io/dico/parcels2/command/AbstractParcelCommands.kt @@ -16,10 +16,10 @@ abstract class AbstractParcelCommands(val plugin: ParcelsPlugin) : ICommandRecei override fun getPlugin(): Plugin = plugin override fun getReceiver(context: ExecutionContext, target: Method, cmdName: String): ICommandReceiver { - return getParcelCommandReceiver(plugin.worlds, context, target, cmdName) + return getParcelCommandReceiver(plugin.parcelProvider, context, target, cmdName) } - protected inline val worlds get() = plugin.worlds + protected inline val worlds get() = plugin.parcelProvider protected fun error(message: String): Nothing { throw CommandException(message) @@ -32,7 +32,7 @@ abstract class AbstractParcelCommands(val plugin: ParcelsPlugin) : ICommandRecei protected suspend fun checkParcelLimit(player: Player, world: ParcelWorld) { if (player.hasAdminManage) return val numOwnedParcels = plugin.storage.getOwnedParcels(ParcelOwner(player)).await() - .filter { it.world.world == world.world }.size + .filter { it.worldId.equals(world.id) }.size val limit = player.parcelLimit if (numOwnedParcels >= limit) { |