mirror of
https://github.com/plexusorg/Plex-FAWE.git
synced 2024-07-05 08:30:04 +00:00
- so certain people can look at the diff and complain about my sloppy code :( Signed-off-by: Jesse Boyd <jessepaleg@gmail.com>
30 lines
900 B
Java
30 lines
900 B
Java
package com.boydti.fawe.bukkit;
|
|
|
|
import com.boydti.fawe.Fawe;
|
|
import com.boydti.fawe.config.BBC;
|
|
import com.boydti.fawe.object.FaweCommand;
|
|
import com.boydti.fawe.object.FawePlayer;
|
|
import org.bukkit.command.Command;
|
|
import org.bukkit.command.CommandExecutor;
|
|
import org.bukkit.command.CommandSender;
|
|
|
|
public class BukkitCommand implements CommandExecutor {
|
|
|
|
private final FaweCommand cmd;
|
|
|
|
public BukkitCommand(final FaweCommand cmd) {
|
|
this.cmd = cmd;
|
|
}
|
|
|
|
@Override
|
|
public boolean onCommand(final CommandSender sender, final Command cmd, final String label, final String[] args) {
|
|
final FawePlayer plr = Fawe.imp().wrap(sender);
|
|
if (!sender.hasPermission(this.cmd.getPerm()) && !sender.isOp()) {
|
|
BBC.NO_PERM.send(plr, this.cmd.getPerm());
|
|
return true;
|
|
}
|
|
this.cmd.executeSafe(plr, args);
|
|
return true;
|
|
}
|
|
}
|