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
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)
{
return false;
}
if (!TFM_Util.isUserSuperadmin(sender))
{
sender.sendMessage(TotalFreedomMod.MSG_NO_PERMS);
return true;
}
Player p;
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.");
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())
{
if (!Pattern.compile("^/banlist").matcher(command).find())
@ -473,7 +478,7 @@ public class TFM_PlayerListener implements Listener
if (block_command)
{
p.sendMessage(ChatColor.RED + "That command is prohibited.");
p.sendMessage(ChatColor.GRAY + "That command is blocked.");
event.setCancelled(true);
return;
}