Add the modify disguises quotes, and translate colorcodes

This commit is contained in:
libraryaddict 2017-12-09 08:58:48 +13:00
parent 94fa3f0a1d
commit 51b4d806ae
5 changed files with 7 additions and 6 deletions

View File

@ -60,7 +60,7 @@ public class DisguiseModifyCommand extends DisguiseBaseCommand implements TabCom
try {
DisguiseParser
.callMethods(sender, disguise, getPermissions(sender).get(new DisguisePerm(disguise.getType())),
new ArrayList<String>(), args);
new ArrayList<String>(), DisguiseParser.split(StringUtils.join(args)));
}
catch (DisguiseParseException ex) {
if (ex.getMessage() != null) {

View File

@ -2,11 +2,11 @@ package me.libraryaddict.disguise.commands;
import me.libraryaddict.disguise.DisguiseConfig;
import me.libraryaddict.disguise.LibsDisguises;
import me.libraryaddict.disguise.utilities.DisguiseParser;
import me.libraryaddict.disguise.utilities.DisguiseParser.DisguisePerm;
import me.libraryaddict.disguise.utilities.LibsMsg;
import me.libraryaddict.disguise.utilities.ReflectionFlagWatchers;
import me.libraryaddict.disguise.utilities.ReflectionFlagWatchers.ParamInfo;
import me.libraryaddict.disguise.utilities.TranslateType;
import org.apache.commons.lang.StringUtils;
import org.bukkit.Bukkit;
import org.bukkit.ChatColor;
@ -41,7 +41,8 @@ public class DisguiseModifyEntityCommand extends DisguiseBaseCommand implements
// TODO Validate if any disguises have this arg
LibsDisguises.getInstance().getListener().setDisguiseModify(sender.getName(), args);
LibsDisguises.getInstance().getListener().setDisguiseModify(sender.getName(), DisguiseParser
.split(StringUtils.join(args)));
sender.sendMessage(LibsMsg.DMODIFYENT_CLICK.get(DisguiseConfig.getDisguiseEntityExpire()));
return true;

View File

@ -72,7 +72,7 @@ public class DisguiseModifyPlayerCommand extends DisguiseBaseCommand implements
try {
DisguiseParser.callMethods(sender, disguise, map.get(new DisguisePerm(disguise.getType())),
new ArrayList<String>(), newArgs);
new ArrayList<String>(), DisguiseParser.split(StringUtils.join(newArgs)));
}
catch (DisguiseParseException ex) {
if (ex.getMessage() != null) {

View File

@ -149,7 +149,7 @@ public class DisguiseModifyRadiusCommand extends DisguiseBaseCommand implements
try {
DisguiseParser.callMethods(sender, disguise, map.get(new DisguisePerm(disguise.getType())),
new ArrayList<String>(), newArgs);
new ArrayList<String>(), DisguiseParser.split(StringUtils.join(newArgs)));
modifiedDisguises++;
}
catch (DisguiseParseException ex) {

View File

@ -439,7 +439,7 @@ public class DisguiseParser {
* Splits a string while respecting quotes
*/
public static String[] split(String string) {
return string.split(" (?=\")|(?<=\")\\s");
return ChatColor.translateAlternateColorCodes('&', string).split(" (?=\")|(?<=\")\\s");
}
/**