mirror of
https://github.com/IntellectualSites/PlotSquared.git
synced 2024-11-29 16:46:45 +01:00
Fixed command preprocess
This commit is contained in:
parent
f8fcb96915
commit
758c6286f8
@ -15,6 +15,7 @@ import org.bukkit.World;
|
|||||||
import org.bukkit.block.Block;
|
import org.bukkit.block.Block;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.block.BlockState;
|
import org.bukkit.block.BlockState;
|
||||||
|
import org.bukkit.command.PluginCommand;
|
||||||
import org.bukkit.entity.Animals;
|
import org.bukkit.entity.Animals;
|
||||||
import org.bukkit.entity.Arrow;
|
import org.bukkit.entity.Arrow;
|
||||||
import org.bukkit.entity.Creature;
|
import org.bukkit.entity.Creature;
|
||||||
@ -267,8 +268,13 @@ public class PlayerEvents extends com.intellectualcrafters.plot.listeners.PlotLi
|
|||||||
|
|
||||||
@EventHandler
|
@EventHandler
|
||||||
public void PlayerCommand(final PlayerCommandPreprocessEvent event) {
|
public void PlayerCommand(final PlayerCommandPreprocessEvent event) {
|
||||||
final String message = event.getMessage();
|
final String message = event.getMessage().toLowerCase().replaceAll("/", "");
|
||||||
if (message.toLowerCase().startsWith("/plotme") || message.toLowerCase().startsWith("/ap")) {
|
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();
|
final Player player = event.getPlayer();
|
||||||
if (Settings.USE_PLOTME_ALIAS) {
|
if (Settings.USE_PLOTME_ALIAS) {
|
||||||
player.performCommand(message.replace("/plotme", "plots"));
|
player.performCommand(message.replace("/plotme", "plots"));
|
||||||
|
Loading…
Reference in New Issue
Block a user