From d968b9878c8268b803d58ec9c2f9d5a5a2c26b80 Mon Sep 17 00:00:00 2001 From: drtshock Date: Sat, 5 Jul 2014 13:20:07 -0500 Subject: [PATCH] Listen to commands to see if they should be allowed. Fixes issue #26. --- .../factions/zcore/MPluginSecretPlayerListener.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/main/java/com/massivecraft/factions/zcore/MPluginSecretPlayerListener.java b/src/main/java/com/massivecraft/factions/zcore/MPluginSecretPlayerListener.java index 87275147..3de13a87 100644 --- a/src/main/java/com/massivecraft/factions/zcore/MPluginSecretPlayerListener.java +++ b/src/main/java/com/massivecraft/factions/zcore/MPluginSecretPlayerListener.java @@ -2,6 +2,7 @@ package com.massivecraft.factions.zcore; import com.massivecraft.factions.Conf; import com.massivecraft.factions.P; +import com.massivecraft.factions.listeners.FactionsPlayerListener; import com.massivecraft.factions.zcore.persist.EM; import com.massivecraft.factions.zcore.persist.Entity; import com.massivecraft.factions.zcore.persist.EntityCollection; @@ -22,10 +23,9 @@ public class MPluginSecretPlayerListener implements Listener { this.p = p; } - // We're now using FCommandHandler for this to do things properly. - //@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) + @EventHandler(priority = EventPriority.LOW, ignoreCancelled = true) public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) { - if (p.handleCommand(event.getPlayer(), event.getMessage())) { + if (FactionsPlayerListener.preventCommand(event.getMessage(), event.getPlayer())) { if (p.logPlayerCommands()) { Bukkit.getLogger().info("[PLAYER_COMMAND] " + event.getPlayer().getName() + ": " + event.getMessage()); }