mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 01:05:38 +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
|
@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
|
||||||
{
|
{
|
||||||
|
@ -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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user