|
|
|
@ -29,12 +29,14 @@ class CmdSetCenter(private val chunkmaster: Chunkmaster): Subcommand {
|
|
|
|
|
val centerX: Int
|
|
|
|
|
val centerZ: Int
|
|
|
|
|
|
|
|
|
|
if (args.size < 2) {
|
|
|
|
|
sender.sendMessage(chunkmaster.langManager.getLocalized("TOO_FEW_ARGUMENTS"))
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
|
if (sender is Player) {
|
|
|
|
|
if (args.size == 2) {
|
|
|
|
|
when {
|
|
|
|
|
args.isEmpty() -> {
|
|
|
|
|
world = sender.world.name
|
|
|
|
|
centerX = sender.location.chunk.x
|
|
|
|
|
centerZ = sender.location.chunk.z
|
|
|
|
|
}
|
|
|
|
|
args.size == 2 -> {
|
|
|
|
|
world = sender.world.name
|
|
|
|
|
if (args[0].toIntOrNull() == null || args[1].toIntOrNull() == null) {
|
|
|
|
|
sender.sendMessage(chunkmaster.langManager.getLocalized("COORD_INVALID", args[0], args[1]))
|
|
|
|
@ -42,7 +44,8 @@ class CmdSetCenter(private val chunkmaster: Chunkmaster): Subcommand {
|
|
|
|
|
}
|
|
|
|
|
centerX = args[0].toInt()
|
|
|
|
|
centerZ = args[1].toInt()
|
|
|
|
|
} else {
|
|
|
|
|
}
|
|
|
|
|
else -> {
|
|
|
|
|
if (!validateThreeArgs(sender, args)) {
|
|
|
|
|
return false
|
|
|
|
|
}
|
|
|
|
@ -50,6 +53,7 @@ class CmdSetCenter(private val chunkmaster: Chunkmaster): Subcommand {
|
|
|
|
|
centerX = args[1].toInt()
|
|
|
|
|
centerZ = args[2].toInt()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
if (args.size < 3) {
|
|
|
|
|
sender.sendMessage(chunkmaster.langManager.getLocalized("TOO_FEW_ARGUMENTS"))
|
|
|
|
|