From 0f4333e63b8b7827cba45c39cf258c5537034a2f Mon Sep 17 00:00:00 2001 From: nulli0n Date: Sun, 15 Dec 2024 18:53:46 +0500 Subject: [PATCH] URL update --- .../nightcore/core/CoreConfig.java | 2 +- .../nightcore/core/CorePerms.java | 2 ++ .../nightcore/ui/menu/data/MenuLoader.java | 2 +- .../nightcore/util/Placeholders.java | 19 +++++++++++++++---- .../nightcore/util/text/tag/Tags.java | 10 +++++----- .../util/text/tag/impl/FontStyleTag.java | 10 +++++++--- .../util/text/tag/impl/HexColorTag.java | 2 +- .../util/text/tag/impl/TranslationTag.java | 2 +- 8 files changed, 33 insertions(+), 16 deletions(-) diff --git a/src/main/java/su/nightexpress/nightcore/core/CoreConfig.java b/src/main/java/su/nightexpress/nightcore/core/CoreConfig.java index b59c562..01aa734 100644 --- a/src/main/java/su/nightexpress/nightcore/core/CoreConfig.java +++ b/src/main/java/su/nightexpress/nightcore/core/CoreConfig.java @@ -58,7 +58,7 @@ public class CoreConfig { "Allows to use legacy color codes (such as '&7', '&l', etc.) in plugin configurations.", "This setting exist for backwards compatibility only! There are NO GUARANTEES that it will persist for future updates!", "You should NOT use it unless you need to add support for your custom language configurations & translations with legacy codes.", - "You should migrate to new text format as soon as possible: " + Placeholders.WIKI_TEXT_URL + "You should migrate to new text format as soon as possible: " + Placeholders.URL_WIKI_TEXT ); // public static final ConfigValue RESPECT_PLAYER_DISPLAYNAME = ConfigValue.create("Engine.Respect_Player_DisplayName", diff --git a/src/main/java/su/nightexpress/nightcore/core/CorePerms.java b/src/main/java/su/nightexpress/nightcore/core/CorePerms.java index 8e2fc65..3986120 100644 --- a/src/main/java/su/nightexpress/nightcore/core/CorePerms.java +++ b/src/main/java/su/nightexpress/nightcore/core/CorePerms.java @@ -7,6 +7,8 @@ public class CorePerms { public static final UniPermission COMMAND_RELOAD = new UniPermission("nightcore.command.reload"); public static final UniPermission COMMAND_CHECK_PERM = new UniPermission("nightcore.command.checkperm"); public static final UniPermission COMMAND_DUMP_ITEM = new UniPermission("nightcore.command.dumpitem"); + + @Deprecated public static final UniPermission COMMAND_FLAGS = new UniPermission("nightcore.command.flags"); } diff --git a/src/main/java/su/nightexpress/nightcore/ui/menu/data/MenuLoader.java b/src/main/java/su/nightexpress/nightcore/ui/menu/data/MenuLoader.java index 573a992..50f0c5d 100644 --- a/src/main/java/su/nightexpress/nightcore/ui/menu/data/MenuLoader.java +++ b/src/main/java/su/nightexpress/nightcore/ui/menu/data/MenuLoader.java @@ -149,7 +149,7 @@ public class MenuLoader { "=".repeat(20) + " [SECTION] CONTENT " + "=".repeat(20), "You can freely edit items in this section as you wish (add, remove, modify items).", "> [Item] : Section | Item to display.", - " [*] Navigate to " + Placeholders.WIKI_ITEMS_URL + " for a list of available options.", + " [*] Navigate to " + Placeholders.URL_WIKI_ITEMS + " for a list of available options.", "> [Priority] : Integer | Item priority. Higher values will override other item(s) in the same slot(s).", "> [Slots] : Int Array | Item slots, starts from 0. Split with commas.", " Slots: '0,4,9,10'", diff --git a/src/main/java/su/nightexpress/nightcore/util/Placeholders.java b/src/main/java/su/nightexpress/nightcore/util/Placeholders.java index 1c166f8..6a89466 100644 --- a/src/main/java/su/nightexpress/nightcore/util/Placeholders.java +++ b/src/main/java/su/nightexpress/nightcore/util/Placeholders.java @@ -14,10 +14,21 @@ import java.util.function.UnaryOperator; public class Placeholders { public static final String GITHUB_URL = "https://github.com/nulli0n/nightcore-spigot"; - public static final String WIKI_MAIN_URL = GITHUB_URL + "/wiki/"; - public static final String WIKI_ITEMS_URL = WIKI_MAIN_URL + "ItemStack-Options"; - public static final String WIKI_TEXT_URL = WIKI_MAIN_URL + "Text-Formation"; - public static final String WIKI_LANG_URL = WIKI_MAIN_URL + "Language-Formation"; + + public static final String URL_WIKI = "http://nightexpressdev.com/nightcore/"; + public static final String URL_WIKI_ITEMS = URL_WIKI + "configuration/item-formation/"; + public static final String URL_WIKI_TEXT = URL_WIKI + "configuration/text-formation/"; + public static final String URL_WIKI_LANG = URL_WIKI + "configuration/language/"; + public static final String URL_WIKI_NUMBER = URL_WIKI + "configuration/number-formation/"; + + @Deprecated + public static final String WIKI_MAIN_URL = URL_WIKI; + @Deprecated + public static final String WIKI_ITEMS_URL = URL_WIKI_ITEMS; + @Deprecated + public static final String WIKI_TEXT_URL = URL_WIKI_TEXT; + @Deprecated + public static final String WIKI_LANG_URL = URL_WIKI_LANG; public static final String DEFAULT = "default"; public static final String NONE = "none"; diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/Tags.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/Tags.java index 87db0f8..cbdb5ea 100644 --- a/src/main/java/su/nightexpress/nightcore/util/text/tag/Tags.java +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/Tags.java @@ -29,11 +29,11 @@ public class Tags { public static final ShortHexColorTag HEX_COLOR_SHORT = new ShortHexColorTag(); public static final TranslationTag TRANSLATE = new TranslationTag(); - public static final FontStyleTag BOLD = new FontStyleTag("b", FontStyleTag.Style.BOLD); - public static final FontStyleTag ITALIC = new FontStyleTag("i", FontStyleTag.Style.ITALIC); - public static final FontStyleTag OBFUSCATED = new FontStyleTag("o", FontStyleTag.Style.OBFUSCATED); - public static final FontStyleTag STRIKETHROUGH = new FontStyleTag("s", FontStyleTag.Style.STRIKETHROUGH); - public static final FontStyleTag UNDERLINED = new FontStyleTag("u", FontStyleTag.Style.UNDERLINED); + public static final FontStyleTag BOLD = new FontStyleTag("b", new String[]{"bold"}, FontStyleTag.Style.BOLD); + public static final FontStyleTag ITALIC = new FontStyleTag("i", new String[]{"em", "italic"}, FontStyleTag.Style.ITALIC); + public static final FontStyleTag OBFUSCATED = new FontStyleTag("o", new String[]{"obfuscated", "obf"}, FontStyleTag.Style.OBFUSCATED); + public static final FontStyleTag STRIKETHROUGH = new FontStyleTag("s", new String[]{"strikethrough", "st"}, FontStyleTag.Style.STRIKETHROUGH); + public static final FontStyleTag UNDERLINED = new FontStyleTag("u", new String[]{"underlined"}, FontStyleTag.Style.UNDERLINED); public static final ColorTag BLACK = new ColorTag("black", "#000000"); public static final ColorTag WHITE = new ColorTag("white", "#ffffff"); diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/FontStyleTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/FontStyleTag.java index 7da6a07..b9b5f55 100644 --- a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/FontStyleTag.java +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/FontStyleTag.java @@ -14,18 +14,22 @@ public class FontStyleTag extends SimpleTag implements Decorator { private final Style style; public FontStyleTag(@NotNull String name, @NotNull Style style) { - super(name); + this(name, new String[0], style); + } + + public FontStyleTag(@NotNull String name, String[] aliases, @NotNull Style style) { + super(name, aliases); this.style = style; } @NotNull public Style getStyle() { - return style; + return this.style; } @Override public void decorate(@NotNull BaseComponent component) { - switch (this.getStyle()) { + switch (this.style) { case BOLD -> component.setBold(true); case ITALIC -> component.setItalic(true); case OBFUSCATED -> component.setObfuscated(true); diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/HexColorTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/HexColorTag.java index 9d04f93..3a05f23 100644 --- a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/HexColorTag.java +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/HexColorTag.java @@ -14,7 +14,7 @@ public class HexColorTag extends Tag implements ContentTag { public static final String NAME = "color"; public HexColorTag() { - super(NAME, new String[]{"c"}); + super(NAME, new String[]{"colour", "c"}); } @Override diff --git a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/TranslationTag.java b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/TranslationTag.java index 9cb2c67..1386014 100644 --- a/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/TranslationTag.java +++ b/src/main/java/su/nightexpress/nightcore/util/text/tag/impl/TranslationTag.java @@ -7,6 +7,6 @@ public class TranslationTag extends Tag { public static final String NAME = "translation"; public TranslationTag() { - super(NAME, new String[]{"tr", "lang"}); + super(NAME, new String[]{"tr", "lang", "translate"}); } }