mirror of
https://github.com/boy0001/FastAsyncWorldedit.git
synced 2024-11-28 13:45:36 +01:00
Properly check perms
This commit is contained in:
parent
4dc9f2ff35
commit
a453a0a2ac
@ -5,7 +5,9 @@ import org.bukkit.command.CommandExecutor;
|
||||
import org.bukkit.command.CommandSender;
|
||||
|
||||
import com.boydti.fawe.Fawe;
|
||||
import com.boydti.fawe.config.BBC;
|
||||
import com.boydti.fawe.object.FaweCommand;
|
||||
import com.boydti.fawe.object.FawePlayer;
|
||||
|
||||
public class BukkitCommand implements CommandExecutor {
|
||||
|
||||
@ -17,7 +19,12 @@ public class BukkitCommand implements CommandExecutor {
|
||||
|
||||
@Override
|
||||
public boolean onCommand(final CommandSender sender, final Command cmd, final String label, final String[] args) {
|
||||
this.cmd.execute(Fawe.imp().wrap(sender), args);
|
||||
FawePlayer plr = Fawe.imp().wrap(sender);
|
||||
if (!sender.hasPermission(this.cmd.getPerm())) {
|
||||
BBC.NO_PERM.send(plr, this.cmd.getPerm());
|
||||
return true;
|
||||
}
|
||||
this.cmd.execute(plr, args);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -20,6 +20,7 @@ public enum BBC {
|
||||
* Can use multiple arguments %s, %s1, %s2, %s3 etc
|
||||
*/
|
||||
COMMAND_SYNTAX("&cUsage: &7%s0", "Error"),
|
||||
NO_PERM("&cYou are lacking the permission node: %s0", "Error"),
|
||||
SCHEMATIC_NOT_FOUND("&cSchematic not found: &7%s0", "Error"),
|
||||
SCHEMATIC_PASTING("&7The schematic is pasting. This cannot be undone.", "Info"),
|
||||
FIX_LIGHTING_CHUNK("&7Lighting has been fixed in your current chunk. Relog to see the affect.", "Info"),
|
||||
|
Loading…
Reference in New Issue
Block a user