From c8c4ef694e05404042f01a8bd8f369d5fca38fcb Mon Sep 17 00:00:00 2001 From: yoyosource Date: Mon, 13 Dec 2021 21:21:30 +0100 Subject: [PATCH] Fix permissions for TickCommand Signed-off-by: yoyosource --- .../steamwar/bausystem/features/tpslimit/TPSLimitCommand.java | 2 +- .../de/steamwar/bausystem/features/tpslimit/TickCommand.java | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitCommand.java index a5a849e1..7950e401 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TPSLimitCommand.java @@ -104,7 +104,7 @@ public class TPSLimitCommand extends SWCommand implements Enable { } @SuppressWarnings("BooleanMethodIsAlwaysInverted") - private boolean permissionCheck(Player player) { + protected static boolean permissionCheck(Player player) { if (!Permission.hasPermission(player, Permission.WORLD)) { BauSystem.MESSAGE.send("TPSLIMIT_NO_PERMS", player); return false; diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TickCommand.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TickCommand.java index b7dff9a1..ffd34cda 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TickCommand.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tpslimit/TickCommand.java @@ -66,6 +66,7 @@ public class TickCommand extends SWCommand { @Register(value = {"step"}, description = "TICK_STEP_HELP") public void stepCommand(Player p, @OptionalValue("1") int ticks) { // TODO: Fix OptionalValue + if (!TPSLimitCommand.permissionCheck(p)) return; if (ticksLeft != null) { return; } @@ -79,6 +80,7 @@ public class TickCommand extends SWCommand { @Register(value = {"warp"}, description = "TICK_WARP_HELP") public void warpCommand(Player p, int ticks) { + if (!TPSLimitCommand.permissionCheck(p)) return; if (ticksLeft != null) { return; }