From 824f9d7ad010b3c4af4b80ebebef340633fb269f Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Wed, 9 Dec 2020 23:14:52 +0100 Subject: [PATCH] Add missing returns to /plot cluster --- .../java/com/plotsquared/core/command/Cluster.java | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Core/src/main/java/com/plotsquared/core/command/Cluster.java b/Core/src/main/java/com/plotsquared/core/command/Cluster.java index 53abbf820..acc52f35d 100644 --- a/Core/src/main/java/com/plotsquared/core/command/Cluster.java +++ b/Core/src/main/java/com/plotsquared/core/command/Cluster.java @@ -708,6 +708,7 @@ public class Cluster extends SubCommand { } cluster.getHome(home -> player.teleport(home, TeleportCause.COMMAND)); player.sendMessage(TranslatableCaption.of("cluster.cluster_teleporting")); + return true; } case "i": case "info": @@ -729,14 +730,18 @@ public class Cluster extends SubCommand { PlotArea area = player.getApplicablePlotArea(); if (area == null) { player.sendMessage(TranslatableCaption.of("errors.not_in_plot_world")); + return false; } PlotCluster cluster; if (args.length == 2) { cluster = area.getCluster(args[1]); - player.sendMessage( - TranslatableCaption.of("cluster.invalid_cluster_name"), - Template.of("cluster", args[1]) - ); + if (cluster == null) { + player.sendMessage( + TranslatableCaption.of("cluster.invalid_cluster_name"), + Template.of("cluster", args[1]) + ); + return false; + } } else { cluster = area.getCluster(player.getLocation()); if (cluster == null) {