diff options
| author | Cow <cow@volloeko.de> | 2020-12-17 19:28:09 +0100 |
|---|---|---|
| committer | Cow <cow@volloeko.de> | 2020-12-17 19:28:09 +0100 |
| commit | 43485912b30895d5735a445d3ebd2f831df004af (patch) | |
| tree | b91458549cb35ca8fae0fd79cfdd961585cf4c69 /src/main/java/de/cowtipper/cowlection/util | |
| parent | a5469082c9feafa5512c1b0e81dec371db785042 (diff) | |
| download | Cowlection-43485912b30895d5735a445d3ebd2f831df004af.tar.gz Cowlection-43485912b30895d5735a445d3ebd2f831df004af.tar.bz2 Cowlection-43485912b30895d5735a445d3ebd2f831df004af.zip | |
Various small, code inspection related changes
Diffstat (limited to 'src/main/java/de/cowtipper/cowlection/util')
5 files changed, 13 insertions, 13 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/util/ChatHelper.java b/src/main/java/de/cowtipper/cowlection/util/ChatHelper.java index 0f06bec..42a5790 100644 --- a/src/main/java/de/cowtipper/cowlection/util/ChatHelper.java +++ b/src/main/java/de/cowtipper/cowlection/util/ChatHelper.java @@ -74,7 +74,7 @@ public class ChatHelper { } public void sendShrug(String... args) { - String chatMsg = "\u00AF\\_(\u30C4)_/\u00AF"; // ¯\\_(ツ)_/¯" + String chatMsg = "¯\\_(ツ)_/¯"; if (args.length > 0) { chatMsg = String.join(" ", args) + " " + chatMsg; } diff --git a/src/main/java/de/cowtipper/cowlection/util/GuiHelper.java b/src/main/java/de/cowtipper/cowlection/util/GuiHelper.java index a80b1ba..b904670 100644 --- a/src/main/java/de/cowtipper/cowlection/util/GuiHelper.java +++ b/src/main/java/de/cowtipper/cowlection/util/GuiHelper.java @@ -164,7 +164,6 @@ public final class GuiHelper extends GuiScreen { tooltipY = screenHeight - tooltipHeight - 6; } - final int zLevel = 300; final int backgroundColor = 0xF0100010; Gui.drawRect(tooltipX - 3, tooltipY - 4, tooltipX + tooltipTextWidth + 3, tooltipY - 3, backgroundColor); Gui.drawRect(tooltipX - 3, tooltipY + tooltipHeight + 3, tooltipX + tooltipTextWidth + 3, tooltipY + tooltipHeight + 4, backgroundColor); diff --git a/src/main/java/de/cowtipper/cowlection/util/TickDelay.java b/src/main/java/de/cowtipper/cowlection/util/TickDelay.java index cbb21c5..a07a452 100644 --- a/src/main/java/de/cowtipper/cowlection/util/TickDelay.java +++ b/src/main/java/de/cowtipper/cowlection/util/TickDelay.java @@ -5,7 +5,7 @@ import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; public class TickDelay { - private Runnable task; + private final Runnable task; private int waitingTicks; public TickDelay(Runnable task, int ticks) { diff --git a/src/main/java/de/cowtipper/cowlection/util/Utils.java b/src/main/java/de/cowtipper/cowlection/util/Utils.java index b4d62f8..8e8723c 100644 --- a/src/main/java/de/cowtipper/cowlection/util/Utils.java +++ b/src/main/java/de/cowtipper/cowlection/util/Utils.java @@ -29,8 +29,8 @@ public final class Utils { return VALID_UUID_PATTERN.matcher(uuid).matches(); } - public static boolean isValidMcName(String username) { - return VALID_USERNAME.matcher(username).matches(); + public static boolean isInvalidMcName(String username) { + return !VALID_USERNAME.matcher(username).matches(); } public static String fancyCase(String string) { @@ -215,8 +215,9 @@ public final class Utils { return five + one + one + one; case 9: return one + ten; + default: + return ""; } - return ""; } /** diff --git a/src/main/java/de/cowtipper/cowlection/util/VersionChecker.java b/src/main/java/de/cowtipper/cowlection/util/VersionChecker.java index d463d04..7f859a6 100644 --- a/src/main/java/de/cowtipper/cowlection/util/VersionChecker.java +++ b/src/main/java/de/cowtipper/cowlection/util/VersionChecker.java @@ -69,21 +69,21 @@ public class VersionChecker { if (isCommandTriggered) { if (versionResult.status == ForgeVersion.Status.UP_TO_DATE) { // up to date - statusMsg = new ChatComponentText("\u2714 You're running the latest version (" + Cowlection.VERSION + ").").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)); + statusMsg = new ChatComponentText("✔ You're running the latest version (" + Cowlection.VERSION + ").").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)); } else if (versionResult.status == ForgeVersion.Status.PENDING) { // pending - statusMsg = new ChatComponentText("\u279C " + "Version check either failed or is still running.").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)) - .appendSibling(new ChatComponentText("\n \u278A Check for results again in a few seconds with " + EnumChatFormatting.GOLD + "/moo version").setChatStyle(new ChatStyle() + statusMsg = new ChatComponentText("➜ " + "Version check either failed or is still running.").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)) + .appendSibling(new ChatComponentText("\n ➊ Check for results again in a few seconds with " + EnumChatFormatting.GOLD + "/moo version").setChatStyle(new ChatStyle() .setColor(EnumChatFormatting.YELLOW) .setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/moo version")) .setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(EnumChatFormatting.YELLOW + "Run " + EnumChatFormatting.GOLD + "/moo version"))))) - .appendSibling(new ChatComponentText("\n \u278B Re-run update check with " + EnumChatFormatting.GOLD + "/moo update").setChatStyle(new ChatStyle() + .appendSibling(new ChatComponentText("\n ➋ Re-run update check with " + EnumChatFormatting.GOLD + "/moo update").setChatStyle(new ChatStyle() .setColor(EnumChatFormatting.YELLOW) .setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/moo update")) .setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(EnumChatFormatting.YELLOW + "Run " + EnumChatFormatting.GOLD + "/moo update"))))); } else if (versionResult.status == ForgeVersion.Status.FAILED) { // check failed - statusMsg = new ChatComponentText("\u2716 Version check failed for an unknown reason. Check again in a few seconds with ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)) + statusMsg = new ChatComponentText("✖ Version check failed for an unknown reason. Check again in a few seconds with ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.RED)) .appendSibling(new ChatComponentText("/moo update").setChatStyle(new ChatStyle() .setColor(EnumChatFormatting.GOLD) .setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/moo update")) @@ -94,7 +94,7 @@ public class VersionChecker { // outdated IChatComponent spacer = new ChatComponentText(" ").setChatStyle(new ChatStyle().setParentStyle(null)); - IChatComponent text = new ChatComponentText("\u279C New version of " + EnumChatFormatting.DARK_GREEN + Cowlection.MODNAME + " " + EnumChatFormatting.GREEN + "available (" + Cowlection.VERSION + " \u27A1 " + newVersion + ")\n").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)); + IChatComponent text = new ChatComponentText("➜ New version of " + EnumChatFormatting.DARK_GREEN + Cowlection.MODNAME + " " + EnumChatFormatting.GREEN + "available (" + Cowlection.VERSION + " ➡ " + newVersion + ")\n").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)); IChatComponent download = new ChatComponentText("[Download]").setChatStyle(new ChatStyle() .setColor(EnumChatFormatting.DARK_GREEN).setBold(true) @@ -114,7 +114,7 @@ public class VersionChecker { IChatComponent openModsDirectory = new ChatComponentText("\n[Open Mods directory]").setChatStyle(new ChatStyle() .setColor(EnumChatFormatting.GREEN).setBold(true) .setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/moo directory")) - .setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(EnumChatFormatting.YELLOW + "Open mods directory with command " + EnumChatFormatting.GOLD + "/moo directory\n\u279C Click to open mods directory")))); + .setChatHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, new ChatComponentText(EnumChatFormatting.YELLOW + "Open mods directory with command " + EnumChatFormatting.GOLD + "/moo directory\n➜ Click to open mods directory")))); statusMsg = text.appendSibling(download).appendSibling(spacer).appendSibling(changelog).appendSibling(spacer).appendSibling(updateInstructions).appendSibling(spacer).appendSibling(openModsDirectory); } |
