aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/eu/olli/cowlection/util/MooChatComponent.java
diff options
context:
space:
mode:
authorCow <cow@volloeko.de>2020-07-28 00:12:36 +0200
committerCow <cow@volloeko.de>2020-07-28 00:12:36 +0200
commitb393636cb3f7e05ef8b34804eeb06357f1b9cfbe (patch)
treed754561fd2e2f09ac66f41b2645ac5f351c1cace /src/main/java/eu/olli/cowlection/util/MooChatComponent.java
parent023589c75ae72ddc5ff75fa7235bce4d102b2ad1 (diff)
downloadCowlection-b393636cb3f7e05ef8b34804eeb06357f1b9cfbe.tar.gz
Cowlection-b393636cb3f7e05ef8b34804eeb06357f1b9cfbe.tar.bz2
Cowlection-b393636cb3f7e05ef8b34804eeb06357f1b9cfbe.zip
Renamed package to match cowtipper.de
Diffstat (limited to 'src/main/java/eu/olli/cowlection/util/MooChatComponent.java')
-rw-r--r--src/main/java/eu/olli/cowlection/util/MooChatComponent.java186
1 files changed, 0 insertions, 186 deletions
diff --git a/src/main/java/eu/olli/cowlection/util/MooChatComponent.java b/src/main/java/eu/olli/cowlection/util/MooChatComponent.java
deleted file mode 100644
index 0c6a141..0000000
--- a/src/main/java/eu/olli/cowlection/util/MooChatComponent.java
+++ /dev/null
@@ -1,186 +0,0 @@
-package eu.olli.cowlection.util;
-
-import net.minecraft.event.ClickEvent;
-import net.minecraft.event.HoverEvent;
-import net.minecraft.util.ChatComponentText;
-import net.minecraft.util.EnumChatFormatting;
-import net.minecraft.util.IChatComponent;
-
-public class MooChatComponent extends ChatComponentText {
- public MooChatComponent(String msg) {
- super(msg);
- }
-
- public MooChatComponent black() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.BLACK));
- return this;
- }
-
- public MooChatComponent darkBlue() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.DARK_BLUE));
- return this;
- }
-
- public MooChatComponent darkGreen() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.DARK_GREEN));
- return this;
- }
-
- public MooChatComponent darkAqua() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.DARK_AQUA));
- return this;
- }
-
- public MooChatComponent darkRed() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.DARK_RED));
- return this;
- }
-
- public MooChatComponent darkPurple() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.DARK_PURPLE));
- return this;
- }
-
- public MooChatComponent gold() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.GOLD));
- return this;
- }
-
- public MooChatComponent gray() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.GRAY));
- return this;
- }
-
- public MooChatComponent darkGray() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.DARK_GRAY));
- return this;
- }
-
- public MooChatComponent blue() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.BLUE));
- return this;
- }
-
- public MooChatComponent green() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.GREEN));
- return this;
- }
-
- public MooChatComponent aqua() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.AQUA));
- return this;
- }
-
- public MooChatComponent red() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.RED));
- return this;
- }
-
- public MooChatComponent lightPurple() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.LIGHT_PURPLE));
- return this;
- }
-
- public MooChatComponent yellow() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.YELLOW));
- return this;
- }
-
- public MooChatComponent white() {
- setChatStyle(getChatStyle().setColor(EnumChatFormatting.WHITE));
- return this;
- }
-
- public MooChatComponent obfuscated() {
- setChatStyle(getChatStyle().setObfuscated(true));
- return this;
- }
-
- public MooChatComponent bold() {
- setChatStyle(getChatStyle().setBold(true));
- return this;
- }
-
- public MooChatComponent strikethrough() {
- setChatStyle(getChatStyle().setStrikethrough(true));
- return this;
- }
-
- public MooChatComponent underline() {
- setChatStyle(getChatStyle().setUnderlined(true));
- return this;
- }
-
- public MooChatComponent italic() {
- setChatStyle(getChatStyle().setItalic(true));
- return this;
- }
-
- public MooChatComponent reset() {
- setChatStyle(getChatStyle().setParentStyle(null).setBold(false).setItalic(false).setObfuscated(false).setUnderlined(false).setStrikethrough(false));
- return this;
- }
-
- public MooChatComponent setHover(IChatComponent hover) {
- setChatStyle(getChatStyle().setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, hover)));
- return this;
- }
-
- public MooChatComponent setUrl(String url) {
- setUrl(url, new KeyValueTooltipComponent("Click to visit", url));
- return this;
- }
-
- public MooChatComponent setUrl(String url, String hover) {
- setUrl(url, new MooChatComponent(hover).yellow());
- return this;
- }
-
- public MooChatComponent setUrl(String url, IChatComponent hover) {
- setChatStyle(getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.OPEN_URL, url)));
- setHover(hover);
- return this;
- }
-
- public MooChatComponent setSuggestCommand(String command) {
- setChatStyle(getChatStyle().setChatClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, command)));
- setHover(new KeyValueChatComponent("Run", command, " "));
- return this;
- }
-
- /**
- * Appends the given component in a new line, without inheriting formatting of previous siblings.
- *
- * @see ChatComponentText#appendSibling appendSibling
- */
- public MooChatComponent appendFreshSibling(IChatComponent sibling) {
- this.siblings.add(new ChatComponentText("\n").appendSibling(sibling));
- return this;
- }
-
- @Deprecated
- public MooChatComponent appendKeyValue(String key, String value) {
- appendSibling(new MooChatComponent("\n").appendFreshSibling(new KeyValueChatComponent(key, value)));
- return this;
- }
-
- public static class KeyValueChatComponent extends MooChatComponent {
- public KeyValueChatComponent(String key, String value) {
- this(key, value, ": ");
- }
-
- public KeyValueChatComponent(String key, String value, String separator) {
- super(key);
- appendText(separator);
- gold().appendSibling(new MooChatComponent(value).yellow());
- }
- }
-
- public static class KeyValueTooltipComponent extends MooChatComponent {
- public KeyValueTooltipComponent(String key, String value) {
- super(key);
- appendText(": ");
- gray().appendSibling(new MooChatComponent(value).yellow());
- }
- }
-}