Blocked the /gamemode command.

Made it so /smite actually blocks non-superadmins :D
This commit is contained in:
Steven Lawson 2012-09-16 17:33:26 -04:00
parent b2746f2299
commit d23c99f3c5
2 changed files with 12 additions and 6 deletions

View File

@ -16,16 +16,17 @@ public class Command_smite extends TFM_Command
@Override @Override
public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole) public boolean run(CommandSender sender, Player sender_p, Command cmd, String commandLabel, String[] args, boolean senderIsConsole)
{ {
if (!TFM_Util.isUserSuperadmin(sender))
{
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
}
if (args.length != 1) if (args.length != 1)
{ {
return false; return false;
} }
if (!TFM_Util.isUserSuperadmin(sender))
{
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
return true;
}
Player p; Player p;
try try
{ {

View File

@ -444,6 +444,11 @@ public class TFM_PlayerListener implements Listener
p.sendMessage(ChatColor.GRAY + "This server now uses DisguiseCraft instead of MobDisguise. Type /d to disguise and /u to undisguise."); p.sendMessage(ChatColor.GRAY + "This server now uses DisguiseCraft instead of MobDisguise. Type /d to disguise and /u to undisguise.");
block_command = true; block_command = true;
} }
else if (Pattern.compile("^/gamemode").matcher(command).find())
{
p.sendMessage(ChatColor.GRAY + "Use /creative and /survival to set your gamemode.");
block_command = true;
}
else if (Pattern.compile("^/ban").matcher(command).find()) else if (Pattern.compile("^/ban").matcher(command).find())
{ {
if (!Pattern.compile("^/banlist").matcher(command).find()) if (!Pattern.compile("^/banlist").matcher(command).find())
@ -473,7 +478,7 @@ public class TFM_PlayerListener implements Listener
if (block_command) if (block_command)
{ {
p.sendMessage(ChatColor.RED + "That command is prohibited."); p.sendMessage(ChatColor.GRAY + "That command is blocked.");
event.setCancelled(true); event.setCancelled(true);
return; return;
} }