diff options
Diffstat (limited to 'src/main')
6 files changed, 43 insertions, 47 deletions
diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index a1f4fa2c..c9246599 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -44,8 +44,8 @@ public class SkyblockerConfig { public QuickNavigationConfig quickNav = new QuickNavigationConfig(); @SerialEntry - public MiscConfig misc = new MiscConfig(); + public EventNotificationsConfig eventNotifications = new EventNotificationsConfig(); @SerialEntry - public EventNotificationsConfig eventNotifications = new EventNotificationsConfig(); + public MiscConfig misc = new MiscConfig(); } diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfigManager.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfigManager.java index 25da464e..f519473c 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfigManager.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfigManager.java @@ -83,8 +83,8 @@ public class SkyblockerConfigManager { .category(SlayersCategory.create(defaults, config)) .category(ChatCategory.create(defaults, config)) .category(QuickNavigationCategory.create(defaults, config)) - .category(MiscCategory.create(defaults, config)) - .category(EventNotificationsCategory.create(defaults, config))).generateScreen(parent); + .category(EventNotificationsCategory.create(defaults, config)) + .category(MiscCategory.create(defaults, config))).generateScreen(parent); } /** diff --git a/src/main/java/de/hysky/skyblocker/skyblock/events/EventNotifications.java b/src/main/java/de/hysky/skyblocker/skyblock/events/EventNotifications.java index 662f6b12..537ee360 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/events/EventNotifications.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/events/EventNotifications.java @@ -19,7 +19,6 @@ import net.minecraft.client.sound.PositionedSoundInstance; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.sound.SoundEvent; -import org.apache.commons.lang3.builder.ToStringBuilder; import org.jetbrains.annotations.Nullable; import org.slf4j.Logger; @@ -168,15 +167,5 @@ public class EventNotifications { jsonObject.get("extras").getAsJsonArray().asList().stream().map(JsonElement::getAsString).toArray(String[]::new), location); } - - @Override - public String toString() { - return new ToStringBuilder(this) - .append("start", start) - .append("duration", duration) - .append("extras", extras) - .append("warpCommand", warpCommand) - .toString(); - } } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/events/JacobEventToast.java b/src/main/java/de/hysky/skyblocker/skyblock/events/JacobEventToast.java index 18d9a7b2..ca0f08c4 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/events/JacobEventToast.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/events/JacobEventToast.java @@ -1,11 +1,13 @@ package de.hysky.skyblocker.skyblock.events; import com.mojang.blaze3d.systems.RenderSystem; +import de.hysky.skyblocker.skyblock.tabhud.widget.JacobsContestWidget; import de.hysky.skyblocker.utils.Utils; import de.hysky.skyblocker.utils.render.RenderHelper; import net.minecraft.client.font.TextRenderer; import net.minecraft.client.gui.DrawContext; import net.minecraft.client.toast.ToastManager; +import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemStack; import net.minecraft.item.Items; import net.minecraft.util.Colors; @@ -14,10 +16,12 @@ import net.minecraft.util.math.MathHelper; import java.util.HashMap; import java.util.Map; -public class JacobEventToast extends EventToast{ +public class JacobEventToast extends EventToast { private final String[] crops; + private static final ItemStack DEFAULT_ITEM = new ItemStack(Items.IRON_HOE); + public static final Map<String, ItemStack> cropItems = new HashMap<>(); static { @@ -42,34 +46,35 @@ public class JacobEventToast extends EventToast{ public Visibility draw(DrawContext context, ToastManager manager, long startTime) { context.drawGuiTexture(TEXTURE, 0, 0, getWidth(), getHeight()); - int y = (getHeight() - getInnerContentsHeight())/2; + int y = (getHeight() - getInnerContentsHeight()) / 2; TextRenderer textRenderer = manager.getClient().textRenderer; - if (startTime < 3_000){ - int k = MathHelper.floor(MathHelper.clamp((3_000 - startTime) / 200.0f, 0.0f, 1.0f) * 255.0f) << 24 | 0x4000000; + MatrixStack matrices = context.getMatrices(); + if (startTime < 3_000) { + int k = MathHelper.floor(Math.clamp((3_000 - startTime) / 200.0f, 0.0f, 1.0f) * 255.0f) << 24 | 0x4000000; y = 2 + drawMessage(context, 30, y, 0xFFFFFF | k); - } else { - int k = (~MathHelper.floor(MathHelper.clamp((startTime - 3_000) / 200.0f, 0.0f, 1.0f) * 255.0f)) << 24 | 0x4000000; + } else { + int k = (~MathHelper.floor(Math.clamp((startTime - 3_000) / 200.0f, 0.0f, 1.0f) * 255.0f)) << 24 | 0x4000000; String s = "Crops:"; int x = 30 + textRenderer.getWidth(s) + 4; - context.drawText(textRenderer, s, 30, 7 + (16 - textRenderer.fontHeight)/2, Colors.WHITE, false); + context.drawText(textRenderer, s, 30, 7 + (16 - textRenderer.fontHeight) / 2, Colors.WHITE, false); for (int i = 0; i < crops.length; i++) { - context.drawItem(cropItems.get(crops[i]), x + i * (16 + 8), 7); + context.drawItem(JacobsContestWidget.FARM_DATA.getOrDefault(crops[i], DEFAULT_ITEM), x + i * (16 + 8), 7); } // IDK how to make the items transparent, so I just redraw the texture on top - context.getMatrices().push(); - context.getMatrices().translate(0, 0, 400f); - RenderHelper.renderNineSliceColored(context, TEXTURE, 0, 0, getWidth(), getHeight(), 1f, 1f, 1f, (k >> 24)/ 255f); - context.getMatrices().pop(); + matrices.push(); + matrices.translate(0, 0, 400f); + RenderHelper.renderNineSliceColored(context, TEXTURE, 0, 0, getWidth(), getHeight(), 1f, 1f, 1f, (k >> 24) / 255f); + matrices.pop(); y += textRenderer.fontHeight * message.size(); } - context.getMatrices().push(); - context.getMatrices().translate(0, 0, 400f); + matrices.push(); + matrices.translate(0, 0, 400f); drawTimer(context, 30, y); - context.drawItemWithoutEntity(icon, 8, getHeight()/2 - 8); - context.getMatrices().pop(); - return startTime > 5_000 ? Visibility.HIDE: Visibility.SHOW; + context.drawItemWithoutEntity(icon, 8, getHeight() / 2 - 8); + matrices.pop(); + return startTime > 5_000 ? Visibility.HIDE : Visibility.SHOW; } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/JacobsContestWidget.java b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/JacobsContestWidget.java index 24dcc229..c28c8679 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/JacobsContestWidget.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/tabhud/widget/JacobsContestWidget.java @@ -26,7 +26,7 @@ public class JacobsContestWidget extends Widget { //TODO Properly match the contest placement and display it private static final Pattern CROP_PATTERN = Pattern.compile("(?<fortune>[☘○]) (?<crop>[A-Za-z ]+).*"); - private static final Map<String, ItemStack> FARM_DATA = Map.ofEntries( + public static final Map<String, ItemStack> FARM_DATA = Map.ofEntries( entry("Wheat", new ItemStack(Items.WHEAT)), entry("Sugar Cane", new ItemStack(Items.SUGAR_CANE)), entry("Carrot", new ItemStack(Items.CARROT)), diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 52f72e37..9361c941 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -396,6 +396,14 @@ "skyblocker.config.chat.filter.hideToggleSkyMall": "Hide Toggle Sky Mall Messages", "skyblocker.config.chat.filter.hideToggleSkyMall.@Tooltip": "Hides those pesky messages telling you to disable the Sky Mall HOTM perk when you want it enabled!", + "skyblocker.config.eventNotifications": "Event Notifications", + + "skyblocker.config.eventNotifications.monologue": "can you pls log onto skyblock rq pls? that would be cool cuz like if you are seeing dis then it means that ur config either got cleared or that this is ur first time using the mod if so then thanks for choosing it and hopefully you enjoy it! so yea this is where you will be able to set reminders for all events in skyblock they will be added as you encounter so you first need to log onto skyblock so yea hope you enjoy the mod and all that", + "skyblocker.config.eventNotifications.notificationSound": "Notification Sound", + "skyblocker.config.eventNotifications.@Tooltip[0]": "Configure how much time before an event you will be reminded with a notification toast! For example if you set '5m' and '30s' in the list, you will receive a notification 5 minutes before and another 30 seconds before an event starts.", + "skyblocker.config.eventNotifications.@Tooltip[1]": "The order doesn't matter. If you want to disable notifications, just empty the list.", + "skyblocker.config.eventNotifications.@Tooltip[2]": "This list will modify the '%s' event", + "skyblocker.config.mining": "Mining", "skyblocker.config.mining.commissionWaypoints": "Commission Waypoints", @@ -623,13 +631,6 @@ "skyblocker.config.uiAndVisuals.waypoints.waypointType.@Tooltip": "Waypoint: Displays a highlight and a beacon beam.\n\nOutlined Waypoint: Displays both a waypoint and an outline.\n\nHighlight: Only displays a highlight.\n\nOutlined Highlight: Displays both a highlight and an outline.\n\nOutline: Only displays an outline.", "skyblocker.config.uiAndVisuals.waypoints.waypointType.generalNote": "\n\n\nThis option does not apply to all waypoints. Some waypoints such as secret waypoints have their own waypoint type option.", - "skyblocker.config.eventNotifications": "Event Notifications", - "skyblocker.config.eventNotifications.notificationSound": "Notification Sound", - "skyblocker.config.eventNotifications.monologue": "can you pls log onto skyblock rq pls? that would be cool cuz like if you are seeing dis then it means that ur config either got cleared or that this is ur first time using the mod if so then thanks for choosing it and hopefully you enjoy it! so yea this is where you will be able to set reminders for all events in skyblock they will be added as you encounter so you first need to log onto skyblock so yea hope you enjoy the mod and all that", - "skyblocker.config.eventNotifications.@Tooltip[0]": "Configure how much time before an event you will be reminded with a notification toast! For example if you set '5m' and '30s' in the list, you will receive a notification 5 minutes before and another 30 seconds before an event starts.", - "skyblocker.config.eventNotifications.@Tooltip[1]": "The order doesn't matter. If you want to disable notifications, just empty the list.", - "skyblocker.config.eventNotifications.@Tooltip[2]": "This list will modify the '%s' event", - "skyblocker.itemTooltip.noData": "\u00a7cNo Data", "skyblocker.itemTooltip.nullMessage": "\u00a7cItem price information on tooltip will renew in max 60 seconds. If not, check latest.log", @@ -704,6 +705,14 @@ "skyblocker.end.hud.protectorLocations.rightFront": "Right Front", "skyblocker.end.hud.protectorLocations.rightBack": "Right Back", + "skyblocker.events.startsNow": "%s starts now!", + "skyblocker.events.startsSoon": "%s starts soon!", + "skyblocker.events.tab.endsIn": "Ends in %s", + "skyblocker.events.tab.clickToWarp": "Click to warp!", + "skyblocker.events.tab.noMore": "No more this year!", + "skyblocker.events.tab.startsIn": "Starts in %s", + + "skyblocker.garden.hud.mouseLocked": "Mouse locked.", "skyblocker.fishing.reelNow": "Reel in now!", @@ -768,13 +777,6 @@ "skyblocker.itemProtection.noItemUuid": "§cYou must be holding an item that has a uuid in order to protect it!", "skyblocker.itemProtection.unableToProtect": "§cUnable to protect this item :( (Are you in skyblock?, are you holding an item?)", - "skyblocker.events.startsSoon": "%s starts soon!", - "skyblocker.events.startsNow": "%s starts now!", - "skyblocker.events.tab.clickToWarp": "Click to warp!", - "skyblocker.events.tab.noMore": "No more this year!", - "skyblocker.events.tab.startsIn": "Starts in %s", - "skyblocker.events.tab.endsIn": "Ends in %s", - "skyblocker.tips.enabled": "§aEnabled Tips.", "skyblocker.tips.disabled": "§cDisabled Tips.", "skyblocker.tips.clickEnable": "§a[Click to Enable Tips]", |