From 57c2924930e81a39e6d288c5426a6bc61f416573 Mon Sep 17 00:00:00 2001 From: libraryaddict Date: Sat, 23 Nov 2019 14:38:21 +1300 Subject: [PATCH] Allow server ops to use commands --- src/main/java/me/libraryaddict/disguise/LibsDisguises.java | 4 ++-- .../libraryaddict/disguise/commands/DisguiseBaseCommand.java | 2 +- .../me/libraryaddict/disguise/commands/UndisguiseCommand.java | 2 +- .../disguise/commands/UndisguiseEntityCommand.java | 2 +- .../disguise/commands/UndisguisePlayerCommand.java | 2 +- .../disguise/commands/UndisguiseRadiusCommand.java | 2 +- 6 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/main/java/me/libraryaddict/disguise/LibsDisguises.java b/src/main/java/me/libraryaddict/disguise/LibsDisguises.java index 9b760e16..9831efa7 100644 --- a/src/main/java/me/libraryaddict/disguise/LibsDisguises.java +++ b/src/main/java/me/libraryaddict/disguise/LibsDisguises.java @@ -56,8 +56,8 @@ public class LibsDisguises extends JavaPlugin { LibsPremium.check(getDescription().getVersion(), getFile()); if (!LibsPremium.isPremium()) { - getLogger().info("You are running the free version, commands limited to non-players (Console, Command " + - "Blocks)"); + getLogger().info("You are running the free version, commands limited to non-players and operators. (Console, Command " + + "Blocks, Admins)"); } if (!ReflectionManager.getMinecraftVersion().startsWith("1.14.4")) { diff --git a/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java b/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java index a58d6465..b24a935f 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/DisguiseBaseCommand.java @@ -40,7 +40,7 @@ public abstract class DisguiseBaseCommand implements CommandExecutor { } protected boolean isNotPremium(CommandSender sender) { - if (sender instanceof Player && + if (sender instanceof Player && !sender.isOp() && (!LibsPremium.isPremium() || LibsPremium.getPaidInformation() == LibsPremium.getPluginInformation())) { sender.sendMessage(ChatColor.RED + "Please purchase Lib's Disguises to enable player commands"); return true; diff --git a/src/main/java/me/libraryaddict/disguise/commands/UndisguiseCommand.java b/src/main/java/me/libraryaddict/disguise/commands/UndisguiseCommand.java index 5ce3373c..ef264bea 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/UndisguiseCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/UndisguiseCommand.java @@ -14,7 +14,7 @@ public class UndisguiseCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { - if (sender instanceof Player && + if (sender instanceof Player && !sender.isOp() && (!LibsPremium.isPremium() || LibsPremium.getPaidInformation() == LibsPremium.getPluginInformation())) { sender.sendMessage(ChatColor.RED + "Please purchase Lib's Disguises to enable player commands"); return true; diff --git a/src/main/java/me/libraryaddict/disguise/commands/UndisguiseEntityCommand.java b/src/main/java/me/libraryaddict/disguise/commands/UndisguiseEntityCommand.java index c7df61b6..3246ddf7 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/UndisguiseEntityCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/UndisguiseEntityCommand.java @@ -13,7 +13,7 @@ public class UndisguiseEntityCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { - if (sender instanceof Player && + if (sender instanceof Player && !sender.isOp()&& (!LibsPremium.isPremium() || LibsPremium.getPaidInformation() == LibsPremium.getPluginInformation())) { sender.sendMessage(ChatColor.RED + "Please purchase Lib's Disguises to enable player commands"); return true; diff --git a/src/main/java/me/libraryaddict/disguise/commands/UndisguisePlayerCommand.java b/src/main/java/me/libraryaddict/disguise/commands/UndisguisePlayerCommand.java index 0ee5c3ae..f1d25564 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/UndisguisePlayerCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/UndisguisePlayerCommand.java @@ -55,7 +55,7 @@ public class UndisguisePlayerCommand implements CommandExecutor, TabCompleter { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { - if (sender instanceof Player && + if (sender instanceof Player && !sender.isOp() && (!LibsPremium.isPremium() || LibsPremium.getPaidInformation() == LibsPremium.getPluginInformation())) { sender.sendMessage(ChatColor.RED + "Please purchase Lib's Disguises to enable player commands"); return true; diff --git a/src/main/java/me/libraryaddict/disguise/commands/UndisguiseRadiusCommand.java b/src/main/java/me/libraryaddict/disguise/commands/UndisguiseRadiusCommand.java index 31d37dd4..aabaea0c 100644 --- a/src/main/java/me/libraryaddict/disguise/commands/UndisguiseRadiusCommand.java +++ b/src/main/java/me/libraryaddict/disguise/commands/UndisguiseRadiusCommand.java @@ -29,7 +29,7 @@ public class UndisguiseRadiusCommand implements CommandExecutor { @Override public boolean onCommand(CommandSender sender, Command cmd, String label, String[] args) { - if (sender instanceof Player && + if (sender instanceof Player && !sender.isOp() && (!LibsPremium.isPremium() || LibsPremium.getPaidInformation() == LibsPremium.getPluginInformation())) { sender.sendMessage(ChatColor.RED + "Please purchase Lib's Disguises to enable player commands"); return true;