Skip to content

Commit

Permalink
[FIX] only op can now use this command
Browse files Browse the repository at this point in the history
  • Loading branch information
Dzious committed Nov 17, 2020
1 parent 489c5fc commit 4c9b187
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@
import com.dzious.bukkit.enchantcontrol.EnchantControl;
import com.dzious.bukkit.enchantcontrol.utils.Utils;

import org.bukkit.Color;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
import org.bukkit.command.CommandSender;
import org.bukkit.command.TabCompleter;
import org.bukkit.configuration.InvalidConfigurationException;
import org.bukkit.entity.Player;

public class CommandEnchantControl implements CommandExecutor, TabCompleter {

Expand All @@ -32,6 +34,8 @@ public CommandEnchantControl(EnchantControl plugin) {

@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (sender instanceof Player && !sender.isOp())
sender.sendMessage(Color.RED + "Sorry, only OPs can use this command.");
plugin.getLogManager().logDebugConsole("Enchant Control Command");
plugin.getLogManager().logDebugConsole("length : " + args.length);
for (int i = 0; i < args.length; i++)
Expand Down

0 comments on commit 4c9b187

Please sign in to comment.