mirror of
https://github.com/AtlasMediaGroup/TotalFreedomMod.git
synced 2024-11-27 09:15:38 +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.VERSION=3.00
|
||||||
program.BUILDNUM=459
|
program.BUILDNUM=461
|
||||||
program.BUILDDATE=08/14/2013 03\:57 PM
|
program.BUILDDATE=08/18/2013 04\:44 PM
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
#Build Number for ANT. Do not edit!
|
#Build Number for ANT. Do not edit!
|
||||||
#Wed Aug 14 15:57:37 CEST 2013
|
#Sun Aug 18 16:44:40 EDT 2013
|
||||||
build.number=460
|
build.number=462
|
||||||
|
@ -550,7 +550,7 @@ public class TFM_PlayerListener implements Listener
|
|||||||
command = command.toLowerCase().trim();
|
command = command.toLowerCase().trim();
|
||||||
|
|
||||||
// Blocked commands
|
// Blocked commands
|
||||||
if (TFM_CommandBlockerNew.getInstance().isCommandBlocked(command, event.getPlayer()))
|
if (TFM_CommandBlocker.getInstance().isCommandBlocked(command, event.getPlayer()))
|
||||||
{
|
{
|
||||||
// CommandBlocker handles messages and broadcasts
|
// CommandBlocker handles messages and broadcasts
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
|
@ -3,7 +3,7 @@ package me.StevenLawson.TotalFreedomMod.Listener;
|
|||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
import java.util.regex.Pattern;
|
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_ConfigEntry;
|
||||||
import me.StevenLawson.TotalFreedomMod.TFM_ServerInterface;
|
import me.StevenLawson.TotalFreedomMod.TFM_ServerInterface;
|
||||||
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
import me.StevenLawson.TotalFreedomMod.TFM_SuperadminList;
|
||||||
@ -52,7 +52,7 @@ public class TFM_ServerListener implements Listener
|
|||||||
topLevelCommand = topLevelCommand.toLowerCase().trim();
|
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:
|
// 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.");
|
player.sendMessage(ChatColor.GRAY + "That command is blocked.");
|
||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
@ -64,7 +64,7 @@ public class TFM_ServerListener implements Listener
|
|||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void onRemoteServerCommand(RemoteServerCommandEvent event)
|
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("");
|
event.setCommand("");
|
||||||
}
|
}
|
||||||
@ -73,7 +73,7 @@ public class TFM_ServerListener implements Listener
|
|||||||
@EventHandler(priority = EventPriority.NORMAL)
|
@EventHandler(priority = EventPriority.NORMAL)
|
||||||
public void onServerCommand(ServerCommandEvent event)
|
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("");
|
event.setCommand("");
|
||||||
}
|
}
|
||||||
|
@ -12,11 +12,11 @@ import org.bukkit.command.CommandMap;
|
|||||||
import org.bukkit.command.CommandSender;
|
import org.bukkit.command.CommandSender;
|
||||||
import org.bukkit.entity.Player;
|
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 Map<String, TFM_CommandBlocker_BlockedCommandEntry> blockedCommands = new HashMap<String, TFM_CommandBlocker_BlockedCommandEntry>();
|
||||||
|
|
||||||
private TFM_CommandBlockerNew()
|
private TFM_CommandBlocker()
|
||||||
{
|
{
|
||||||
parseBlockingRules();
|
parseBlockingRules();
|
||||||
}
|
}
|
||||||
@ -319,13 +319,13 @@ public class TFM_CommandBlockerNew
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TFM_CommandBlockerNew getInstance()
|
public static TFM_CommandBlocker getInstance()
|
||||||
{
|
{
|
||||||
return TFM_CommandBlockerNewHolder.INSTANCE;
|
return TFM_CommandBlockerNewHolder.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static class TFM_CommandBlockerNewHolder
|
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()
|
public void run()
|
||||||
{
|
{
|
||||||
TFM_CommandLoader.getInstance().scan();
|
TFM_CommandLoader.getInstance().scan();
|
||||||
TFM_CommandBlockerNew.getInstance().parseBlockingRules();
|
TFM_CommandBlocker.getInstance().parseBlockingRules();
|
||||||
}
|
}
|
||||||
}.runTaskLater(this, 20L);
|
}.runTaskLater(this, 20L);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user