mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-27 20:27:37 +00:00
Blocked the /gamemode command.
Made it so /smite actually blocks non-superadmins :D
This commit is contained in:
parent
b2746f2299
commit
d23c99f3c5
@ -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
|
||||
{
|
||||
|
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user