From 57127537f7fe0410387890ff69a3c2fdc5557115 Mon Sep 17 00:00:00 2001 From: Hannes Greule Date: Tue, 7 Jul 2020 19:40:25 +0200 Subject: [PATCH] Add permission check for /plot home --- .../main/java/com/plotsquared/core/command/HomeCommand.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java b/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java index 07c15147a..b72276026 100644 --- a/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java +++ b/Core/src/main/java/com/plotsquared/core/command/HomeCommand.java @@ -34,6 +34,7 @@ import com.plotsquared.core.plot.PlotArea; import com.plotsquared.core.plot.PlotId; import com.plotsquared.core.util.MainUtil; import com.plotsquared.core.util.MathMan; +import com.plotsquared.core.util.Permissions; import com.plotsquared.core.util.TabCompletions; import com.plotsquared.core.util.query.PlotQuery; import com.plotsquared.core.util.query.SortingStrategy; @@ -94,6 +95,11 @@ public class HomeCommand extends Command { // /plot home <[area;]x;y> // /plot home // /plot home + if (!Permissions.hasPermission(player, Captions.PERMISSION_VISIT_OWNED) && !Permissions + .hasPermission(player, Captions.PERMISSION_HOME)) { + Captions.NO_PERMISSION.send(player, Captions.PERMISSION_VISIT_OWNED); + return CompletableFuture.completedFuture(false); + } if (args.length > 2) { Captions.COMMAND_SYNTAX.send(player, getUsage()); return CompletableFuture.completedFuture(false);