From 75b5fd2bb066d1d1962321687e19f99b8e7a20ab Mon Sep 17 00:00:00 2001 From: NorbiPeti Date: Sat, 18 Jun 2016 23:31:56 +0200 Subject: [PATCH] Made the command execute at it's executor --- src/io/github/norbipeti/onecommandhelper/Commands.java | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/io/github/norbipeti/onecommandhelper/Commands.java b/src/io/github/norbipeti/onecommandhelper/Commands.java index 699f537..6ec39e0 100644 --- a/src/io/github/norbipeti/onecommandhelper/Commands.java +++ b/src/io/github/norbipeti/onecommandhelper/Commands.java @@ -12,8 +12,8 @@ import org.bukkit.entity.Player; public class Commands implements CommandExecutor { - private final String[] replacecmds = { "achievement", "ban", - "ban-ip", "banlist", "blockdata", "clear", "clone", "debug", + private final String[] replacecmds = { "achievement", "ban", "ban-ip", + "banlist", "blockdata", "clear", "clone", "debug", "defaultgamemode", "deop", "difficulty", "effect", "enchant", "entitydata", "execute", "fill", "gamemode", "gamerule", "give", "help", "kick", "kill", "list", "me", "op", "pardon", "particle", @@ -30,7 +30,8 @@ public class Commands implements CommandExecutor public boolean onCommand(CommandSender sender, Command cmd, String alias, String[] args) { - StringBuilder acmdb = new StringBuilder("minecraft:execute @p ~ ~ ~"); + StringBuilder acmdb = new StringBuilder("minecraft:execute " + + sender.getName() + " ~ ~ ~"); if (sender != Bukkit.getConsoleSender() && !(sender instanceof BlockCommandSender)) { @@ -44,8 +45,7 @@ public class Commands implements CommandExecutor } CommandBlock cmdblock = (CommandBlock) block.getState(); acmdb.append(" ").append(cmdblock.getCommand()); - } - else + } else { if (args.length == 0) {