diff --git a/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java b/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java index c56c517..978749b 100644 --- a/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java +++ b/src/me/StevenLawson/TotalFreedomMod/TotalFreedomMod.java @@ -17,7 +17,11 @@ public class TotalFreedomMod extends JavaPlugin public void onEnable() { log.log(Level.INFO, "[Total Freedom Mod] - Enabled! - Version: " + this.getDescription().getVersion() + " by Madgeek1450"); - log.log(Level.WARNING, "[Total Freedom Mod]: In-game superadmin commands wont work if online-mode is set to false!"); + + if (!Bukkit.getOnlineMode()) + { + log.log(Level.WARNING, "[Total Freedom Mod]: 'online-mode' is set to FALSE in server.properties. This must be set to TRUE in order for in-game superadmin commands to work."); + } } public void onDisable() @@ -140,13 +144,21 @@ public class TotalFreedomMod extends JavaPlugin if (sender.isOp() || player == null || isUserSuperadmin(sender.getName())) { + boolean matched_player = false; for (Player p : Bukkit.matchPlayer(args[0])) { + matched_player = true; + p.setOp(true); + Command.broadcastCommandMessage(sender, "Oping " + p.getName()); p.sendMessage(ChatColor.YELLOW + "You are now op!"); log.log(Level.INFO, "[Total Freedom Mod]: " + sender.getName() + " op'd " + p.getName() + "."); } + if (!matched_player) + { + sender.sendMessage("No targets matched."); + } } else { @@ -164,13 +176,21 @@ public class TotalFreedomMod extends JavaPlugin if (sender.isOp() || player == null || isUserSuperadmin(sender.getName())) { + boolean matched_player = false; for (Player p : Bukkit.matchPlayer(args[0])) { + matched_player = true; + p.setOp(false); + Command.broadcastCommandMessage(sender, "De-opping " + p.getName()); p.sendMessage(ChatColor.YELLOW + "You are now op!"); log.log(Level.INFO, "[Total Freedom Mod]: " + sender.getName() + " de-op'd " + p.getName() + "."); } + if (!matched_player) + { + sender.sendMessage("No targets matched."); + } } else { diff --git a/src/plugin.yml b/src/plugin.yml index bf30628..ec77423 100644 --- a/src/plugin.yml +++ b/src/plugin.yml @@ -1,6 +1,6 @@ name: TotalFreedomMod main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod -version: 1.0.1 +version: 1.0.2 description: Plugin for the Total Freedom server author: StevenLawson / Madgeek1450 commands: