mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-12-28 12:47:36 +00:00
Finish getting rid of old command blocker.
This commit is contained in:
parent
4494a4c039
commit
5c32c66390
@ -1,5 +1,5 @@
|
||||
#Wed, 14 Aug 2013 15:57:37 +0200
|
||||
#Sun, 18 Aug 2013 16:44:40 -0400
|
||||
|
||||
program.VERSION=3.00
|
||||
program.BUILDNUM=459
|
||||
program.BUILDDATE=08/14/2013 03\:57 PM
|
||||
program.BUILDNUM=461
|
||||
program.BUILDDATE=08/18/2013 04\:44 PM
|
||||
|
@ -1,3 +1,3 @@
|
||||
#Build Number for ANT. Do not edit!
|
||||
#Wed Aug 14 15:57:37 CEST 2013
|
||||
build.number=460
|
||||
#Sun Aug 18 16:44:40 EDT 2013
|
||||
build.number=462
|
||||
|
@ -550,7 +550,7 @@ public class TFM_PlayerListener implements Listener
|
||||
command = command.toLowerCase().trim();
|
||||
|
||||
// Blocked commands
|
||||
if (TFM_CommandBlockerNew.getInstance().isCommandBlocked(command, event.getPlayer()))
|
||||
if (TFM_CommandBlocker.getInstance().isCommandBlocked(command, event.getPlayer()))
|
||||
{
|
||||
// CommandBlocker handles messages and broadcasts
|
||||
event.setCancelled(true);
|
||||
|
@ -3,7 +3,7 @@ package me.StevenLawson.TotalFreedomMod.Listener;
|
||||
import java.util.Set;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_CommandBlockerNew;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_CommandBlocker;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_ConfigEntry;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_ServerInterface;
|
||||
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
||||
@ -52,7 +52,7 @@ public class TFM_ServerListener implements Listener
|
||||
topLevelCommand = topLevelCommand.toLowerCase().trim();
|
||||
|
||||
// We need to make it look like the command is coming from the console, so keep the player's name without the Player instance via dummy:
|
||||
if (TFM_CommandBlockerNew.getInstance().isCommandBlocked(topLevelCommand, new TFM_ServerListener_DummyCommandSender(player.getName()), false))
|
||||
if (TFM_CommandBlocker.getInstance().isCommandBlocked(topLevelCommand, new TFM_ServerListener_DummyCommandSender(player.getName()), false))
|
||||
{
|
||||
player.sendMessage(ChatColor.GRAY + "That command is blocked.");
|
||||
event.setCancelled(true);
|
||||
@ -64,7 +64,7 @@ public class TFM_ServerListener implements Listener
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onRemoteServerCommand(RemoteServerCommandEvent event)
|
||||
{
|
||||
if (TFM_CommandBlockerNew.getInstance().isCommandBlocked(event.getCommand(), event.getSender()))
|
||||
if (TFM_CommandBlocker.getInstance().isCommandBlocked(event.getCommand(), event.getSender()))
|
||||
{
|
||||
event.setCommand("");
|
||||
}
|
||||
@ -73,7 +73,7 @@ public class TFM_ServerListener implements Listener
|
||||
@EventHandler(priority = EventPriority.NORMAL)
|
||||
public void onServerCommand(ServerCommandEvent event)
|
||||
{
|
||||
if (TFM_CommandBlockerNew.getInstance().isCommandBlocked(event.getCommand(), event.getSender()))
|
||||
if (TFM_CommandBlocker.getInstance().isCommandBlocked(event.getCommand(), event.getSender()))
|
||||
{
|
||||
event.setCommand("");
|
||||
}
|
||||
|
@ -12,11 +12,11 @@ import org.bukkit.command.CommandMap;
|
||||
import org.bukkit.command.CommandSender;
|
||||
import org.bukkit.entity.Player;
|
||||
|
||||
public class TFM_CommandBlockerNew
|
||||
public class TFM_CommandBlocker
|
||||
{
|
||||
private Map<String, TFM_CommandBlocker_BlockedCommandEntry> blockedCommands = new HashMap<String, TFM_CommandBlocker_BlockedCommandEntry>();
|
||||
|
||||
private TFM_CommandBlockerNew()
|
||||
private TFM_CommandBlocker()
|
||||
{
|
||||
parseBlockingRules();
|
||||
}
|
||||
@ -319,13 +319,13 @@ public class TFM_CommandBlockerNew
|
||||
}
|
||||
}
|
||||
|
||||
public static TFM_CommandBlockerNew getInstance()
|
||||
public static TFM_CommandBlocker getInstance()
|
||||
{
|
||||
return TFM_CommandBlockerNewHolder.INSTANCE;
|
||||
}
|
||||
|
||||
private static class TFM_CommandBlockerNewHolder
|
||||
{
|
||||
private static final TFM_CommandBlockerNew INSTANCE = new TFM_CommandBlockerNew();
|
||||
private static final TFM_CommandBlocker INSTANCE = new TFM_CommandBlocker();
|
||||
}
|
||||
}
|
@ -152,7 +152,7 @@ public class TotalFreedomMod extends JavaPlugin
|
||||
public void run()
|
||||
{
|
||||
TFM_CommandLoader.getInstance().scan();
|
||||
TFM_CommandBlockerNew.getInstance().parseBlockingRules();
|
||||
TFM_CommandBlocker.getInstance().parseBlockingRules();
|
||||
}
|
||||
}.runTaskLater(this, 20L);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user