Skip to content

Commit 1a42446

Browse files
Fixed HasPayedCommand
1 parent 733b680 commit 1a42446

2 files changed

Lines changed: 11 additions & 13 deletions

File tree

src/main/kotlin/de/randombyte/commandutils/CommandUtils.kt

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@ import de.randombyte.commandutils.CommandUtils.Companion.PLACEHOLDER_API_ID
88
import de.randombyte.commandutils.CommandUtils.Companion.VERSION
99
import de.randombyte.commandutils.alias.CommandListener
1010
import de.randombyte.commandutils.conditions.HasMoneyCommand
11+
import de.randombyte.commandutils.conditions.HasPayedCommand
1112
import de.randombyte.commandutils.conditions.IsAfterCommand
1213
import de.randombyte.commandutils.conditions.IsBeforeCommand
1314
import de.randombyte.commandutils.config.ConfigAccessor
1415
import de.randombyte.commandutils.config.ConfigUpdater
1516
import de.randombyte.commandutils.execute.delay.DelayCommand
1617
import de.randombyte.commandutils.execute.ifcondition.IfCommand
17-
import de.randombyte.commandutils.execute.money.CostCommand
1818
import de.randombyte.commandutils.execute.parse.ParseCommand
1919
import de.randombyte.commandutils.execute.userUuidFromNameOrUuid
2020
import de.randombyte.commandutils.execute.whenonline.ExecuteWhenOnlineCommand
@@ -25,7 +25,6 @@ import de.randombyte.commandutils.service.CommandUtilsServiceImpl
2525
import de.randombyte.kosp.extensions.toText
2626
import de.randombyte.kosp.getServiceOrFail
2727
import me.rojo8399.placeholderapi.PlaceholderService
28-
import org.bstats.sponge.Metrics
2928
import org.slf4j.Logger
3029
import org.spongepowered.api.Sponge
3130
import org.spongepowered.api.command.args.GenericArguments.*
@@ -48,7 +47,7 @@ import java.nio.file.Path
4847
class CommandUtils @Inject constructor(
4948
val logger: Logger,
5049
@ConfigDir(sharedRoot = false) configPath: Path,
51-
val bStats: Metrics,
50+
// val bStats: Metrics,
5251
val pluginContainer: PluginContainer
5352
) {
5453
companion object {
@@ -144,17 +143,16 @@ class CommandUtils @Inject constructor(
144143
.executor(HasMoneyCommand())
145144
.build()
146145

147-
val executeCostCommandSpec = CommandSpec.builder()
148-
.permission("$ROOT_PERMISSION.cost")
146+
val hasPayedCommandSpec = CommandSpec.builder()
147+
.permission("$ROOT_PERMISSION.payed")
149148
.arguments(
150149
userUuidFromNameOrUuid,
151-
doubleNum(PRICE_ARG.toText()),
152-
remainingRawJoinedStrings(COMMAND_ARG.toText()))
153-
.executor(CostCommand())
150+
doubleNum(PRICE_ARG.toText()))
151+
.executor(HasPayedCommand())
154152
.build()
155153

156154
val executeParsedCommandSpec = CommandSpec.builder()
157-
.permission("$ROOT_PERMISSION.parse")
155+
.permission("$ROOT_PERMISSION.parsed")
158156
.arguments(
159157
userUuidFromNameOrUuid,
160158
remainingRawJoinedStrings(COMMAND_ARG.toText()))
@@ -182,11 +180,11 @@ class CommandUtils @Inject constructor(
182180
.build(), "is")
183181
.child(CommandSpec.builder()
184182
.child(hasMoneyCommandSpec, "money")
185-
.build(), "has")
183+
.child(hasPayedCommandSpec, "payed")
184+
.build(), "has")
186185
.child(CommandSpec.builder()
187186
.child(executeWhenOnlineCommandSpec, "whenOnline")
188187
.child(executeDelayCommandSpec, "delayed")
189-
.child(executeCostCommandSpec, "cost")
190188
.child(executeIfCommandSpec, "if")
191189
.child(executeParsedCommandSpec, "parsed")
192190
.build(), "execute")

src/main/kotlin/de/randombyte/commandutils/execute/money/CostCommand.kt renamed to src/main/kotlin/de/randombyte/commandutils/conditions/HasPayedCommand.kt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package de.randombyte.commandutils.execute.money
1+
package de.randombyte.commandutils.conditions
22

33
import de.randombyte.commandutils.CommandUtils
44
import de.randombyte.commandutils.execute.getUserUuid
@@ -15,7 +15,7 @@ import org.spongepowered.api.service.economy.EconomyService
1515
import org.spongepowered.api.service.economy.transaction.ResultType
1616
import java.math.BigDecimal
1717

18-
class CostCommand : CommandExecutor {
18+
class HasPayedCommand : CommandExecutor {
1919
override fun execute(src: CommandSource, args: CommandContext): CommandResult {
2020
val playerUuid = args.getUserUuid()
2121
val price = args.getOne<Double>(CommandUtils.PRICE_ARG).get()

0 commit comments

Comments
 (0)