From 758c6286f8c32c017156f52b6e6495c524aa2c18 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Thu, 11 Jun 2015 03:21:59 +1000 Subject: [PATCH] Fixed command preprocess --- .../plot/listeners/PlayerEvents.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java index 7239ac8b8..e56e10fe2 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/listeners/PlayerEvents.java @@ -15,6 +15,7 @@ import org.bukkit.World; import org.bukkit.block.Block; import org.bukkit.block.BlockFace; import org.bukkit.block.BlockState; +import org.bukkit.command.PluginCommand; import org.bukkit.entity.Animals; import org.bukkit.entity.Arrow; import org.bukkit.entity.Creature; @@ -267,8 +268,13 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi @EventHandler public void PlayerCommand(final PlayerCommandPreprocessEvent event) { - final String message = event.getMessage(); - if (message.toLowerCase().startsWith("/plotme") || message.toLowerCase().startsWith("/ap")) { + final String message = event.getMessage().toLowerCase().replaceAll("/", ""); + String[] split = message.split(" "); + PluginCommand cmd = Bukkit.getServer().getPluginCommand(split[0]); + if (cmd != null) { + return; + } + if (split[0].equals("plotme") || split[0].equals("ap")) { final Player player = event.getPlayer(); if (Settings.USE_PLOTME_ALIAS) { player.performCommand(message.replace("/plotme", "plots"));