Read below for more info

Added /grabskin - Grabs a skin from file, url or existing player and saves as a new skin name
Added /copydisguise - Outputs the current disguise or a specific uuid/player disguise to a usable string
Added /savedisguise - Saves a disguise to custom disguises (disguises.yml) for future use, accepts skin files, urls and existing players
Using MineSkin.org API
Now generates Skins folder with info inside
Added addGameProfile, addCustomDisguise and parseToString to DisguiseAPI
Added different checks to gameprofiles
Added new messages for the new features
Fixed disguise parser to string handling quotes and skins wrong
Fixed disguise parser to string not replacing colors back to the &
Changed itemstack params to parse to a simpler item if possible
This commit is contained in:
libraryaddict
2020-01-02 17:10:36 +13:00
parent da6f98a3d7
commit c073af37e8
17 changed files with 1355 additions and 57 deletions

View File

@@ -18,6 +18,6 @@ public class ParamInfoString extends ParamInfo {
@Override
public String toString(Object object) {
return object.toString();
return ((String) object).replace(ChatColor.COLOR_CHAR + "", "&");
}
}

View File

@@ -1,6 +1,7 @@
package me.libraryaddict.disguise.utilities.parser.params.types.custom;
import me.libraryaddict.disguise.utilities.DisguiseUtilities;
import me.libraryaddict.disguise.utilities.translations.LibsMsg;
import me.libraryaddict.disguise.utilities.translations.TranslateType;
import me.libraryaddict.disguise.utilities.parser.params.types.ParamInfoEnum;
import org.bukkit.Material;
@@ -36,6 +37,27 @@ public class ParamInfoItemStack extends ParamInfoEnum {
@Override
public String toString(Object object) {
ItemStack itemStack = (ItemStack) object;
ItemStack temp = new ItemStack(itemStack.getType(), itemStack.getAmount());
if (itemStack.containsEnchantment(Enchantment.DURABILITY)) {
temp.addUnsafeEnchantment(Enchantment.DURABILITY, 1);
}
if (temp.isSimilar(itemStack)) {
String name = itemStack.getType().name();
if (itemStack.getAmount() != 1) {
name += ":" + itemStack.getAmount();
}
if (itemStack.containsEnchantment(Enchantment.DURABILITY)) {
name += ":" + TranslateType.DISGUISE_OPTIONS_PARAMETERS.get("glow");
}
return name;
}
return DisguiseUtilities.getGson().toJson(object);
}

View File

@@ -39,7 +39,30 @@ public class ParamInfoItemStackArray extends ParamInfoItemStack {
@Override
public String toString(Object object) {
return DisguiseUtilities.getGson().toJson(object);
ItemStack[] stacks = (ItemStack[]) object;
String returns = "";
for (int i = 0; i < stacks.length; i++) {
if (i > 0) {
returns += ",";
}
if (stacks[i] == null) {
continue;
}
String toString = super.toString(stacks[i]);
// If we can't parse to simple
if (toString.startsWith("{")) {
return DisguiseUtilities.getGson().toJson(object);
}
returns += toString;
}
return returns;
}
@Override