From 72822bf1ee028287d535f50b59f96994dfe0b2fa Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Sat, 8 Jun 2024 15:22:30 +0800 Subject: [PATCH 1/3] Refactor and add more tips --- .../de/hysky/skyblocker/SkyblockerScreen.java | 33 ++++--- .../config/categories/GeneralCategory.java | 8 ++ .../de/hysky/skyblocker/skyblock/Tips.java | 96 +++++++++++++------ .../assets/skyblocker/lang/en_us.json | 23 +++++ 4 files changed, 120 insertions(+), 40 deletions(-) diff --git a/src/main/java/de/hysky/skyblocker/SkyblockerScreen.java b/src/main/java/de/hysky/skyblocker/SkyblockerScreen.java index 15c855a0a0..1fdbe03822 100644 --- a/src/main/java/de/hysky/skyblocker/SkyblockerScreen.java +++ b/src/main/java/de/hysky/skyblocker/SkyblockerScreen.java @@ -1,7 +1,5 @@ package de.hysky.skyblocker; -import java.time.LocalDate; - import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.skyblock.Tips; import de.hysky.skyblocker.utils.scheduler.Scheduler; @@ -11,11 +9,7 @@ import net.minecraft.client.gui.DrawContext; import net.minecraft.client.gui.screen.ConfirmLinkScreen; import net.minecraft.client.gui.screen.Screen; -import net.minecraft.client.gui.widget.ButtonWidget; -import net.minecraft.client.gui.widget.GridWidget; -import net.minecraft.client.gui.widget.MultilineTextWidget; -import net.minecraft.client.gui.widget.TextWidget; -import net.minecraft.client.gui.widget.ThreePartsLayoutWidget; +import net.minecraft.client.gui.widget.*; import net.minecraft.screen.ScreenTexts; import net.minecraft.text.OrderedText; import net.minecraft.text.StringVisitable; @@ -23,6 +17,8 @@ import net.minecraft.util.Identifier; import net.minecraft.util.Language; +import java.time.LocalDate; + public class SkyblockerScreen extends Screen { private static final int SPACING = 8; private static final int BUTTON_WIDTH = 210; @@ -36,7 +32,8 @@ public class SkyblockerScreen extends Screen { private static final Text TRANSLATE_TEXT = Text.translatable("text.skyblocker.translate"); private static final Text MODRINTH_TEXT = Text.translatable("text.skyblocker.modrinth"); private static final Text DISCORD_TEXT = Text.translatable("text.skyblocker.discord"); - private final ThreePartsLayoutWidget layout = new ThreePartsLayoutWidget(this); + private ThreePartsLayoutWidget layout; + private MultilineTextWidget tip; static { LocalDate date = LocalDate.now(); @@ -44,7 +41,7 @@ public class SkyblockerScreen extends Screen { ICON = date.getMonthValue() == 4 && date.getDayOfMonth() == 1 ? new Identifier(SkyblockerMod.NAMESPACE, "icons.png") : new Identifier(SkyblockerMod.NAMESPACE, "icon.png"); } - private SkyblockerScreen() { + public SkyblockerScreen() { super(TITLE); } @@ -57,6 +54,7 @@ public static void initClass() { @Override protected void init() { + this.layout = new ThreePartsLayoutWidget(this, 50, 100); this.layout.addHeader(new IconTextWidget(this.getTitle(), this.textRenderer, ICON)); GridWidget gridWidget = this.layout.addBody(new GridWidget()).setSpacing(SPACING); @@ -72,17 +70,26 @@ protected void init() { adder.add(ButtonWidget.builder(DISCORD_TEXT, ConfirmLinkScreen.opening(this, "https://discord.gg/aNNJHQykck")).width(HALF_BUTTON_WIDTH).build()); adder.add(ButtonWidget.builder(ScreenTexts.DONE, button -> this.close()).width(BUTTON_WIDTH).build(), 2); - MultilineTextWidget tip = new MultilineTextWidget(Text.translatable("skyblocker.tips.tip", Tips.nextTipInternal()), this.textRenderer) - .setCentered(true) - .setMaxWidth((int) (this.width * 0.7)); + GridWidget footerGridWidget = this.layout.addFooter(new GridWidget()).setSpacing(SPACING).setRowSpacing(0); + footerGridWidget.getMainPositioner().alignHorizontalCenter(); + GridWidget.Adder footerAdder = footerGridWidget.createAdder(2); + footerAdder.add(tip = new MultilineTextWidget(Tips.nextTip(), this.textRenderer).setCentered(true).setMaxWidth((int) (this.width * 0.7)), 2); + footerAdder.add(ButtonWidget.builder(Text.translatable("skyblocker.tips.previous"), button -> { + tip.setMessage(Tips.previousTip()); + layout.refreshPositions(); + }).build()); + footerAdder.add(ButtonWidget.builder(Text.translatable("skyblocker.tips.next"), button -> { + tip.setMessage(Tips.nextTip()); + layout.refreshPositions(); + }).build()); - this.layout.addFooter(tip); this.layout.refreshPositions(); this.layout.forEachChild(this::addDrawableChild); } @Override protected void initTabNavigation() { + super.initTabNavigation(); this.layout.refreshPositions(); } diff --git a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java index 1477d669fc..2015e75f1c 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/GeneralCategory.java @@ -1,5 +1,6 @@ package de.hysky.skyblocker.config.categories; +import de.hysky.skyblocker.SkyblockerScreen; import de.hysky.skyblocker.config.ConfigUtils; import de.hysky.skyblocker.config.SkyblockerConfig; import de.hysky.skyblocker.config.configs.GeneralConfig; @@ -16,6 +17,13 @@ public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig return ConfigCategory.createBuilder() .name(Text.translatable("skyblocker.config.general")) + //Skyblocker Screen + .option(ButtonOption.createBuilder() + .name(Text.translatable("skyblocker.skyblockerScreen")) + .text(Text.translatable("text.skyblocker.open")) + .action((screen, opt) -> MinecraftClient.getInstance().setScreen(new SkyblockerScreen())) + .build()) + //Ungrouped Options .option(Option.createBuilder() .name(Text.translatable("skyblocker.config.general.enableTips")) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/Tips.java b/src/main/java/de/hysky/skyblocker/skyblock/Tips.java index 513dc4b772..fb29dc3ab2 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/Tips.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/Tips.java @@ -14,16 +14,16 @@ import net.minecraft.text.ClickEvent; import net.minecraft.text.Text; +import java.util.ArrayList; +import java.util.Collections; import java.util.List; -import java.util.Random; import java.util.function.Supplier; import static net.fabricmc.fabric.api.client.command.v2.ClientCommandManager.literal; public class Tips { - private static final Random RANDOM = new Random(); - private static int previousTipIndex = -1; - private static final List> TIPS = List.of( + private static int currentTipIndex = 0; + private static final List> TIPS = new ArrayList<>(List.of( getTipFactory("skyblocker.tips.customItemNames", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker custom renameItem"), getTipFactory("skyblocker.tips.customArmorDyeColors", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker custom dyeColor"), getTipFactory("skyblocker.tips.customArmorTrims", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker custom armorTrim"), @@ -36,15 +36,33 @@ public class Tips { getTipFactory("skyblocker.tips.gallery", ClickEvent.Action.OPEN_URL, "https://hysky.de/skyblocker/gallery"), getTipFactory("skyblocker.tips.itemRarityBackground", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker config"), getTipFactory("skyblocker.tips.modMenuUpdate"), - getTipFactory("skyblocker.tips.issues", ClickEvent.Action.OPEN_URL, "https://github.com/SkyblockerMod/Skyblocker"), + getTipFactory("skyblocker.tips.issues", ClickEvent.Action.OPEN_URL, "https://github.com/SkyblockerMod/Skyblocker/issues"), getTipFactory("skyblocker.tips.beta", ClickEvent.Action.OPEN_URL, "https://github.com/SkyblockerMod/Skyblocker/actions"), + getTipFactory("skyblocker.tips.contribute", ClickEvent.Action.OPEN_URL, "https://github.com/SkyblockerMod/Skyblocker/wiki/contribute"), getTipFactory("skyblocker.tips.discord", ClickEvent.Action.OPEN_URL, "https://discord.gg/aNNJHQykck"), getTipFactory("skyblocker.tips.flameOverlay", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker config"), getTipFactory("skyblocker.tips.wikiLookup", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker config"), getTipFactory("skyblocker.tips.protectItem", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker protectItem"), getTipFactory("skyblocker.tips.fairySoulsEnigmaSoulsRelics", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker fairySouls"), - getTipFactory("skyblocker.tips.quickNav", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker config") - ); + getTipFactory("skyblocker.tips.quickNav", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker config"), + getTipFactory("skyblocker.tips.waypoints", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker waypoint"), + getTipFactory("skyblocker.tips.orderedWaypoints", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker waypoint ordered"), + getTipFactory("skyblocker.tips.visitorHelper"), + getTipFactory("skyblocker.tips.slotText"), + getTipFactory("skyblocker.tips.profileViewer", ClickEvent.Action.SUGGEST_COMMAND, "/pv"), + getTipFactory("skyblocker.tips.configSearch", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker config"), + getTipFactory("skyblocker.tips.compactDamage", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker config"), + getTipFactory("skyblocker.tips.skyblockerScreen", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker"), + getTipFactory("skyblocker.tips.tipsClick", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker tips next"), + getTipFactory("skyblocker.tips.eventNotifications", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker config"), + getTipFactory("skyblocker.tips.signCalculator"), + getTipFactory("skyblocker.tips.fancierBars", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker bars"), + getTipFactory("skyblocker.tips.crystalWaypointsShare", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker crystalWaypoints share"), + getTipFactory("skyblocker.tips.gardenMouseLock", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker config"), + getTipFactory("skyblocker.tips.newYearCakesHelper"), + getTipFactory("skyblocker.tips.accessoryHelper"), + getTipFactory("skyblocker.tips.fancyAuctionHouseCheapHighlight") + )); private static boolean sentTip = false; @@ -59,24 +77,18 @@ private static Supplier getTipFactory(String key, ClickEvent.Action clickA public static void init() { ClientCommandRegistrationCallback.EVENT.register(Tips::registerTipsCommand); SkyblockEvents.JOIN.register(Tips::sendNextTip); + Collections.shuffle(TIPS); } private static void registerTipsCommand(CommandDispatcher dispatcher, CommandRegistryAccess registryAccess) { dispatcher.register(literal(SkyblockerMod.NAMESPACE).then(literal("tips") .then(literal("enable").executes(Tips::enableTips)) .then(literal("disable").executes(Tips::disableTips)) - .then(literal("next").executes(Tips::nextTip)) + .then(literal("previous").executes(Tips::sendPreviousTipCommand)) + .then(literal("next").executes(Tips::sendNextTipCommand)) )); } - private static void sendNextTip() { - MinecraftClient client = MinecraftClient.getInstance(); - if (client.player != null && SkyblockerConfigManager.get().general.enableTips && !sentTip) { - client.player.sendMessage(nextTip(), false); - sentTip = true; - } - } - private static int enableTips(CommandContext context) { SkyblockerConfigManager.get().general.enableTips = true; SkyblockerConfigManager.save(); @@ -91,22 +103,52 @@ private static int disableTips(CommandContext context return Command.SINGLE_SUCCESS; } - private static int nextTip(CommandContext context) { - context.getSource().sendFeedback(nextTip()); + private static void sendNextTip() { + MinecraftClient client = MinecraftClient.getInstance(); + if (client.player != null && SkyblockerConfigManager.get().general.enableTips && !sentTip) { + client.player.sendMessage(tipMessage(nextTip()), false); + sentTip = true; + } + } + + private static int sendNextTipCommand(CommandContext context) { + context.getSource().sendFeedback(tipMessage(nextTip())); return Command.SINGLE_SUCCESS; } - private static Text nextTip() { - return Constants.PREFIX.get().append(Text.translatable("skyblocker.tips.tip", nextTipInternal())) + public static Text nextTip() { + return Text.translatable("skyblocker.tips.tip", nextTipInternal()); + } + + private static Text nextTipInternal() { + currentTipIndex++; + currentTipIndex %= TIPS.size(); + return TIPS.get(currentTipIndex).get(); + } + + private static int sendPreviousTipCommand(CommandContext context) { + context.getSource().sendFeedback(tipMessage(previousTip())); + return Command.SINGLE_SUCCESS; + } + + public static Text previousTip() { + return Text.translatable("skyblocker.tips.tip", previousTipInternal()); + } + + private static Text previousTipInternal() { + currentTipIndex--; + currentTipIndex += TIPS.size(); + currentTipIndex %= TIPS.size(); + return TIPS.get(currentTipIndex).get(); + } + + private static Text tipMessage(Text tip) { + return Constants.PREFIX.get().append(tip) + .append(" ") + .append(Text.translatable("skyblocker.tips.clickPreviousTip").styled(style -> style.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/skyblocker tips previous")))) + .append(" ") .append(Text.translatable("skyblocker.tips.clickNextTip").styled(style -> style.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/skyblocker tips next")))) .append(" ") .append(Text.translatable("skyblocker.tips.clickDisable").styled(style -> style.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/skyblocker tips disable")))); } - - public static Text nextTipInternal() { - int randomInt = RANDOM.nextInt(TIPS.size()); - while (randomInt == previousTipIndex) randomInt = RANDOM.nextInt(TIPS.size()); - previousTipIndex = randomInt; - return TIPS.get(randomInt).get(); - } } diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 9361c941dd..35cd4ec148 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -19,6 +19,8 @@ "text.skyblocker.modrinth": "Modrinth", "text.skyblocker.discord": "Discord", + "skyblocker.skyblockerScreen": "Skyblocker Main Screen", + "skyblocker.config.title": "Skyblocker Settings", "skyblocker.config.crimsonIsle": "Crimson Isle", @@ -779,8 +781,11 @@ "skyblocker.tips.enabled": "§aEnabled Tips.", "skyblocker.tips.disabled": "§cDisabled Tips.", + "skyblocker.tips.previous": "Previous Tip", + "skyblocker.tips.next": "Next Tip", "skyblocker.tips.clickEnable": "§a[Click to Enable Tips]", "skyblocker.tips.clickDisable": "§c[Click to Disable Tips]", + "skyblocker.tips.clickPreviousTip": "§b[Click for Previous Tip]", "skyblocker.tips.clickNextTip": "§a[Click for Next Tip]", "skyblocker.tips.tip": "§aTip: %s\n", "skyblocker.tips.customItemNames": "Customize the names of your items with /skyblocker custom renameItem", @@ -797,12 +802,30 @@ "skyblocker.tips.modMenuUpdate": "ModMenu will let you know if there's an update available for Skyblocker for your game version.", "skyblocker.tips.issues": "Submit bug reports and feature requests to https://github.com/SkyblockerMod/Skyblocker.", "skyblocker.tips.beta": "We often have beta versions available from GitHub Actions that contain new and experimental features.", + "skyblocker.tips.contribute": "We welcome contributions to the mod! See https://github.com/SkyblockerMod/Skyblocker/wiki/contribute for more info.", "skyblocker.tips.discord": "Join our discord at https://discord.gg/aNNJHQykck to keep up with the latest news about Skyblocker!", "skyblocker.tips.flameOverlay": "Find that the flame overlay takes up too much screen space? Check out the config to make it smaller", "skyblocker.tips.wikiLookup": "Press F4 while hovering over an item to open its wiki page in your web browser.", "skyblocker.tips.protectItem": "Prevent accidentally dropping your items with /skyblocker protectItem.", "skyblocker.tips.fairySoulsEnigmaSoulsRelics": "Don't know where to find Fairy Souls, Enigma Souls, or Relics? Enable the helpers to aid your exploration, they'll remember which souls you've already found.", "skyblocker.tips.quickNav": "You can customize the QuickNav buttons in the config.", + "skyblocker.tips.waypoints": "You can import (including from skytils), add, remove, and toggle waypoints on any island with /skyblocker waypoints.", + "skyblocker.tips.orderedWaypoints": "You can import (including from coleweight), add, remove, and toggle ordered waypoints with /skyblocker waypoints ordered.", + "skyblocker.tips.visitorHelper": "Click on the item name in the visitor helper to buy from the bazaar or click on [Copy Amount] to copy the amount to your clipboard.", + "skyblocker.tips.slotText": "Slot text shows you the attribute shard info, catacombs level, collection level, enchantment book level, minion level, pet level, potion level, prehistoric egg blocks walked, rancher's boots speed cap, skill level, skyblock level in the slot.", + "skyblocker.tips.profileViewer": "You can view other player's profiles with /pv.", + "skyblocker.tips.configSearch": "You can search the entire config using the search bar on the bottom right of the config screen.", + "skyblocker.tips.compactDamage": "Customize your damage value with Compact Damage in the config.", + "skyblocker.tips.skyblockerScreen": "You can access the Skyblocker screen to open the config or checkout helpful links for the mod with /skyblocker.", + "skyblocker.tips.tipsClick": "Click on a tip chat message to run its suggestion!", + "skyblocker.tips.eventNotifications": "Check out the customizable event notifications in the config.", + "skyblocker.tips.signCalculator": "Type an math expression in a sign to have the mod calculate it for you.", + "skyblocker.tips.fancierBars": "Customize the look of your health, mana, defense, and experience bars with /skyblocker bars. You can snap and resize bars too!", + "skyblocker.tips.crystalWaypointsShare": "Share Crystal Hollows Waypoints with /skyblocker crystalWaypoints share.", + "skyblocker.tips.gardenMouseLock": "Lock your mouse while farming in the Skyblocker Garden config.", + "skyblocker.tips.newYearCakesHelper": "Open your New Year Cake Bag and Skyblocker will remember them and highlight duplicate cakes red and missing cakes green.", + "skyblocker.tips.accessoryHelper": "Open your accessory bag and Skyblocker will remember them. The accessory helper will tell you what accessories you have and what accessories are missing.", + "skyblocker.tips.fancyAuctionHouseCheapHighlight": "Cheap BINs are highlighted in green in the Fancy Auction House.", "skyblocker.partyFinder.tabs.partyFinder": "Party Finder", "skyblocker.partyFinder.tabs.searchSettings": "Search Filters", From 75ad3b6165bd3b23d2498eff608264064ec11468 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:03:07 +0800 Subject: [PATCH 2/3] Add calculate command --- src/main/java/de/hysky/skyblocker/skyblock/Tips.java | 1 + src/main/resources/assets/skyblocker/lang/en_us.json | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/Tips.java b/src/main/java/de/hysky/skyblocker/skyblock/Tips.java index fb29dc3ab2..37f860a414 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/Tips.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/Tips.java @@ -56,6 +56,7 @@ public class Tips { getTipFactory("skyblocker.tips.tipsClick", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker tips next"), getTipFactory("skyblocker.tips.eventNotifications", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker config"), getTipFactory("skyblocker.tips.signCalculator"), + getTipFactory("skyblocker.tips.calculateCommand", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker calculate"), getTipFactory("skyblocker.tips.fancierBars", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker bars"), getTipFactory("skyblocker.tips.crystalWaypointsShare", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker crystalWaypoints share"), getTipFactory("skyblocker.tips.gardenMouseLock", ClickEvent.Action.SUGGEST_COMMAND, "/skyblocker config"), diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 35cd4ec148..898e204692 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -820,6 +820,7 @@ "skyblocker.tips.tipsClick": "Click on a tip chat message to run its suggestion!", "skyblocker.tips.eventNotifications": "Check out the customizable event notifications in the config.", "skyblocker.tips.signCalculator": "Type an math expression in a sign to have the mod calculate it for you.", + "skyblocker.tips.calculateCommand": "Enter an expression after /skyblocker calculate to have the mod calculate it for you.", "skyblocker.tips.fancierBars": "Customize the look of your health, mana, defense, and experience bars with /skyblocker bars. You can snap and resize bars too!", "skyblocker.tips.crystalWaypointsShare": "Share Crystal Hollows Waypoints with /skyblocker crystalWaypoints share.", "skyblocker.tips.gardenMouseLock": "Lock your mouse while farming in the Skyblocker Garden config.", From 81d817176194de6083f9b3ad69c387fbffe9a3e0 Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Thu, 13 Jun 2024 11:32:58 +0800 Subject: [PATCH 3/3] Add translatable mcdev annotation --- build.gradle | 2 ++ gradle.properties | 2 ++ src/main/java/de/hysky/skyblocker/skyblock/Tips.java | 5 +++-- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 40304d77f5..acb14ff77e 100644 --- a/build.gradle +++ b/build.gradle @@ -61,6 +61,8 @@ dependencies { modCompileOnly "dev.emi:emi-fabric:${project.emi_version}:api" //modLocalRuntime "dev.emi:emi-fabric:${project.emi_version}" + compileOnly "com.demonwav.mcdev:annotations:${project.mcdev_annotations_version}" + include modImplementation("meteordevelopment:discord-ipc:1.1") // Occlusion Culling (https://github.com/LogisticsCraft/OcclusionCulling) diff --git a/gradle.properties b/gradle.properties index ceb86ac8e8..90d4c20e6d 100644 --- a/gradle.properties +++ b/gradle.properties @@ -22,6 +22,8 @@ rei_version = 13.0.666 emi_version = 1.0.22+1.20.2 # Minecraft and Related Libraries +## McDev Annotations (https://central.sonatype.com/artifact/com.demonwav.mcdev/annotations) +mcdev_annotations_version = 2.1.0 ## Occlusion Culling (https://github.com/LogisticsCraft/OcclusionCulling) occlusionculling_version = 0.0.8-SNAPSHOT ## neu repoparser (https://repo.nea.moe/#/releases/moe/nea/neurepoparser/) diff --git a/src/main/java/de/hysky/skyblocker/skyblock/Tips.java b/src/main/java/de/hysky/skyblocker/skyblock/Tips.java index 37f860a414..5d983e20f7 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/Tips.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/Tips.java @@ -1,5 +1,6 @@ package de.hysky.skyblocker.skyblock; +import com.demonwav.mcdev.annotations.Translatable; import com.mojang.brigadier.Command; import com.mojang.brigadier.CommandDispatcher; import com.mojang.brigadier.context.CommandContext; @@ -67,11 +68,11 @@ public class Tips { private static boolean sentTip = false; - private static Supplier getTipFactory(String key) { + private static Supplier getTipFactory(@Translatable String key) { return () -> Text.translatable(key); } - private static Supplier getTipFactory(String key, ClickEvent.Action clickAction, String value) { + private static Supplier getTipFactory(@Translatable String key, ClickEvent.Action clickAction, String value) { return () -> Text.translatable(key).styled(style -> style.withClickEvent(new ClickEvent(clickAction, value))); }