diff --git a/common/src/main/java/software/bluelib/utils/markdown/MarkdownFeature.java b/common/src/main/java/software/bluelib/markdown/MarkdownFeature.java similarity index 99% rename from common/src/main/java/software/bluelib/utils/markdown/MarkdownFeature.java rename to common/src/main/java/software/bluelib/markdown/MarkdownFeature.java index 5b52fcd2..0cf16227 100644 --- a/common/src/main/java/software/bluelib/utils/markdown/MarkdownFeature.java +++ b/common/src/main/java/software/bluelib/markdown/MarkdownFeature.java @@ -1,6 +1,6 @@ // Copyright (c) BlueLib. Licensed under the MIT License. -package software.bluelib.utils.markdown; +package software.bluelib.markdown; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/common/src/main/java/software/bluelib/utils/markdown/MarkdownParser.java b/common/src/main/java/software/bluelib/markdown/MarkdownParser.java similarity index 90% rename from common/src/main/java/software/bluelib/utils/markdown/MarkdownParser.java rename to common/src/main/java/software/bluelib/markdown/MarkdownParser.java index d5668bd6..e3c5a643 100644 --- a/common/src/main/java/software/bluelib/utils/markdown/MarkdownParser.java +++ b/common/src/main/java/software/bluelib/markdown/MarkdownParser.java @@ -1,9 +1,10 @@ // Copyright (c) BlueLib. Licensed under the MIT License. -package software.bluelib.utils.markdown; +package software.bluelib.markdown; import net.minecraft.network.chat.Component; import net.minecraft.network.chat.MutableComponent; +import software.bluelib.markdown.syntax.*; import software.bluelib.utils.logging.BaseLogLevel; import software.bluelib.utils.logging.BaseLogger; @@ -198,6 +199,19 @@ public EnableMarkdownFor underline() { BaseLogger.log(BaseLogLevel.INFO, "Enabled underline markdown", true); return this; } + + /** + * A {@code public} method that enables hyperlink Markdown formatting. + * + * @return The {@link EnableMarkdownFor} instance to allow method chaining. + * @author MeAlam + * @since 1.4.0 + */ + public EnableMarkdownFor hyperlink() { + Hyperlink.isHyperlinkEnabled = true; + BaseLogger.log(BaseLogLevel.INFO, "Enabled hyperlink markdown", true); + return this; + } } /** @@ -263,5 +277,18 @@ public DisableMarkdownFor underline() { BaseLogger.log(BaseLogLevel.INFO, "Disabled underline markdown", true); return this; } + + /** + * A {@code public} method that disables hyperlink Markdown formatting. + * + * @return The {@link DisableMarkdownFor} instance to allow method chaining. + * @author MeAlam + * @since 1.4.0 + */ + public DisableMarkdownFor hyperlink() { + Hyperlink.isHyperlinkEnabled = false; + BaseLogger.log(BaseLogLevel.INFO, "Disabled hyperlink markdown", true); + return this; + } } } diff --git a/common/src/main/java/software/bluelib/utils/markdown/Bold.java b/common/src/main/java/software/bluelib/markdown/syntax/Bold.java similarity index 97% rename from common/src/main/java/software/bluelib/utils/markdown/Bold.java rename to common/src/main/java/software/bluelib/markdown/syntax/Bold.java index 701328e3..95d9b3ae 100644 --- a/common/src/main/java/software/bluelib/utils/markdown/Bold.java +++ b/common/src/main/java/software/bluelib/markdown/syntax/Bold.java @@ -1,7 +1,8 @@ // Copyright (c) BlueLib. Licensed under the MIT License. -package software.bluelib.utils.markdown; +package software.bluelib.markdown.syntax; +import software.bluelib.markdown.MarkdownFeature; import software.bluelib.utils.logging.BaseLogLevel; import software.bluelib.utils.logging.BaseLogger; @@ -39,7 +40,7 @@ public class Bold extends MarkdownFeature { * * @since 1.1.0 */ - protected static Boolean isBoldEnabled = true; + public static Boolean isBoldEnabled = true; /** * A {@code public} constructor that initializes the prefix and suffix for the bold formatting feature. diff --git a/common/src/main/java/software/bluelib/utils/markdown/Hyperlink.java b/common/src/main/java/software/bluelib/markdown/syntax/Hyperlink.java similarity index 98% rename from common/src/main/java/software/bluelib/utils/markdown/Hyperlink.java rename to common/src/main/java/software/bluelib/markdown/syntax/Hyperlink.java index 31ea09c7..231460dc 100644 --- a/common/src/main/java/software/bluelib/utils/markdown/Hyperlink.java +++ b/common/src/main/java/software/bluelib/markdown/syntax/Hyperlink.java @@ -1,8 +1,9 @@ // Copyright (c) BlueLib. Licensed under the MIT License. -package software.bluelib.utils.markdown; +package software.bluelib.markdown.syntax; import net.minecraft.network.chat.*; +import software.bluelib.markdown.MarkdownFeature; import software.bluelib.utils.logging.BaseLogLevel; import software.bluelib.utils.logging.BaseLogger; import software.bluelib.utils.math.MiscUtils; @@ -41,7 +42,7 @@ public class Hyperlink extends MarkdownFeature { * * @since 1.4.0 */ - protected static Boolean isHyperlinkEnabled = true; + public static Boolean isHyperlinkEnabled = true; /** * A {@code public} constructor that initializes the prefix and suffix for the Hyperlink formatting feature. diff --git a/common/src/main/java/software/bluelib/utils/markdown/Italic.java b/common/src/main/java/software/bluelib/markdown/syntax/Italic.java similarity index 97% rename from common/src/main/java/software/bluelib/utils/markdown/Italic.java rename to common/src/main/java/software/bluelib/markdown/syntax/Italic.java index a272baad..c4595416 100644 --- a/common/src/main/java/software/bluelib/utils/markdown/Italic.java +++ b/common/src/main/java/software/bluelib/markdown/syntax/Italic.java @@ -1,7 +1,8 @@ // Copyright (c) BlueLib. Licensed under the MIT License. -package software.bluelib.utils.markdown; +package software.bluelib.markdown.syntax; +import software.bluelib.markdown.MarkdownFeature; import software.bluelib.utils.logging.BaseLogLevel; import software.bluelib.utils.logging.BaseLogger; @@ -40,7 +41,7 @@ public class Italic extends MarkdownFeature { * * @since 1.1.0 */ - protected static Boolean isItalicEnabled = true; + public static Boolean isItalicEnabled = true; /** * A {@code public} constructor that initializes the prefix and suffix for the italic formatting feature. diff --git a/common/src/main/java/software/bluelib/utils/markdown/Strikethrough.java b/common/src/main/java/software/bluelib/markdown/syntax/Strikethrough.java similarity index 97% rename from common/src/main/java/software/bluelib/utils/markdown/Strikethrough.java rename to common/src/main/java/software/bluelib/markdown/syntax/Strikethrough.java index 2101ee6e..571bbaae 100644 --- a/common/src/main/java/software/bluelib/utils/markdown/Strikethrough.java +++ b/common/src/main/java/software/bluelib/markdown/syntax/Strikethrough.java @@ -1,7 +1,8 @@ // Copyright (c) BlueLib. Licensed under the MIT License. -package software.bluelib.utils.markdown; +package software.bluelib.markdown.syntax; +import software.bluelib.markdown.MarkdownFeature; import software.bluelib.utils.logging.BaseLogLevel; import software.bluelib.utils.logging.BaseLogger; @@ -40,7 +41,7 @@ public class Strikethrough extends MarkdownFeature { * * @since 1.1.0 */ - protected static Boolean isStrikethroughEnabled = true; + public static Boolean isStrikethroughEnabled = true; /** * A {@code public} constructor that initializes the prefix and suffix for the strikethrough formatting feature. diff --git a/common/src/main/java/software/bluelib/utils/markdown/Underline.java b/common/src/main/java/software/bluelib/markdown/syntax/Underline.java similarity index 97% rename from common/src/main/java/software/bluelib/utils/markdown/Underline.java rename to common/src/main/java/software/bluelib/markdown/syntax/Underline.java index 443dbf8f..473411e3 100644 --- a/common/src/main/java/software/bluelib/utils/markdown/Underline.java +++ b/common/src/main/java/software/bluelib/markdown/syntax/Underline.java @@ -1,7 +1,8 @@ // Copyright (c) BlueLib. Licensed under the MIT License. -package software.bluelib.utils.markdown; +package software.bluelib.markdown.syntax; +import software.bluelib.markdown.MarkdownFeature; import software.bluelib.utils.logging.BaseLogLevel; import software.bluelib.utils.logging.BaseLogger; @@ -40,7 +41,7 @@ public class Underline extends MarkdownFeature { * * @since 1.1.0 */ - protected static Boolean isUnderlineEnabled = true; + public static Boolean isUnderlineEnabled = true; /** * A {@code public} constructor that initializes the prefix and suffix for the underline formatting feature. diff --git a/fabric/src/main/java/software/bluelib/example/event/ChatHandler.java b/fabric/src/main/java/software/bluelib/example/event/ChatHandler.java index 0adde4db..fdf46d2c 100644 --- a/fabric/src/main/java/software/bluelib/example/event/ChatHandler.java +++ b/fabric/src/main/java/software/bluelib/example/event/ChatHandler.java @@ -6,7 +6,7 @@ import net.minecraft.network.chat.OutgoingChatMessage; import net.minecraft.network.chat.PlayerChatMessage; import net.minecraft.server.level.ServerPlayer; -import software.bluelib.utils.markdown.MarkdownParser; +import software.bluelib.markdown.MarkdownParser; /** * A {@code public class} responsible for handling server chat events and formatting chat messages using Markdown. diff --git a/neoforge/src/main/java/software/bluelib/example/event/ChatHandler.java b/neoforge/src/main/java/software/bluelib/example/event/ChatHandler.java index 170018bf..1b9e1672 100644 --- a/neoforge/src/main/java/software/bluelib/example/event/ChatHandler.java +++ b/neoforge/src/main/java/software/bluelib/example/event/ChatHandler.java @@ -6,7 +6,7 @@ import net.neoforged.bus.api.SubscribeEvent; import net.neoforged.fml.common.EventBusSubscriber; import net.neoforged.neoforge.event.ServerChatEvent; -import software.bluelib.utils.markdown.MarkdownParser; +import software.bluelib.markdown.MarkdownParser; /** * A {@code public class} responsible for handling server chat events and formatting chat messages using Markdown.