From 453532601401cf9d3804a658e6961c9b899cfb69 Mon Sep 17 00:00:00 2001 From: Bukkit/Spigot Date: Thu, 2 Aug 2012 19:01:14 -0500 Subject: [PATCH] Test command permissions before running them. By: Travis Watkins --- .../java/org/bukkit/command/defaults/DefaultGameModeCommand.java | 1 + .../src/main/java/org/bukkit/command/defaults/SeedCommand.java | 1 + 2 files changed, 2 insertions(+) diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/DefaultGameModeCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/DefaultGameModeCommand.java index d323bee601..c633f8add5 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/DefaultGameModeCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/DefaultGameModeCommand.java @@ -19,6 +19,7 @@ public class DefaultGameModeCommand extends VanillaCommand { @Override public boolean execute(CommandSender sender, String commandLabel, String[] args) { + if (!testPermission(sender)) return true; if (args.length == 0) { sender.sendMessage("Useage: " + usageMessage); return false; diff --git a/paper-api/src/main/java/org/bukkit/command/defaults/SeedCommand.java b/paper-api/src/main/java/org/bukkit/command/defaults/SeedCommand.java index 08258e5a1d..4fac2678de 100644 --- a/paper-api/src/main/java/org/bukkit/command/defaults/SeedCommand.java +++ b/paper-api/src/main/java/org/bukkit/command/defaults/SeedCommand.java @@ -14,6 +14,7 @@ public class SeedCommand extends VanillaCommand { @Override public boolean execute(CommandSender sender, String commandLabel, String[] args) { + if (!testPermission(sender)) return true; long seed; if (sender instanceof Player) { seed = ((Player) sender).getWorld().getSeed();