summaryrefslogtreecommitdiff
path: root/src/main/kotlin/io/dico/parcels2/command/CommandsPrivilegesGlobal.kt
blob: 33ffb8bef70f9f7a2f65cc5c9744c23dc115c3e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
package io.dico.parcels2.command

import io.dico.dicore.command.ExecutionContext
import io.dico.dicore.command.annotation.Cmd
import io.dico.dicore.command.annotation.Desc
import io.dico.parcels2.ParcelsPlugin
import io.dico.parcels2.PlayerProfile
import org.bukkit.entity.Player

class CommandsPrivilegesGlobal(plugin: ParcelsPlugin,
                               val adminVersion: CommandsAdminPrivilegesGlobal) : AbstractParcelCommands(plugin) {
    @Cmd("list", aliases = ["l"])
    @Desc(
        "List globally declared privileges, players you",
        "allowed to build on or banned from all your parcels",
        shortVersion = "lists globally declared privileges"
    )
    fun cmdList(sender: Player, context: ExecutionContext) =
        adminVersion.cmdList(context, sender)

    @Cmd("entrust")
    @Desc(
        "Allows a player to manage globally",
        shortVersion = "allows a player to manage globally"
    )
    suspend fun cmdEntrust(sender: Player, context: ExecutionContext, player: PlayerProfile) =
        adminVersion.cmdEntrust(context, sender, player)

    @Cmd("distrust")
    @Desc(
        "Disallows a player to manage globally,",
        "they will still be able to build",
        shortVersion = "disallows a player to manage globally"
    )
    suspend fun cmdDistrust(sender: Player, context: ExecutionContext, player: PlayerProfile) =
        adminVersion.cmdDistrust(context, sender, player)

    @Cmd("allow", aliases = ["add", "permit"])
    @Desc(
        "Globally allows a player to build on all",
        "the parcels that you own.",
        shortVersion = "globally allows a player to build on your parcels"
    )
    suspend fun cmdAllow(sender: Player, context: ExecutionContext, player: PlayerProfile) =
        adminVersion.cmdAllow(context, sender, player)

    @Cmd("disallow", aliases = ["remove", "forbid"])
    @Desc(
        "Globally disallows a player to build on",
        "the parcels that you own.",
        "If the player is allowed to build on specific",
        "parcels, they can still build there.",
        shortVersion = "globally disallows a player to build on your parcels"
    )
    suspend fun cmdDisallow(sender: Player, context: ExecutionContext, player: PlayerProfile) =
        adminVersion.cmdDisallow(context, sender, player)

    @Cmd("ban", aliases = ["deny"])
    @Desc(
        "Globally bans a player from all the parcels",
        "that you own, making them unable to enter.",
        shortVersion = "globally bans a player from your parcels"
    )
    suspend fun cmdBan(sender: Player, context: ExecutionContext, player: PlayerProfile) =
        adminVersion.cmdBan(context, sender, player)

    @Cmd("unban", aliases = ["undeny"])
    @Desc(
        "Globally unbans a player from all the parcels",
        "that you own, they can enter again.",
        "If the player is banned from specific parcels,",
        "they will still be banned there.",
        shortVersion = "globally unbans a player from your parcels"
    )
    suspend fun cmdUnban(sender: Player, context: ExecutionContext, player: PlayerProfile) =
        adminVersion.cmdUnban(context, sender, player)
}