diff --git a/pom.xml b/pom.xml index 83181a57..686c61d5 100644 --- a/pom.xml +++ b/pom.xml @@ -75,6 +75,7 @@ 4.13.1 [1.16,] 1.12-SNAPSHOT + 4.1.0-SNAPSHOT @@ -129,6 +130,11 @@ ${bungeecord-chat.version} true + + net.kyori + adventure-text-minimessage + ${adventure.version} + diff --git a/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java b/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java index 6326df78..0fba0663 100644 --- a/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java +++ b/src/main/java/me/libraryaddict/disguise/disguisetypes/FlagWatcher.java @@ -4,10 +4,7 @@ import com.comphenix.protocol.PacketType.Play.Server; import com.comphenix.protocol.ProtocolLibrary; import com.comphenix.protocol.events.PacketContainer; import com.comphenix.protocol.reflect.StructureModifier; -import com.comphenix.protocol.wrappers.ComponentConverter; -import com.comphenix.protocol.wrappers.WrappedChatComponent; -import com.comphenix.protocol.wrappers.WrappedDataWatcher; -import com.comphenix.protocol.wrappers.WrappedWatchableObject; +import com.comphenix.protocol.wrappers.*; import com.google.common.base.Strings; import com.mojang.datafixers.util.Pair; import lombok.AccessLevel; @@ -572,8 +569,15 @@ public class FlagWatcher { } if (NmsVersion.v1_13.isSupported()) { - setData(MetaIndex.ENTITY_CUSTOM_NAME, - Optional.of(WrappedChatComponent.fromJson(ComponentSerializer.toString(DisguiseUtilities.getColoredChat(name))))); + Optional optional; + + if (DisguiseUtilities.hasAdventureTextSupport()) { + optional = Optional.of(AdventureComponentConverter.fromComponent(DisguiseUtilities.getAdventureChat(name))); + } else { + optional = Optional.of(WrappedChatComponent.fromJson(ComponentSerializer.toString(DisguiseUtilities.getColoredChat(name)))); + } + + setData(MetaIndex.ENTITY_CUSTOM_NAME, optional); } else { setData(MetaIndex.ENTITY_CUSTOM_NAME_OLD, name); } diff --git a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java index 2a5e90eb..c3fd964f 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/DisguiseUtilities.java @@ -35,6 +35,9 @@ import me.libraryaddict.disguise.utilities.reflection.NmsVersion; import me.libraryaddict.disguise.utilities.reflection.ReflectionManager; import me.libraryaddict.disguise.utilities.translations.LibsMsg; import me.libraryaddict.disguise.utilities.watchers.CompileMethods; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.minimessage.MiniMessage; +import net.kyori.adventure.text.serializer.gson.GsonComponentSerializer; import net.md_5.bungee.api.chat.BaseComponent; import net.md_5.bungee.api.chat.ClickEvent; import net.md_5.bungee.api.chat.TextComponent; @@ -197,6 +200,7 @@ public class DisguiseUtilities { private final static boolean java16; private static boolean criedOverJava16; private static HashSet warnedSkin = new HashSet<>(); + private static Boolean adventureTextSupport; static { final Matcher matcher = Pattern.compile("(?:1\\.)?(\\d+)").matcher(System.getProperty("java.version")); @@ -215,6 +219,19 @@ public class DisguiseUtilities { } } + public static boolean hasAdventureTextSupport() { + if (adventureTextSupport == null) { + try { + Class.forName("net.kyori.adventure.text.minimessage.MiniMessage"); + adventureTextSupport = true; + } catch (ClassNotFoundException ex) { + adventureTextSupport = false; + } + } + + return adventureTextSupport; + } + public static void doSkinUUIDWarning(CommandSender sender) { if (!(sender instanceof Player)) { return; @@ -2421,16 +2438,16 @@ public class DisguiseUtilities { } public static void sendMessage(CommandSender sender, String message) { + if (message.isEmpty()) { + return; + } + if (!NmsVersion.v1_16.isSupported()) { - if (!message.isEmpty()) { - sender.sendMessage(message); - } + sender.sendMessage(message); } else { BaseComponent[] components = getColoredChat(message); - if (components.length > 0) { - sender.spigot().sendMessage(components); - } + sender.spigot().sendMessage(components); } } @@ -2516,6 +2533,10 @@ public class DisguiseUtilities { return ChatColor.translateAlternateColorCodes('&', string); } + public static Component getAdventureChat(String message) { + return MiniMessage.get().parse(message); + } + /** * Modification of TextComponent.fromLegacyText */ @@ -2524,6 +2545,10 @@ public class DisguiseUtilities { return new BaseComponent[0]; } + if (hasAdventureTextSupport()) { + return ComponentSerializer.parse(GsonComponentSerializer.gson().serialize(getAdventureChat(message))); + } + ArrayList components = new ArrayList(); StringBuilder builder = new StringBuilder(); TextComponent component = new TextComponent(); diff --git a/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java b/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java index 667bd300..9acaafcb 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/translations/LibsMsg.java @@ -6,322 +6,319 @@ import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.command.CommandSender; +import java.util.Locale; + /** * Created by libraryaddict on 15/06/2017. */ public enum LibsMsg { - NO_DISGUISES_IN_USE(ChatColor.RED + "There are no disguises in use!"), - ACTIVE_DISGUISES_COUNT(ChatColor.DARK_GREEN + "There are %s disguises active"), - ACTIVE_DISGUISES_DISGUISE(ChatColor.GREEN + "%s: " + ChatColor.AQUA + "%s"), - ACTIVE_DISGUISES(ChatColor.DARK_GREEN + "The disguises in use are: %s"), - ACTIVE_DISGUISES_SEPERATOR(ChatColor.RED + ", " + ChatColor.GREEN), - BLOWN_DISGUISE(ChatColor.RED + "Your disguise was blown!"), - EXPIRED_DISGUISE(ChatColor.RED + "Your disguise has expired!"), - CAN_USE_DISGS(ChatColor.DARK_GREEN + "You can use the disguises:" + ChatColor.GREEN + " %s"), - CAN_USE_DISGS_SEPERATOR(ChatColor.RED + ", " + ChatColor.GREEN), - CANNOT_FIND_PLAYER(ChatColor.RED + "Cannot find the player/uuid '%s'"), - CANNOT_FIND_PLAYER_NAME(ChatColor.RED + "Cannot find the player '%s'"), - CANNOT_FIND_PLAYER_UUID(ChatColor.RED + "Cannot find the uuid '%s'"), - CLICK_TIMER(ChatColor.RED + "Right click a entity in the next %s seconds to grab the disguise reference!"), - CLONE_HELP1(ChatColor.DARK_GREEN + "Right click a entity to get a disguise reference you can pass to other disguise commands!"), - CLONE_HELP2(ChatColor.DARK_GREEN + "Security note: Any references you create will be available to all players able to use disguise " + "references."), - CLONE_HELP3( - ChatColor.DARK_GREEN + "/disguiseclone IgnoreEquipment" + ChatColor.DARK_GREEN + "(" + ChatColor.GREEN + "Optional" + ChatColor.DARK_GREEN + ")"), - CUSTOM_DISGUISE_SAVED(ChatColor.GOLD + "Custom disguise has been saved as '%s'!"), - D_HELP1(ChatColor.DARK_GREEN + "Disguise another player!"), - D_HELP3(ChatColor.DARK_GREEN + "/disguiseplayer player "), - D_HELP4(ChatColor.DARK_GREEN + "/disguiseplayer "), - D_HELP5(ChatColor.DARK_GREEN + "/disguiseplayer "), - D_PARSE_NOPERM(ChatColor.RED + "You do not have permission to use the method %s"), - DHELP_CANTFIND(ChatColor.RED + "Cannot find the disguise %s"), - DHELP_HELP1(ChatColor.RED + "/disguisehelp " + ChatColor.GREEN + - "- View the methods you can set on a disguise. Add 'show' to reveal the methods you don't have permission" + " to use"), - DHELP_HELP2(ChatColor.RED + "/disguisehelp " + ChatColor.GREEN + "- View information about the " + "disguise values such as 'RabbitType'"), - DHELP_HELP3(ChatColor.RED + "/disguisehelp " + ChatColor.DARK_GREEN + "%s" + ChatColor.GREEN + " - %s"), - DHELP_HELP4(ChatColor.RED + "%s: " + ChatColor.GREEN + "%s"), - DHELP_HELP4_SEPERATOR(ChatColor.RED + ", " + ChatColor.GREEN), - DHELP_HELP5(ChatColor.RED + "%s: " + ChatColor.GREEN + "%s"), - DHELP_HELP6(ChatColor.RED + "%s: " + ChatColor.DARK_GREEN + "%s " + ChatColor.GREEN + "%s"), + NO_DISGUISES_IN_USE("There are no disguises in use!"), + ACTIVE_DISGUISES_COUNT("There are %s disguises active"), + ACTIVE_DISGUISES_DISGUISE("%s: %s"), + ACTIVE_DISGUISES("The disguises in use are: %s"), + ACTIVE_DISGUISES_SEPERATOR(", "), + BLOWN_DISGUISE("Your disguise was blown!"), + EXPIRED_DISGUISE("Your disguise has expired!"), + CAN_USE_DISGS("You can use the disguises: %s"), + CAN_USE_DISGS_SEPERATOR(", "), + CANNOT_FIND_PLAYER("Cannot find the player/uuid '%s'"), + CANNOT_FIND_PLAYER_NAME("Cannot find the player '%s'"), + CANNOT_FIND_PLAYER_UUID("Cannot find the uuid '%s'"), + CLICK_TIMER("Right click a entity in the next %s seconds to grab the disguise reference!"), + CLONE_HELP1("Right click a entity to get a disguise reference you can pass to other disguise commands!"), + CLONE_HELP2("Security note: Any references you create will be available to all players able to use disguise references."), + CLONE_HELP3("/disguiseclone IgnoreEquipment(Optional)"), + CUSTOM_DISGUISE_SAVED("Custom disguise has been saved as '%s'!"), + D_HELP1("Disguise another player!"), + D_HELP3("/disguiseplayer player "), + D_HELP4("/disguiseplayer "), + D_HELP5("/disguiseplayer "), + D_PARSE_NOPERM("You do not have permission to use the method %s"), + DHELP_CANTFIND("Cannot find the disguise %s"), + DHELP_HELP1("/disguisehelp " + + "- View the methods you can set on a disguise. Add 'show' to reveal the methods you don't have permission to use"), + DHELP_HELP2("/disguisehelp - View information about the disguise values such as 'RabbitType'"), + DHELP_HELP3("/disguisehelp %s - %s"), + DHELP_HELP4("%s: %s"), + DHELP_HELP4_SEPERATOR(", "), + DHELP_HELP5("%s: %s"), + DHELP_HELP6("%s: %s %s"), DHELP_OPTIONS("%s options: %s"), - DISABLED_LIVING_TO_MISC(ChatColor.RED + "Can't disguise a living entity as a misc disguise. This has been disabled in the config!"), - DISG_ENT_CLICK(ChatColor.RED + "Right click an entity in the next %s seconds to disguise it as a %s!"), - DISG_ENT_HELP1(ChatColor.DARK_GREEN + "Choose a disguise then right click an entity to disguise it!"), - DISG_ENT_HELP3(ChatColor.DARK_GREEN + "/disguiseentity player "), - DISG_ENT_HELP4(ChatColor.DARK_GREEN + "/disguiseentity "), - DISG_ENT_HELP5(ChatColor.DARK_GREEN + "/disguiseentity "), - DISG_HELP1(ChatColor.DARK_GREEN + "Choose a disguise to become the disguise!"), - DISG_HELP2(ChatColor.DARK_GREEN + "/disguise player "), - DISG_HELP3(ChatColor.DARK_GREEN + "/disguise "), - DISG_HELP4(ChatColor.DARK_GREEN + "/disguise "), - DISG_PLAYER_AS_DISG(ChatColor.RED + "Successfully disguised %s as a %s!"), - DISG_PLAYER_AS_DISG_FAIL(ChatColor.RED + "Failed to disguise %s as a %s!"), - DISGUISED(ChatColor.RED + "Now disguised as %s"), - DISRADIUS(ChatColor.RED + "Successfully disguised %s entities!"), - DISRADIUS_FAIL(ChatColor.RED + "Couldn't find any entities to disguise!"), - DMODENT_HELP1(ChatColor.DARK_GREEN + "Choose the options for a disguise then right click a entity to modify it!"), - DMODIFY_HELP1(ChatColor.DARK_GREEN + "Modify your own disguise as you wear it!"), - DMODIFY_HELP2(ChatColor.DARK_GREEN + "/disguisemodify setBaby true setSprinting true"), - DMODIFY_HELP3(ChatColor.DARK_GREEN + "You can modify the disguises:" + ChatColor.GREEN + " %s"), - DMODIFY_MODIFIED(ChatColor.RED + "Your disguise has been modified!"), - DMODIFY_NO_PERM(ChatColor.RED + "No permission to modify your disguise!"), - DMODIFYENT_CLICK(ChatColor.RED + "Right click a disguised entity in the next %s seconds to modify their disguise!"), - DISGUISECOPY_INTERACT(ChatColor.RED + "Right click a disguised entity in the next %s seconds to copy their disguise!"), - DMODPLAYER_HELP1(ChatColor.DARK_GREEN + "Modify the disguise of another player!"), - DMODPLAYER_MODIFIED(ChatColor.RED + "Modified the disguise of %s!"), - DMODPLAYER_NODISGUISE(ChatColor.RED + "The player '%s' is not disguised"), - DMODPLAYER_NOPERM(ChatColor.RED + "You do not have permission to modify this disguise"), - DMODRADIUS(ChatColor.RED + "Successfully modified the disguises of %s entities!"), - DMODRADIUS_HELP1(ChatColor.DARK_GREEN + "Modify the disguises in a radius! Caps at %s blocks!"), + DISABLED_LIVING_TO_MISC("Can't disguise a living entity as a misc disguise. This has been disabled in the config!"), + DISG_ENT_CLICK("Right click an entity in the next %s seconds to disguise it as a %s!"), + DISG_ENT_HELP1("Choose a disguise then right click an entity to disguise it!"), + DISG_ENT_HELP3("/disguiseentity player "), + DISG_ENT_HELP4("/disguiseentity "), + DISG_ENT_HELP5("/disguiseentity "), + DISG_HELP1("Choose a disguise to become the disguise!"), + DISG_HELP2("/disguise player "), + DISG_HELP3("/disguise "), + DISG_HELP4("/disguise "), + DISG_PLAYER_AS_DISG("Successfully disguised %s as a %s!"), + DISG_PLAYER_AS_DISG_FAIL("Failed to disguise %s as a %s!"), + DISGUISED("Now disguised as %s"), + DISRADIUS("Successfully disguised %s entities!"), + DISRADIUS_FAIL("Couldn't find any entities to disguise!"), + DMODENT_HELP1("Choose the options for a disguise then right click a entity to modify it!"), + DMODIFY_HELP1("Modify your own disguise as you wear it!"), + DMODIFY_HELP2("/disguisemodify setBaby true setSprinting true"), + DMODIFY_HELP3("You can modify the disguises: %s"), + DMODIFY_MODIFIED("Your disguise has been modified!"), + DMODIFY_NO_PERM("No permission to modify your disguise!"), + DMODIFYENT_CLICK("Right click a disguised entity in the next %s seconds to modify their disguise!"), + DISGUISECOPY_INTERACT("Right click a disguised entity in the next %s seconds to copy their disguise!"), + DMODPLAYER_HELP1("Modify the disguise of another player!"), + DMODPLAYER_MODIFIED("Modified the disguise of %s!"), + DMODPLAYER_NODISGUISE("The player '%s' is not disguised"), + DMODPLAYER_NOPERM("You do not have permission to modify this disguise"), + DMODRADIUS("Successfully modified the disguises of %s entities!"), + DMODRADIUS_HELP1("Modify the disguises in a radius! Caps at %s blocks!"), DHELP_SHOW("Show"), - DHELP_NO_OPTIONS(ChatColor.RED + "No options with permission to use"), + DHELP_NO_OPTIONS("No options with permission to use"), DCLONE_EQUIP("ignoreEquip"), DCLONE_ADDEDANIMATIONS("doAddedAnimations"), DMODRADIUS_HELP2( - (ChatColor.DARK_GREEN + "/disguisemodifyradius ").replace("<", "<" + ChatColor.GREEN).replace(">", ChatColor.DARK_GREEN + ">")), - DMODRADIUS_HELP3(ChatColor.DARK_GREEN + "See the DisguiseType's usable by " + ChatColor.GREEN + "/disguisemodifyradius DisguiseType"), - DMODRADIUS_NEEDOPTIONS(ChatColor.RED + "You need to supply the disguise methods as well as the radius"), - DMODRADIUS_NEEDOPTIONS_ENTITY(ChatColor.RED + "You need to supply the disguise methods as well as the radius and EntityType"), - DMODRADIUS_NOENTS(ChatColor.RED + "Couldn't find any disguised entities!"), - DMODRADIUS_NOPERM(ChatColor.RED + "No permission to modify %s disguises!"), - DMODRADIUS_UNRECOGNIZED(ChatColor.RED + "Unrecognised DisguiseType %s"), - DMODRADIUS_USABLE(ChatColor.DARK_GREEN + "DisguiseTypes usable are: %s" + ChatColor.DARK_GREEN + "."), - DPLAYER_SUPPLY(ChatColor.RED + "You need to supply a disguise as well as the player/uuid"), - DRADIUS_ENTITIES(ChatColor.DARK_GREEN + "EntityTypes usable are: %s"), - DRADIUS_HELP1(ChatColor.DARK_GREEN + "Disguise all entities in a radius! Caps at %s blocks!"), - DRADIUS_HELP3((ChatColor.DARK_GREEN + "/disguiseradius player ").replace("<", "<" + ChatColor.GREEN).replace(">", ChatColor.DARK_GREEN + ">")), - DRADIUS_HELP4((ChatColor.DARK_GREEN + "/disguiseradius ") - .replace("<", "<" + ChatColor.GREEN).replace(">", ChatColor.DARK_GREEN + ">")), - DRADIUS_HELP5((ChatColor.DARK_GREEN + "/disguiseradius ").replace("<", "<" + ChatColor.GREEN).replace(">", ChatColor.DARK_GREEN + ">")), - DRADIUS_HELP6(ChatColor.DARK_GREEN + "See the EntityType's usable by " + ChatColor.GREEN + "/disguiseradius EntityTypes"), - DRADIUS_MISCDISG(ChatColor.RED + "Failed to disguise %s entities because the option to disguise a living entity as a non-living has been " + - "disabled in the config"), - DRADIUS_NEEDOPTIONS(ChatColor.RED + "You need to supply a disguise as well as the radius"), - DRADIUS_NEEDOPTIONS_ENTITY(ChatColor.RED + "You need to supply a disguise as well as the radius and EntityType"), - FAILED_DISGIUSE(ChatColor.RED + "Failed to disguise as %s"), - GRABBED_SKIN(ChatColor.GOLD + "Grabbed skin and saved as %s!"), - PLEASE_WAIT(ChatColor.GRAY + "Please wait..."), - INVALID_CLONE(ChatColor.DARK_RED + "Unknown method '%s' - Valid methods are 'IgnoreEquipment' 'DoSneakSprint' " + "'DoSneak' 'DoSprint'"), - LIBS_COMMAND_WRONG_ARG(ChatColor.RED + "[LibsDisguises] Invalid argument, use /libsdisguises help"), - LIBS_UPDATE_UNKNOWN_BRANCH(ChatColor.RED + "[LibsDisguises] Invalid argument, use 'dev' or 'release' to switch branches"), - LIMITED_RADIUS(ChatColor.RED + "Limited radius to %s! Don't want to make too much lag right?"), - LISTEN_ENTITY_ENTITY_DISG_ENTITY(ChatColor.RED + "Disguised %s as a %s!"), - LISTEN_ENTITY_ENTITY_DISG_ENTITY_FAIL(ChatColor.RED + "Failed to disguise %s as a %s!"), - LISTEN_ENTITY_ENTITY_DISG_PLAYER(ChatColor.RED + "Disguised %s as the player %s!"), - LISTEN_ENTITY_ENTITY_DISG_PLAYER_FAIL(ChatColor.RED + "Failed to disguise %s as the player %s!"), - LISTEN_ENTITY_PLAYER_DISG_ENTITY(ChatColor.RED + "Disguised the player %s as a %s!"), - LISTEN_ENTITY_PLAYER_DISG_ENTITY_FAIL(ChatColor.RED + "Failed to disguise the player %s as a %s!"), - LISTEN_ENTITY_PLAYER_DISG_PLAYER(ChatColor.RED + "Disguised the player %s as the player %s!"), - LISTEN_ENTITY_PLAYER_DISG_PLAYER_FAIL(ChatColor.RED + "Failed to disguise the player %s as the player %s!"), - LISTEN_UNDISG_ENT(ChatColor.RED + "Undisguised the %s"), - LISTEN_UNDISG_ENT_FAIL(ChatColor.RED + "%s isn't disguised!"), - LISTEN_UNDISG_PLAYER(ChatColor.RED + "Undisguised %s"), - LISTEN_UNDISG_PLAYER_FAIL(ChatColor.RED + "The %s isn't disguised!"), - LISTENER_MODIFIED_DISG(ChatColor.RED + "Modified the disguise!"), - MADE_REF(ChatColor.RED + "Constructed a %s disguise! Your reference is %s"), - MADE_REF_EXAMPLE(ChatColor.RED + "Example usage: /disguise %s"), - NO_CONSOLE(ChatColor.RED + "You may not use this command from the console!"), - TOO_FAST(ChatColor.RED + "You are using the disguise command too fast!"), - NO_MODS(ChatColor.RED + "%s is not using any mods!"), - MODS_LIST(ChatColor.DARK_GREEN + "%s has the mods:" + ChatColor.AQUA + " %s"), - NO_PERM(ChatColor.RED + "You are forbidden to use this command."), - UPDATE_ON_LATEST(ChatColor.RED + "You are already on the latest version of LibsDisguises!"), - UPDATE_ALREADY_DOWNLOADED(ChatColor.RED + "That update has already been downloaded!"), - UPDATE_FAILED(ChatColor.RED + "LibsDisguises update failed! Check console for errors."), - UPDATE_SUCCESS(ChatColor.DARK_GREEN + "LibsDisguises update success! Restart server to update!"), - UPDATE_REQUIRED(ChatColor.RED + "LibsDisguises requies an update check before it can give you that!"), - UPDATE_INFO(ChatColor.DARK_GREEN + "Lib's Disguises v%s, build %s, built %s and size %skb"), - UPDATE_IN_PROGRESS(ChatColor.DARK_GREEN + "LibsDisguises is now downloading an update..."), - NO_PERM_DISGUISE(ChatColor.RED + "You do not have permission for that disguise!"), - NO_MODS_LISTENING(ChatColor.RED + "This server is not listening for mods!"), - NO_PERMS_USE_OPTIONS(ChatColor.RED + "Ignored %s methods you do not have permission to use. Add 'show' to view unusable methods."), - OWNED_BY(ChatColor.GOLD + "Plugin registered to '%%__USER__%%'!"), - NOT_DISGUISED(ChatColor.RED + "You are not disguised!"), - DISGUISE_REQUIRED(ChatColor.RED + "You must be disguised to run this command!"), - TARGET_NOT_DISGUISED(ChatColor.RED + "That entity is not disguised!"), - NOT_NUMBER(ChatColor.RED + "Error! %s is not a number"), - PARSE_CANT_DISG_UNKNOWN(ChatColor.RED + "Error! You cannot disguise as " + ChatColor.GREEN + "Unknown!"), - PARSE_CANT_LOAD(ChatColor.RED + "Error! This disguise couldn't be loaded!"), - PARSE_DISG_NO_EXIST(ChatColor.RED + "Error! The disguise " + ChatColor.GREEN + "%s" + ChatColor.RED + " doesn't exist!"), - PARSE_EXPECTED_RECEIVED( - ChatColor.RED + "Expected " + ChatColor.GREEN + "%s" + ChatColor.RED + ", received " + ChatColor.GREEN + "%s" + ChatColor.RED + " instead for " + - ChatColor.GREEN + "%s"), - PARSE_PARTICLE_BLOCK( - ChatColor.RED + "Expected " + ChatColor.GREEN + "%s:Material" + ChatColor.RED + ", received " + ChatColor.GREEN + "%s" + ChatColor.RED + - " instead"), - PARSE_PARTICLE_ITEM(ChatColor.RED + "Expected " + ChatColor.GREEN + "%s:Material,Amount?,Glow?" + ChatColor.RED + ", received " + ChatColor.GREEN + "%s" + - ChatColor.RED + " instead"), - PARSE_PARTICLE_REDSTONE( - ChatColor.RED + "Expected " + ChatColor.GREEN + "%s:Color,Size.0?" + ChatColor.RED + ", received " + ChatColor.GREEN + "%s" + ChatColor.RED + - " instead"), + "/disguisemodifyradius <DisguiseType(Optional)> <Radius> <Disguise " + + "Methods>"), + DMODRADIUS_HELP3("See the DisguiseType's usable by /disguisemodifyradius DisguiseType"), + DMODRADIUS_NEEDOPTIONS("You need to supply the disguise methods as well as the radius"), + DMODRADIUS_NEEDOPTIONS_ENTITY("You need to supply the disguise methods as well as the radius and EntityType"), + DMODRADIUS_NOENTS("Couldn't find any disguised entities!"), + DMODRADIUS_NOPERM("No permission to modify %s disguises!"), + DMODRADIUS_UNRECOGNIZED("Unrecognised DisguiseType %s"), + DMODRADIUS_USABLE("DisguiseTypes usable are: %s."), + DPLAYER_SUPPLY("You need to supply a disguise as well as the player/uuid"), + DRADIUS_ENTITIES("EntityTypes usable are: %s"), + DRADIUS_HELP1("Disguise all entities in a radius! Caps at %s blocks!"), + DRADIUS_HELP3("/disguiseradius <EntityType(Optional)> <Radius> player " + + "<Name>"), + DRADIUS_HELP4("/disguiseradius <EntityType(Optional)> <Radius> " + + "<DisguiseType> <Baby(Optional)>"), + DRADIUS_HELP5("/disguiseradius <EntityType(Optional)> <Radius> " + + "<Dropped_Item/Falling_Block> <Id> <Durability(Optional)" + ">"), + DRADIUS_HELP6("See the EntityType's usable by /disguiseradius EntityTypes"), + DRADIUS_MISCDISG("Failed to disguise %s entities because the option to disguise a living entity as a non-living has been disabled in the config"), + DRADIUS_NEEDOPTIONS("You need to supply a disguise as well as the radius"), + DRADIUS_NEEDOPTIONS_ENTITY("You need to supply a disguise as well as the radius and EntityType"), + FAILED_DISGIUSE("Failed to disguise as %s"), + GRABBED_SKIN("Grabbed skin and saved as %s!"), + PLEASE_WAIT("Please wait..."), + INVALID_CLONE("Unknown method '%s' - Valid methods are 'IgnoreEquipment' 'DoSneakSprint' 'DoSneak' 'DoSprint'"), + LIBS_COMMAND_WRONG_ARG("[LibsDisguises] Invalid argument, use /libsdisguises help"), + LIBS_UPDATE_UNKNOWN_BRANCH("[LibsDisguises] Invalid argument, use 'dev' or 'release' to switch branches"), + LIMITED_RADIUS("Limited radius to %s! Don't want to make too much lag right?"), + LISTEN_ENTITY_ENTITY_DISG_ENTITY("Disguised %s as a %s!"), + LISTEN_ENTITY_ENTITY_DISG_ENTITY_FAIL("Failed to disguise %s as a %s!"), + LISTEN_ENTITY_ENTITY_DISG_PLAYER("Disguised %s as the player %s!"), + LISTEN_ENTITY_ENTITY_DISG_PLAYER_FAIL("Failed to disguise %s as the player %s!"), + LISTEN_ENTITY_PLAYER_DISG_ENTITY("Disguised the player %s as a %s!"), + LISTEN_ENTITY_PLAYER_DISG_ENTITY_FAIL("Failed to disguise the player %s as a %s!"), + LISTEN_ENTITY_PLAYER_DISG_PLAYER("Disguised the player %s as the player %s!"), + LISTEN_ENTITY_PLAYER_DISG_PLAYER_FAIL("Failed to disguise the player %s as the player %s!"), + LISTEN_UNDISG_ENT("Undisguised the %s"), + LISTEN_UNDISG_ENT_FAIL("%s isn't disguised!"), + LISTEN_UNDISG_PLAYER("Undisguised %s"), + LISTEN_UNDISG_PLAYER_FAIL("The %s isn't disguised!"), + LISTENER_MODIFIED_DISG("Modified the disguise!"), + MADE_REF("Constructed a %s disguise! Your reference is %s"), + MADE_REF_EXAMPLE("Example usage: /disguise %s"), + NO_CONSOLE("You may not use this command from the console!"), + TOO_FAST("You are using the disguise command too fast!"), + NO_MODS("%s is not using any mods!"), + MODS_LIST("%s has the mods: %s"), + NO_PERM("You are forbidden to use this command."), + UPDATE_ON_LATEST("You are already on the latest version of LibsDisguises!"), + UPDATE_ALREADY_DOWNLOADED("That update has already been downloaded!"), + UPDATE_FAILED("LibsDisguises update failed! Check console for errors."), + UPDATE_SUCCESS("LibsDisguises update success! Restart server to update!"), + UPDATE_REQUIRED("LibsDisguises requies an update check before it can give you that!"), + UPDATE_INFO("Lib's Disguises v%s, build %s, built %s and size %skb"), + UPDATE_IN_PROGRESS("LibsDisguises is now downloading an update..."), + NO_PERM_DISGUISE("You do not have permission for that disguise!"), + NO_MODS_LISTENING("This server is not listening for mods!"), + NO_PERMS_USE_OPTIONS("Ignored %s methods you do not have permission to use. Add 'show' to view unusable methods."), + OWNED_BY("Plugin registered to '%%__USER__%%'!"), + NOT_DISGUISED("You are not disguised!"), + DISGUISE_REQUIRED("You must be disguised to run this command!"), + TARGET_NOT_DISGUISED("That entity is not disguised!"), + NOT_NUMBER("Error! %s is not a number"), + PARSE_CANT_DISG_UNKNOWN("Error! You cannot disguise as Unknown!"), + PARSE_CANT_LOAD("Error! This disguise couldn't be loaded!"), + PARSE_DISG_NO_EXIST("Error! The disguise %s doesn't exist!"), + PARSE_EXPECTED_RECEIVED("Expected %s, received %s instead for %s"), + PARSE_PARTICLE_BLOCK("Expected %s:Material, received %s instead"), + PARSE_PARTICLE_ITEM("Expected %s:Material,Amount?,Glow?, received %s instead"), + PARSE_PARTICLE_REDSTONE("Expected %s:Color,Size.0?, received %s instead"), PARSE_NO_ARGS("No arguments defined"), - PARSE_NO_OPTION_VALUE(ChatColor.RED + "No value was given for the method %s"), - PARSE_NO_PERM_NAME(ChatColor.RED + "Error! You don't have permission to use that name!"), - PARSE_NO_PERM_PARAM(ChatColor.RED + "Error! You do not have permission to use the parameter %s on the %s disguise!"), - PARSE_NO_PERM_REF(ChatColor.RED + "You do not have permission to use disguise references!"), - PARSE_NO_REF(ChatColor.RED + "Cannot find a disguise under the reference %s"), - PARSE_OPTION_NA(ChatColor.RED + "Cannot find the method '%s'"), - PARSE_SUPPLY_PLAYER(ChatColor.RED + "Error! You need to give a player name!"), - PARSE_TOO_MANY_ARGS(ChatColor.RED + "Error! %s doesn't know what to do with %s!"), - PARSE_INVALID_TIME(ChatColor.RED + "Error! %s is not a valid time! Use s,m,h,d or secs,mins,hours,days"), - PARSE_INVALID_TIME_SEQUENCE(ChatColor.RED + "Error! %s is not a valid time! Do amount then time, eg. 4min10sec"), - PARSE_USE_SECOND_NUM(ChatColor.RED + "Error! Only the disguises %s and %s uses a second number!"), - REF_TOO_MANY(ChatColor.RED + "Failed to store the reference, too many cloned disguises. Please raise the maximum cloned disguises, or " + - "lower the time they last"), - RELOADED_CONFIG(ChatColor.GREEN + "[LibsDisguises] Reloaded config."), - UND_ENTITY(ChatColor.RED + "Right click a disguised entity to undisguise them!"), - UNDISG(ChatColor.RED + "You are no longer disguised"), - UNDISG_PLAYER(ChatColor.RED + "%s is no longer disguised"), - UNDISG_PLAYER_FAIL(ChatColor.RED + "%s not disguised!"), - UNDISG_PLAYER_HELP(ChatColor.RED + "/undisguiseplayer "), - UNDISRADIUS(ChatColor.RED + "Successfully undisguised %s entities!"), - UPDATE_READY(ChatColor.RED + "[LibsDisguises] " + ChatColor.DARK_RED + "There is a update ready to be downloaded! You are using " + ChatColor.RED + "v%s" + - ChatColor.DARK_RED + ", the new version is " + ChatColor.RED + "v%s" + ChatColor.DARK_RED + "!"), - UPDATE_READY_SNAPSHOT( - ChatColor.RED + "[LibsDisguises] " + ChatColor.DARK_RED + "There is a new build of Lib's Disguises! You are using " + ChatColor.RED + "%s" + - ChatColor.DARK_RED + ", the latest build is " + ChatColor.RED + "#%s" + ChatColor.DARK_RED + "!"), - UPDATE_HOW( - ChatColor.DARK_AQUA + "Use " + ChatColor.AQUA + "/libsdisgusies changelog" + ChatColor.DARK_AQUA + " to see what changed, use " + ChatColor.AQUA + - "/libsdisguises update!" + ChatColor.DARK_AQUA + " to download the update!"), - VIEW_SELF_ON(ChatColor.GREEN + "Toggled viewing own disguise on!"), - VIEW_SELF_OFF(ChatColor.GREEN + "Toggled viewing own disguise off!"), - VIEW_BAR_ON(ChatColor.GREEN + "Toggled disguised notify bar on!"), - VIEW_BAR_OFF(ChatColor.GREEN + "Toggled disguised notify bar off!"), - CLICK_TO_COPY(ChatColor.GREEN + "Click to Copy:"), - SKIN_DATA(ChatColor.GREEN + "Skin Data: " + ChatColor.YELLOW + "%s"), - CLICK_TO_COPY_DATA(ChatColor.YELLOW + "Data"), - CLICK_TO_COPY_WITH_SKIN(ChatColor.GREEN + "Version with skin data:"), - CLICK_TO_COPY_WITH_SKIN_NO_COPY(ChatColor.GREEN + "Version with skin data: " + ChatColor.YELLOW + "%s"), - COPY_DISGUISE_NO_COPY(ChatColor.GREEN + "Data: " + ChatColor.YELLOW + "%s"), - CLICK_TO_COPY_HOVER(ChatColor.GOLD + "Click to Copy"), - CLICK_COPY(ChatColor.YELLOW + "" + ChatColor.BOLD + "%s"), - SKIN_API_UUID_3(ChatColor.RED + "Using account with UUID version 3. If skin is incorrect, try change 'UUIDVersion' in protocol.yml" + + PARSE_NO_OPTION_VALUE("No value was given for the method %s"), + PARSE_NO_PERM_NAME("Error! You don't have permission to use that name!"), + PARSE_NO_PERM_PARAM("Error! You do not have permission to use the parameter %s on the %s disguise!"), + PARSE_NO_PERM_REF("You do not have permission to use disguise references!"), + PARSE_NO_REF("Cannot find a disguise under the reference %s"), + PARSE_OPTION_NA("Cannot find the method '%s'"), + PARSE_SUPPLY_PLAYER("Error! You need to give a player name!"), + PARSE_TOO_MANY_ARGS("Error! %s doesn't know what to do with %s!"), + PARSE_INVALID_TIME("Error! %s is not a valid time! Use s,m,h,d or secs,mins,hours,days"), + PARSE_INVALID_TIME_SEQUENCE("Error! %s is not a valid time! Do amount then time, eg. 4min10sec"), + PARSE_USE_SECOND_NUM("Error! Only the disguises %s and %s uses a second number!"), + REF_TOO_MANY("Failed to store the reference, too many cloned disguises. Please raise the maximum cloned disguises, or lower the time they last"), + RELOADED_CONFIG("[LibsDisguises] Reloaded config."), + UND_ENTITY("Right click a disguised entity to undisguise them!"), + UNDISG("You are no longer disguised"), + UNDISG_PLAYER("%s is no longer disguised"), + UNDISG_PLAYER_FAIL("%s not disguised!"), + UNDISG_PLAYER_HELP("/undisguiseplayer "), + UNDISRADIUS("Successfully undisguised %s entities!"), + UPDATE_READY("[LibsDisguises] There is a update ready to be downloaded! You are using v%s, the new version is " + + "v%s!"), + UPDATE_READY_SNAPSHOT("[LibsDisguises] There is a new build of Lib's Disguises! You are using %s, the latest build is " + + "#%s!"), + UPDATE_HOW("Use /libsdisgusies changelog to see what changed, use /libsdisguises update!" + + " to download the update!"), + VIEW_SELF_ON("Toggled viewing own disguise on!"), + VIEW_SELF_OFF("Toggled viewing own disguise off!"), + VIEW_BAR_ON("Toggled disguised notify bar on!"), + VIEW_BAR_OFF("Toggled disguised notify bar off!"), + CLICK_TO_COPY("Click to Copy:"), + SKIN_DATA("Skin Data: %s"), + CLICK_TO_COPY_DATA("Data"), + CLICK_TO_COPY_WITH_SKIN("Version with skin data:"), + CLICK_TO_COPY_WITH_SKIN_NO_COPY("Version with skin data: %s"), + COPY_DISGUISE_NO_COPY("Data: %s"), + CLICK_TO_COPY_HOVER("Click to Copy"), + CLICK_COPY("%s"), + SKIN_API_UUID_3("Using account with UUID version 3. If skin is incorrect, try change 'UUIDVersion' in protocol.yml" + " to 3. If skin is still incorrect and you did not purchase Minecraft, this cannot be fixed."), - SKIN_API_IN_USE(ChatColor.RED + "mineskin.org is currently in use, please try again"), - SKIN_API_TIMER(ChatColor.RED + "mineskin.org can be used again in %s seconds"), - SKIN_API_FAIL(ChatColor.RED + "Unexpected error while accessing mineskin.org, please try again"), - SKIN_API_FAIL_TOO_FAST(ChatColor.RED + "Too many requests accessing mineskin.org, please slow down!"), - SKIN_API_BAD_URL(ChatColor.RED + "Invalid url provided! Please ensure it is a .png file download!"), - SKIN_API_FAILED_URL(ChatColor.RED + "Invalid url provided! mineskin.org failed to grab it!"), - SKIN_API_FAIL_CODE(ChatColor.RED + "Error %s! %s"), + SKIN_API_IN_USE("mineskin.org is currently in use, please try again"), + SKIN_API_TIMER("mineskin.org can be used again in %s seconds"), + SKIN_API_FAIL("Unexpected error while accessing mineskin.org, please try again"), + SKIN_API_FAIL_TOO_FAST("Too many requests accessing mineskin.org, please slow down!"), + SKIN_API_BAD_URL("Invalid url provided! Please ensure it is a .png file download!"), + SKIN_API_FAILED_URL("Invalid url provided! mineskin.org failed to grab it!"), + SKIN_API_FAIL_CODE("Error %s! %s"), SKIN_API_403("mineskin.org denied access to that url"), SKIN_API_404("mineskin.org unable to find an image at that url"), - SKIN_API_IMAGE_TIMEOUT(ChatColor.RED + "Error! mineskin.org took too long to connect! Is your image valid?"), - SKIN_API_TIMEOUT_ERROR(ChatColor.RED + "Error! Took too long to connect to mineskin.org!"), - SKIN_API_TIMEOUT_API_KEY_ERROR(ChatColor.RED + "Error! Took too long to connect to mineskin.org! Is the API Key correct?"), - SKIN_API_TIMEOUT(ChatColor.RED + "Took too long to connect to mineskin.org!"), + SKIN_API_IMAGE_TIMEOUT("Error! mineskin.org took too long to connect! Is your image valid?"), + SKIN_API_TIMEOUT_ERROR("Error! Took too long to connect to mineskin.org!"), + SKIN_API_TIMEOUT_API_KEY_ERROR("Error! Took too long to connect to mineskin.org! Is the API Key correct?"), + SKIN_API_TIMEOUT("Took too long to connect to mineskin.org!"), SKIN_API_IMAGE_HAS_ERROR("Your image has the error: %s"), - SKIN_API_USING_URL(ChatColor.GRAY + "Url provided, now attempting to connect to mineskin.org"), - SKIN_API_BAD_FILE_NAME(ChatColor.RED + "Invalid file name provided! File not found!"), - SKIN_API_BAD_FILE(ChatColor.RED + "Invalid file provided! Please ensure it is a valid .png skin!"), - SKIN_API_USING_FILE(ChatColor.GRAY + "File provided and found, now attempting to upload to mineskin.org"), - SKIN_API_INVALID_NAME(ChatColor.RED + "Invalid name/file/uuid provided!"), - SKIN_API_USING_UUID(ChatColor.GRAY + "UUID successfully parsed, now attempting to connect to mineskin.org"), - SKIN_API_USING_EXISTING_NAME(ChatColor.GRAY + "Found a saved skin under that name locally! Using that!"), - SKIN_API_USING_NAME(ChatColor.GRAY + "Determined to be player name, now attempting to validate and connect to mineskin.org"), - SAVE_DISG_HELP_1(ChatColor.GREEN + "The is what the disguise will be called in Lib's Disguises"), - SAVE_DISG_HELP_2(ChatColor.GREEN + "/savedisguise - If you don't provide arguments, it'll try make a disguise from your" + + SKIN_API_USING_URL("Url provided, now attempting to connect to mineskin.org"), + SKIN_API_BAD_FILE_NAME("Invalid file name provided! File not found!"), + SKIN_API_BAD_FILE("Invalid file provided! Please ensure it is a valid .png skin!"), + SKIN_API_USING_FILE("File provided and found, now attempting to upload to mineskin.org"), + SKIN_API_INVALID_NAME("Invalid name/file/uuid provided!"), + SKIN_API_USING_UUID("UUID successfully parsed, now attempting to connect to mineskin.org"), + SKIN_API_USING_EXISTING_NAME("Found a saved skin under that name locally! Using that!"), + SKIN_API_USING_NAME("Determined to be player name, now attempting to validate and connect to mineskin.org"), + SAVE_DISG_HELP_1("The is what the disguise will be called in Lib's Disguises"), + SAVE_DISG_HELP_2("/savedisguise - If you don't provide arguments, it'll try make a disguise from your" + " current disguise. This will not work if you are not disguised!"), - SAVE_DISG_HELP_3(ChatColor.GREEN + "/savedisguise "), - SAVE_DISG_HELP_4(ChatColor.GREEN + "Your arguments need to be as if you're using /disguise. So '/disguise player Notch setsneaking' - " + + SAVE_DISG_HELP_3("/savedisguise "), + SAVE_DISG_HELP_4("Your arguments need to be as if you're using /disguise. So '/disguise player Notch setsneaking' - " + "Means '/savedisguise Notch player Notch setsneaking'"), - SAVE_DISG_HELP_5(ChatColor.GREEN + "Remember! You can upload your own skins, then reference those skins!"), - SAVE_DISG_HELP_6(ChatColor.GREEN + "If you are using setSkin, you can append :slim to your skin path to get the slim Alex model. So myskin" + ".png:slim"), - GRAB_DISG_HELP_1(ChatColor.GREEN + "You can choose a name to save the skins under, the names will be usable as if it was an actual player " + "skin"), - GRAB_DISG_HELP_2(ChatColor.DARK_GREEN + "/grabskin https://somesite.com/myskin.png"), - GRAB_DISG_HELP_3(ChatColor.DARK_GREEN + "/grabskin myskin.png - Skins must be in the folder!"), - GRAB_DISG_HELP_4(ChatColor.DARK_GREEN + "/grabskin "), - GRAB_DISG_HELP_5(ChatColor.GREEN + "If you want the slim Alex version of the skin, append :slim. So 'myskin.png:slim'"), - GRAB_DISG_HELP_6(ChatColor.GREEN + "You will be sent the skin data, but you can also use the saved names in disguises"), - GRAB_HEAD_SUCCESS(ChatColor.GREEN + "Head successfully grabbed and added to inventory!"), - GRAB_HEAD_HELP_1(ChatColor.GREEN + "Grab the head of a file, player or url! This is a Lib's Disguises feature."), - GRAB_HEAD_HELP_2(ChatColor.DARK_GREEN + "/grabhead https://somesite.com/myskin.png"), - GRAB_HEAD_HELP_3(ChatColor.DARK_GREEN + "/grabhead myskin.png - Skins must be in the folder!"), - GRAB_HEAD_HELP_4(ChatColor.DARK_GREEN + "/grabhead "), - CUSTOM_DISGUISE_NAME_CONFLICT(ChatColor.RED + "Cannot create the custom disguise '%s' as there is a name conflict!"), - ERROR_LOADING_CUSTOM_DISGUISE(ChatColor.RED + "Error while loading custom disguise '%s'%s"), - SKIN_API_INTERNAL_ERROR(ChatColor.RED + "Internal error in the skin API, perhaps bad data?"), - META_INFO(ChatColor.GREEN + "Name: %s, Watcher: %s, Index: %s, Type: %s, Default: %s"), - META_NOT_FOUND(ChatColor.RED + "No meta exists under that name!"), - META_VALUES(ChatColor.BLUE + "Metas: " + ChatColor.DARK_AQUA), - META_VALUES_NO_CLICK(ChatColor.BLUE + "Metas, use as param for more info: " + ChatColor.DARK_AQUA), - META_VALUE_SEPERATOR(ChatColor.AQUA + ", " + ChatColor.DARK_AQUA), - META_CLICK_SHOW(ChatColor.GOLD + "Click to show %s"), - LIBS_PERM_CHECK_NON_PREM(ChatColor.RED + "This server is not premium, non-admins should not be able to use commands"), - LIBS_PERM_CHECK_CAN_TARGET(ChatColor.GOLD + "You can specify a player target with /ld permtest instead!"), - LIBS_PERM_CHECK_USING_TARGET(ChatColor.GOLD + "Running the permission test on '%s'"), - LIBS_PERM_CHECK_INFO_1(ChatColor.AQUA + "Now checking for the permission 'libsdisguises.disguise.pig'"), - LIBS_PERM_CHECK_INFO_2(ChatColor.AQUA + "If you did not give this permission, please set it."), - NORMAL_PERM_CHECK_SUCCESS(ChatColor.GOLD + "Normal permission check, success."), - NORMAL_PERM_CHECK_FAIL(ChatColor.RED + "Normal permission check, fail."), - LIBS_PERM_CHECK_SUCCESS(ChatColor.GOLD + "Lib's Disguises permission check, success. Pig disguise should be usable!"), - LIBS_PERM_CHECK_FAIL(ChatColor.GOLD + "Lib's Disguises permission check, fail. Your permission plugin isn't compliant!"), + SAVE_DISG_HELP_5("Remember! You can upload your own skins, then reference those skins!"), + SAVE_DISG_HELP_6("If you are using setSkin, you can append :slim to your skin path to get the slim Alex model. So myskin.png:slim"), + GRAB_DISG_HELP_1("You can choose a name to save the skins under, the names will be usable as if it was an actual player skin"), + GRAB_DISG_HELP_2("/grabskin https://somesite.com/myskin.png"), + GRAB_DISG_HELP_3("/grabskin myskin.png - Skins must be in the folder!"), + GRAB_DISG_HELP_4("/grabskin "), + GRAB_DISG_HELP_5("If you want the slim Alex version of the skin, append :slim. So 'myskin.png:slim'"), + GRAB_DISG_HELP_6("You will be sent the skin data, but you can also use the saved names in disguises"), + GRAB_HEAD_SUCCESS("Head successfully grabbed and added to inventory!"), + GRAB_HEAD_HELP_1("Grab the head of a file, player or url! This is a Lib's Disguises feature."), + GRAB_HEAD_HELP_2("/grabhead https://somesite.com/myskin.png"), + GRAB_HEAD_HELP_3("/grabhead myskin.png - Skins must be in the folder!"), + GRAB_HEAD_HELP_4("/grabhead "), + CUSTOM_DISGUISE_NAME_CONFLICT("Cannot create the custom disguise '%s' as there is a name conflict!"), + ERROR_LOADING_CUSTOM_DISGUISE("Error while loading custom disguise '%s'%s"), + SKIN_API_INTERNAL_ERROR("Internal error in the skin API, perhaps bad data?"), + META_INFO("Name: %s, Watcher: %s, Index: %s, Type: %s, Default: %s"), + META_NOT_FOUND("No meta exists under that name!"), + META_VALUES("Metas: "), + META_VALUES_NO_CLICK("Metas, use as param for more info: "), + META_VALUE_SEPERATOR(", "), + META_CLICK_SHOW("Click to show %s"), + LIBS_PERM_CHECK_NON_PREM("This server is not premium, non-admins should not be able to use commands"), + LIBS_PERM_CHECK_CAN_TARGET("You can specify a player target with /ld permtest instead!"), + LIBS_PERM_CHECK_USING_TARGET("Running the permission test on '%s'"), + LIBS_PERM_CHECK_INFO_1("Now checking for the permission 'libsdisguises.disguise.pig'"), + LIBS_PERM_CHECK_INFO_2("If you did not give this permission, please set it."), + NORMAL_PERM_CHECK_SUCCESS("Normal permission check, success."), + NORMAL_PERM_CHECK_FAIL("Normal permission check, fail."), + LIBS_PERM_CHECK_SUCCESS("Lib's Disguises permission check, success. Pig disguise should be usable!"), + LIBS_PERM_CHECK_FAIL("Lib's Disguises permission check, fail. Your permission plugin isn't compliant!"), LIBS_PERM_CHECK_ZOMBIE_PERMISSIONS( - ChatColor.GOLD + "Tested libsdisguises.disguise.zombie, which your player seems to have! There may be a problem in your " + "permissions setup!"), - LIBS_PERM_CHECK_COMMAND_UNREGISTERED(ChatColor.RED + "The /disguise command seems to be unregistered! Check your config!"), - LIBS_PERM_COMMAND_SUCCESS(ChatColor.GOLD + "Tested permission '%s' for /disguise command access, permission success!"), - LIBS_PERM_COMMAND_FAIL(ChatColor.RED + "Tested permission '%s' for /disguise command access, permission failed!"), - CANT_ATTACK_DISGUISED(ChatColor.RED + "Cannot fight while disguised!"), - CANT_ATTACK_DISGUISED_RECENTLY(ChatColor.RED + "You were disguised recently! Can't attack yet!"), - SWITCH_WORLD_DISGUISE_REMOVED(ChatColor.RED + "Disguise removed as you've switched worlds!"), - ACTION_BAR_MESSAGE(ChatColor.GOLD + "Currently disguised as %s"), - ITEM_SERIALIZED(ChatColor.GOLD + "Json Serialized, click to copy: "), - ITEM_SERIALIZED_MC(ChatColor.GOLD + "MC Serialized, click to copy: "), - ITEM_SERIALIZED_MC_LD(ChatColor.GOLD + "MC Serialized for LD, click to copy: "), - ITEM_SIMPLE_STRING(ChatColor.GOLD + "Simple, click to copy: "), - ITEM_SERIALIZED_NO_COPY(ChatColor.GOLD + "Json Serialized: " + ChatColor.YELLOW + "%s"), - ITEM_SERIALIZED_MC_NO_COPY(ChatColor.GOLD + "MC Serialized: " + ChatColor.YELLOW + "%s"), - ITEM_SERIALIZED_MC_LD_NO_COPY(ChatColor.GOLD + "MC Serialized for LD: " + ChatColor.YELLOW + "%s"), - ITEM_SIMPLE_STRING_NO_COPY(ChatColor.GOLD + "Simple: " + ChatColor.YELLOW + "%s"), - LIBS_SCOREBOARD_NO_TEAM(ChatColor.RED + "Not on a scoreboard team!"), - LIBS_SCOREBOARD_SUCCESS( - ChatColor.GOLD + "On scoreboard team '%s' with pushing disabled! If you're still having issues and you are disguised right" + " now, then " + - "you have a plugin modifying scoreboard through packets. Example of this is a plugin that modifies your " + - "name above head, or the tablist. Check their configs for pushing disabling options\nSay 'I read to the " + "end' if you " + - "still need help with this, or we'll assume you can't read."), - LIBS_SCOREBOARD_NAMES_DISABLED(ChatColor.RED + "Scoreboard names has been disabled, the test for player disguises has failed before it started"), - LIBS_SCOREBOARD_IGNORE_TEST(ChatColor.GREEN + "This was a seperate test from the self disguising collision test that will follow!"), - USING_DEFAULT_CONFIG(ChatColor.DARK_GREEN + "Using the default config!"), - LIBS_SCOREBOARD_ISSUES(ChatColor.GREEN + "Too many issues found, hidden %s"), - LIBS_SCOREBOARD_NO_ISSUES(ChatColor.GREEN + "No issues found in player disguise scoreboard name teams"), - LD_COMMAND_UPDATEPROTOCOLLIB( - ChatColor.BLUE + "/libsdisguises updateprotocollib - " + ChatColor.AQUA + "Updates ProtocolLib to the latest development version"), - LD_COMMAND_HELP(ChatColor.BLUE + "/libsdisguises help - " + ChatColor.AQUA + "Returns this!"), - LD_COMMAND_COUNT(ChatColor.BLUE + "/libsdisguises count - " + ChatColor.AQUA + "Tells you how many active disguises there are"), - LD_COMMAND_METAINFO(ChatColor.BLUE + "/libsdisguises metainfo - " + ChatColor.AQUA + "Debugging info, tells you what the metadata is for a disguise"), - LD_COMMAND_CONFIG(ChatColor.BLUE + "/libsdisguises config - " + ChatColor.AQUA + "Tells you what's not normal in your config"), - LD_COMMAND_UPDATE(ChatColor.BLUE + "/libsdisguises update - " + ChatColor.AQUA + + "Tested libsdisguises.disguise.zombie, which your player seems to have! There may be a problem in your permissions setup!"), + LIBS_PERM_CHECK_COMMAND_UNREGISTERED("The /disguise command seems to be unregistered! Check your config!"), + LIBS_PERM_COMMAND_SUCCESS("Tested permission '%s' for /disguise command access, permission success!"), + LIBS_PERM_COMMAND_FAIL("Tested permission '%s' for /disguise command access, permission failed!"), + CANT_ATTACK_DISGUISED("Cannot fight while disguised!"), + CANT_ATTACK_DISGUISED_RECENTLY("You were disguised recently! Can't attack yet!"), + SWITCH_WORLD_DISGUISE_REMOVED("Disguise removed as you've switched worlds!"), + ACTION_BAR_MESSAGE("Currently disguised as %s"), + ITEM_SERIALIZED("Json Serialized, click to copy: "), + ITEM_SERIALIZED_MC("MC Serialized, click to copy: "), + ITEM_SERIALIZED_MC_LD("MC Serialized for LD, click to copy: "), + ITEM_SIMPLE_STRING("Simple, click to copy: "), + ITEM_SERIALIZED_NO_COPY("Json Serialized: %s"), + ITEM_SERIALIZED_MC_NO_COPY("MC Serialized: %s"), + ITEM_SERIALIZED_MC_LD_NO_COPY("MC Serialized for LD: %s"), + ITEM_SIMPLE_STRING_NO_COPY("Simple: %s"), + LIBS_SCOREBOARD_NO_TEAM("Not on a scoreboard team!"), + LIBS_SCOREBOARD_SUCCESS("On scoreboard team '%s' with pushing disabled! If you're still having issues and you are disguised right now, then " + + "you have a plugin modifying scoreboard through packets. Example of this is a plugin that modifies your " + + "name above head, or the tablist. Check their configs for pushing disabling options\nSay 'I read to the end' if you " + + "still need help with this, or we'll assume you can't read."), + LIBS_SCOREBOARD_NAMES_DISABLED("Scoreboard names has been disabled, the test for player disguises has failed before it started"), + LIBS_SCOREBOARD_IGNORE_TEST("This was a seperate test from the self disguising collision test that will follow!"), + USING_DEFAULT_CONFIG("Using the default config!"), + LIBS_SCOREBOARD_ISSUES("Too many issues found, hidden %s"), + LIBS_SCOREBOARD_NO_ISSUES("No issues found in player disguise scoreboard name teams"), + LD_COMMAND_UPDATEPROTOCOLLIB("/libsdisguises updateprotocollib - Updates ProtocolLib to the latest development version"), + LD_COMMAND_HELP("/libsdisguises help - Returns this!"), + LD_COMMAND_COUNT("/libsdisguises count - Tells you how many active disguises there are"), + LD_COMMAND_METAINFO("/libsdisguises metainfo - Debugging info, tells you what the metadata is for a disguise"), + LD_COMMAND_CONFIG("/libsdisguises config - Tells you what's not normal in your config"), + LD_COMMAND_UPDATE("/libsdisguises update - " + "'update' will fetch an update, 'update dev' will fetch a dev build update, 'update release' will fetch a" + " release build update and 'update!' will download that update!"), - LD_COMMAND_CHANGELOG(ChatColor.BLUE + "/libsdisguises changelog - " + ChatColor.AQUA + "Gives you the changelog of the current update fetched"), - LD_DEBUG_MINESKIN(ChatColor.BLUE + "/libsdisguises mineskin - " + ChatColor.AQUA + "Prints debug information about MineSkin to console"), - LD_DEBUG_MINESKIN_TOGGLE(ChatColor.BLUE + "MineSkin debug is now %s, this command toggles the printing of MineSkin information to console"), - LD_COMMAND_JSON(ChatColor.BLUE + "/libsdisguises json - " + ChatColor.AQUA + "Turns the current held item into a string format"), - LD_COMMAND_MODS(ChatColor.BLUE + "/libsdisguises mods - " + ChatColor.AQUA + - "If using modded entities, this will tell you what mods a player is using if possible"), - LD_COMMAND_PERMTEST(ChatColor.BLUE + "/libsdisguises permtest - " + ChatColor.AQUA + "Does a quick test to see if your permissions are working"), - LD_COMMAND_SCOREBOARD( - ChatColor.BLUE + "/libsdisguises scoreboard - " + ChatColor.AQUA + "Does a test to see if there's any scoreboard issues it can detect"), - LD_COMMAND_RELOAD(ChatColor.BLUE + "/libsdisguises reload - " + ChatColor.AQUA + "Reload's the plugin config and possibly blows disguises"), - LD_COMMAND_DEBUG(ChatColor.BLUE + "/libsdisguises debug - " + ChatColor.AQUA + "Used to help debug scoreboard issues on a player disguise"), - LD_COMMAND_UPLOAD_LOGS(ChatColor.BLUE + "/libsdisguises uploadlogs - " + ChatColor.AQUA + - "Uploads latest.log, disguises.yml and configs and gives you the link to share. Used when seeking " + "assistance."), - SELF_DISGUISE_HIDDEN(ChatColor.GREEN + "Self disguise hidden as it's too tall.."); + LD_COMMAND_CHANGELOG("/libsdisguises changelog - Gives you the changelog of the current update fetched"), + LD_DEBUG_MINESKIN("/libsdisguises mineskin - Prints debug information about MineSkin to console"), + LD_DEBUG_MINESKIN_TOGGLE("MineSkin debug is now %s, this command toggles the printing of MineSkin information to console"), + LD_COMMAND_JSON("/libsdisguises json - Turns the current held item into a string format"), + LD_COMMAND_MODS("/libsdisguises mods - " + "If using modded entities, this will tell you what mods a player is using if possible"), + LD_COMMAND_PERMTEST("/libsdisguises permtest - Does a quick test to see if your permissions are working"), + LD_COMMAND_SCOREBOARD("/libsdisguises scoreboard - Does a test to see if there's any scoreboard issues it can detect"), + LD_COMMAND_RELOAD("/libsdisguises reload - Reload's the plugin config and possibly blows disguises"), + LD_COMMAND_DEBUG("/libsdisguises debug - Used to help debug scoreboard issues on a player disguise"), + LD_COMMAND_UPLOAD_LOGS("/libsdisguises uploadlogs - " + + "Uploads latest.log, disguises.yml and configs and gives you the link to share. Used when seeking assistance."), + SELF_DISGUISE_HIDDEN("Self disguise hidden as it's too tall.."); private final String string; + private final String useString; LibsMsg(String string) { this.string = string; + + if (!DisguiseUtilities.hasAdventureTextSupport()) { + for (ChatColor c : ChatColor.values()) { + string = string.replaceAll("<" + c.name().toLowerCase(Locale.ROOT) + ">", "ยง" + c.getChar()); + } + } + + useString = string; } public String getRaw() { return string; } + public String getStringToUse() { + return useString; + } + public BaseComponent[] getChat(Object... strings) { String string = get(strings); @@ -341,7 +338,7 @@ public enum LibsMsg { .severe("Mismatch in messages, incorrect parameters supplied for " + name() + ". Please inform plugin author if not using translations."); } - String trans = TranslateType.MESSAGES.get(getRaw()); + String trans = TranslateType.MESSAGES.get(this); if (trans.isEmpty() || strings.length == 0) { return trans; diff --git a/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateType.java b/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateType.java index a1a14dc3..542373d0 100644 --- a/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateType.java +++ b/src/main/java/me/libraryaddict/disguise/utilities/translations/TranslateType.java @@ -7,15 +7,12 @@ import org.apache.commons.lang.StringEscapeUtils; import org.apache.commons.lang.StringUtils; import org.bukkit.ChatColor; import org.bukkit.configuration.file.YamlConfiguration; -import org.checkerframework.checker.regex.qual.Regex; import java.io.File; import java.io.FileWriter; import java.io.IOException; import java.nio.file.Files; import java.util.*; -import java.util.regex.Matcher; -import java.util.regex.Pattern; /** * Created by libraryaddict on 10/06/2017. @@ -102,9 +99,9 @@ public enum TranslateType { if (value == null) { DisguiseUtilities.getLogger().severe("Translation for " + name() + " has a null value for the key '" + key + "'"); } else { - String newKey = DisguiseUtilities.translateAlternateColorCodes(key); + toDeDupe.put(key, true); - toDeDupe.put(newKey, true); + String newKey = DisguiseUtilities.translateAlternateColorCodes(key); translated.put(newKey, DisguiseUtilities.translateAlternateColorCodes(value)); if (!newKey.equals(translated.get(newKey))) { @@ -120,7 +117,8 @@ public enum TranslateType { DisguiseUtilities.getLogger().info("Loaded " + translated.size() + " translations for " + name() + " with " + diff + " changed"); } else if (diff > 0 && !DisguiseConfig.isUseTranslations()) { DisguiseUtilities.getLogger() - .info("Translations are disabled in libsdisguises.yml, but you modified " + diff + " messages in the translations for " + name() +". Is this intended?"); + .info("Translations are disabled in libsdisguises.yml, but you modified " + diff + " messages in the translations for " + name() + + ". Is this intended?"); } } @@ -256,6 +254,10 @@ public enum TranslateType { return translated; } + public String get(LibsMsg msg) { + return get(msg.getStringToUse()); + } + public String get(String msg) { if (msg == null || !LibsPremium.isPremium() || !DisguiseConfig.isUseTranslations()) { return msg;