Fix setCenter command throwing an error when only one argument is provided

- Fixes #94
pull/95/head
trivernis 4 years ago
parent 733996e6a9
commit f0ea063026

@ -22,7 +22,7 @@ idea {
} }
group "net.trivernis" group "net.trivernis"
version "1.3.1" version "1.3.2"
sourceCompatibility = 1.8 sourceCompatibility = 1.8

@ -36,6 +36,11 @@ class CmdSetCenter(private val chunkmaster: Chunkmaster) : Subcommand {
centerX = sender.location.chunk.x centerX = sender.location.chunk.x
centerZ = sender.location.chunk.z centerZ = sender.location.chunk.z
} }
args.size == 1 -> {
world = args[0]
centerX = sender.location.chunk.x
centerZ = sender.location.chunk.z
}
args.size == 2 -> { args.size == 2 -> {
world = sender.world.name world = sender.world.name
if (args[0].toIntOrNull() == null || args[1].toIntOrNull() == null) { if (args[0].toIntOrNull() == null || args[1].toIntOrNull() == null) {

@ -1,6 +1,6 @@
main: net.trivernis.chunkmaster.Chunkmaster main: net.trivernis.chunkmaster.Chunkmaster
name: Chunkmaster name: Chunkmaster
version: '1.3.1' version: '1.3.2'
description: Automated world pregeneration. description: Automated world pregeneration.
author: Trivernis author: Trivernis
website: trivernis.net website: trivernis.net

Loading…
Cancel
Save