summaryrefslogtreecommitdiff
path: root/src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt
diff options
context:
space:
mode:
authorDico Karssiens <dico.karssiens@gmail.com>2018-08-01 16:45:27 +0100
committerDico Karssiens <dico.karssiens@gmail.com>2018-08-01 16:45:27 +0100
commit472e700e0422d1829aa26e04b74e2077807e75f0 (patch)
treeec6787ff6c0841989951ef65edc3e792ae067b36 /src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt
parent1ec6dd136b678a312d5865ef1fdfd994d58796d3 (diff)
Improve database abstractions, add GlobalAddedData, some other things
Diffstat (limited to 'src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt')
-rw-r--r--src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt b/src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt
index 78a989e..fa9a696 100644
--- a/src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt
+++ b/src/main/kotlin/io/dico/parcels2/command/CommandsGeneral.kt
@@ -4,6 +4,7 @@ import io.dico.dicore.command.EMessageType
import io.dico.dicore.command.ExecutionContext
import io.dico.dicore.command.annotation.Cmd
import io.dico.dicore.command.annotation.Desc
+import io.dico.dicore.command.annotation.Flag
import io.dico.dicore.command.annotation.RequireParameters
import io.dico.parcels2.ParcelOwner
import io.dico.parcels2.ParcelsPlugin
@@ -84,12 +85,22 @@ class CommandsGeneral(plugin: ParcelsPlugin) : AbstractParcelCommands(plugin) {
@Cmd("clear")
@ParcelRequire(owner = true)
- fun ParcelScope.cmdClear(context: ExecutionContext) {
+ fun ParcelScope.cmdClear(context: ExecutionContext, @Flag sure: Boolean): Any? {
+ if (!sure) return "Are you sure? You cannot undo this action!\n" +
+ "Type ${context.rawInput} -sure if you want to go through with this."
+
world.generator.clearParcel(parcel)
.onProgressUpdate(1000, 1000) { progress, elapsedTime ->
context.sendMessage(EMessageType.INFORMATIVE, "Clear progress: %.02f%%, %.2fs elapsed"
.format(progress * 100, elapsedTime / 1000.0))
}
+
+ return null
+ }
+
+ @Cmd("swap")
+ fun ParcelScope.cmdSwap(context: ExecutionContext, @Flag sure: Boolean): Any? {
+
}
@Cmd("make_mess")