fix for factions-specific commands not being prevented properly if they were in "territoryNeutralDenyCommands" or "territoryEnemyDenyCommands"

also got rid of a command preprocess listener which is now unnecessary
This commit is contained in:
Brettflan
2012-01-18 22:42:58 -06:00
parent 960aca6240
commit b4450b3bdb
3 changed files with 19 additions and 22 deletions

View File

@@ -9,6 +9,7 @@ import java.util.Set;
import org.bukkit.block.Block;
import org.bukkit.Location;
import org.bukkit.Material;
import org.bukkit.command.CommandSender;
import org.bukkit.entity.Player;
import org.bukkit.event.Event;
import org.bukkit.event.player.PlayerChatEvent;
@@ -112,7 +113,6 @@ public class P extends MPlugin
// Player Events
this.registerEvent(Event.Type.PLAYER_CHAT, this.playerListener, Event.Priority.Highest);
this.registerEvent(Event.Type.PLAYER_CHAT, this.chatEarlyListener, Event.Priority.Lowest);
this.registerEvent(Event.Type.PLAYER_COMMAND_PREPROCESS, this.playerListener, Event.Priority.Normal);
this.registerEvent(Event.Type.PLAYER_INTERACT, this.playerListener, Event.Priority.Normal);
this.registerEvent(Event.Type.PLAYER_MOVE, this.playerListener, Event.Priority.Normal);
this.registerEvent(Event.Type.PLAYER_JOIN, this.playerListener, Event.Priority.Normal);
@@ -182,6 +182,14 @@ public class P extends MPlugin
Conf.save();
}
@Override
public boolean handleCommand(CommandSender sender, String commandString, boolean testOnly)
{
if (sender instanceof Player && FactionsPlayerListener.preventCommand(commandString, (Player)sender)) return true;
return super.handleCommand(sender, commandString, testOnly);
}
// -------------------------------------------- //
// Integration with other plugins
// -------------------------------------------- //