SteamWar/BauSystem2.0
Archiviert
12
0

Fix permissions for TickCommand
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Signed-off-by: yoyosource <yoyosource@nidido.de>
Dieser Commit ist enthalten in:
yoyosource 2021-12-13 21:21:30 +01:00
Ursprung 5e774ad874
Commit c8c4ef694e
2 geänderte Dateien mit 3 neuen und 1 gelöschten Zeilen

Datei anzeigen

@ -104,7 +104,7 @@ public class TPSLimitCommand extends SWCommand implements Enable {
} }
@SuppressWarnings("BooleanMethodIsAlwaysInverted") @SuppressWarnings("BooleanMethodIsAlwaysInverted")
private boolean permissionCheck(Player player) { protected static boolean permissionCheck(Player player) {
if (!Permission.hasPermission(player, Permission.WORLD)) { if (!Permission.hasPermission(player, Permission.WORLD)) {
BauSystem.MESSAGE.send("TPSLIMIT_NO_PERMS", player); BauSystem.MESSAGE.send("TPSLIMIT_NO_PERMS", player);
return false; return false;

Datei anzeigen

@ -66,6 +66,7 @@ public class TickCommand extends SWCommand {
@Register(value = {"step"}, description = "TICK_STEP_HELP") @Register(value = {"step"}, description = "TICK_STEP_HELP")
public void stepCommand(Player p, @OptionalValue("1") int ticks) { // TODO: Fix OptionalValue public void stepCommand(Player p, @OptionalValue("1") int ticks) { // TODO: Fix OptionalValue
if (!TPSLimitCommand.permissionCheck(p)) return;
if (ticksLeft != null) { if (ticksLeft != null) {
return; return;
} }
@ -79,6 +80,7 @@ public class TickCommand extends SWCommand {
@Register(value = {"warp"}, description = "TICK_WARP_HELP") @Register(value = {"warp"}, description = "TICK_WARP_HELP")
public void warpCommand(Player p, int ticks) { public void warpCommand(Player p, int ticks) {
if (!TPSLimitCommand.permissionCheck(p)) return;
if (ticksLeft != null) { if (ticksLeft != null) {
return; return;
} }