Fixed some of the command's response messages.

This commit is contained in:
Steven Lawson 2011-09-20 17:10:13 -04:00
parent 21fa1835ae
commit f528d5be97
2 changed files with 22 additions and 2 deletions

View file

@ -17,7 +17,11 @@ public class TotalFreedomMod extends JavaPlugin
public void onEnable() public void onEnable()
{ {
log.log(Level.INFO, "[Total Freedom Mod] - Enabled! - Version: " + this.getDescription().getVersion() + " by Madgeek1450"); 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() public void onDisable()
@ -140,13 +144,21 @@ public class TotalFreedomMod extends JavaPlugin
if (sender.isOp() || player == null || isUserSuperadmin(sender.getName())) if (sender.isOp() || player == null || isUserSuperadmin(sender.getName()))
{ {
boolean matched_player = false;
for (Player p : Bukkit.matchPlayer(args[0])) for (Player p : Bukkit.matchPlayer(args[0]))
{ {
matched_player = true;
p.setOp(true); p.setOp(true);
Command.broadcastCommandMessage(sender, "Oping " + p.getName()); Command.broadcastCommandMessage(sender, "Oping " + p.getName());
p.sendMessage(ChatColor.YELLOW + "You are now op!"); p.sendMessage(ChatColor.YELLOW + "You are now op!");
log.log(Level.INFO, "[Total Freedom Mod]: " + sender.getName() + " op'd " + p.getName() + "."); log.log(Level.INFO, "[Total Freedom Mod]: " + sender.getName() + " op'd " + p.getName() + ".");
} }
if (!matched_player)
{
sender.sendMessage("No targets matched.");
}
} }
else else
{ {
@ -164,13 +176,21 @@ public class TotalFreedomMod extends JavaPlugin
if (sender.isOp() || player == null || isUserSuperadmin(sender.getName())) if (sender.isOp() || player == null || isUserSuperadmin(sender.getName()))
{ {
boolean matched_player = false;
for (Player p : Bukkit.matchPlayer(args[0])) for (Player p : Bukkit.matchPlayer(args[0]))
{ {
matched_player = true;
p.setOp(false); p.setOp(false);
Command.broadcastCommandMessage(sender, "De-opping " + p.getName()); Command.broadcastCommandMessage(sender, "De-opping " + p.getName());
p.sendMessage(ChatColor.YELLOW + "You are now op!"); p.sendMessage(ChatColor.YELLOW + "You are now op!");
log.log(Level.INFO, "[Total Freedom Mod]: " + sender.getName() + " de-op'd " + p.getName() + "."); log.log(Level.INFO, "[Total Freedom Mod]: " + sender.getName() + " de-op'd " + p.getName() + ".");
} }
if (!matched_player)
{
sender.sendMessage("No targets matched.");
}
} }
else else
{ {

View file

@ -1,6 +1,6 @@
name: TotalFreedomMod name: TotalFreedomMod
main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod main: me.StevenLawson.TotalFreedomMod.TotalFreedomMod
version: 1.0.1 version: 1.0.2
description: Plugin for the Total Freedom server description: Plugin for the Total Freedom server
author: StevenLawson / Madgeek1450 author: StevenLawson / Madgeek1450
commands: commands: