diff --git a/src/main/java/de/btegermany/terraplusminus/commands/TpllCommand.java b/src/main/java/de/btegermany/terraplusminus/commands/TpllCommand.java index 62ecb81..5991181 100644 --- a/src/main/java/de/btegermany/terraplusminus/commands/TpllCommand.java +++ b/src/main/java/de/btegermany/terraplusminus/commands/TpllCommand.java @@ -123,8 +123,14 @@ public void execute(@NotNull CommandSourceStack stack, @NotNull String[] args) { double maxLon = Terraplusminus.config.getDouble("max_longitude"); double[] coordinates = new double[2]; - coordinates[1] = Double.parseDouble(args[0].replace(",", "").replace("°", "")); - coordinates[0] = Double.parseDouble(args[1].replace("°", "")); + try { + coordinates[1] = Double.parseDouble(args[0].replace(",", "").replace("°", "")); + coordinates[0] = Double.parseDouble(args[1].replace("°", "")); + } catch (NumberFormatException e) { + stack.getSender().sendMessage(RED + "Invalid coordinates or command usage!"); + stack.getSender().sendMessage(RED + "Proper usage: /tpll [height (optional]"); + return; + } ChunkGenerator generator = tpWorld.getGenerator(); if (!(generator instanceof RealWorldGenerator)) { // after server reload the generator isnt instanceof RealWorldGenerator anymore