diff options
author | UpFault <johian2004@gmail.com> | 2024-05-29 00:39:06 -0500 |
---|---|---|
committer | UpFault <johian2004@gmail.com> | 2024-06-01 21:12:58 -0500 |
commit | 757e6544ba3294024826068ef8dce1c3a9a394f1 (patch) | |
tree | 4d5abfbd94f0976817145d212158025231ef4d1b /src/main/java/de/hysky/skyblocker/skyblock/dwarven/NucleusWaypoints.java | |
parent | fb6beb6b25e8fb71cbc3b6927c65630fa5bc0a8b (diff) | |
download | Skyblocker-757e6544ba3294024826068ef8dce1c3a9a394f1.tar.gz Skyblocker-757e6544ba3294024826068ef8dce1c3a9a394f1.tar.bz2 Skyblocker-757e6544ba3294024826068ef8dce1c3a9a394f1.zip |
Added NucleusWaypoints, as of now it's just text that floats at the entrance of each section as well as one that's at the spawn of the nucleus
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/dwarven/NucleusWaypoints.java')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dwarven/NucleusWaypoints.java | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/NucleusWaypoints.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/NucleusWaypoints.java new file mode 100644 index 00000000..8046ed19 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/NucleusWaypoints.java @@ -0,0 +1,61 @@ +package de.hysky.skyblocker.skyblock.dwarven; + +import de.hysky.skyblocker.config.SkyblockerConfigManager; +import de.hysky.skyblocker.utils.Utils; +import de.hysky.skyblocker.utils.render.RenderHelper; +import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; +import net.minecraft.text.MutableText; +import net.minecraft.text.Text; +import net.minecraft.text.TextColor; +import net.minecraft.text.Style; +import net.minecraft.util.DyeColor; +import net.minecraft.util.math.BlockPos; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.util.List; + +public class NucleusWaypoints { + private static final Logger LOGGER = LoggerFactory.getLogger(NucleusWaypoints.class); + + private static class Waypoint { + BlockPos position; + String name; + DyeColor color; + + Waypoint(BlockPos position, String name, DyeColor color) { + this.position = position; + this.name = name; + this.color = color; + } + } + + private static final List<Waypoint> WAYPOINTS = List.of( + new Waypoint(new BlockPos(551, 116, 551), "Precursor Remnants", DyeColor.LIGHT_BLUE), + new Waypoint(new BlockPos(551, 116, 475), "Mithril Deposits", DyeColor.LIME), + new Waypoint(new BlockPos(475, 116, 551), "Goblin Holdout", DyeColor.ORANGE), + new Waypoint(new BlockPos(475, 116, 475), "Jungle", DyeColor.PURPLE), + new Waypoint(new BlockPos(513, 106, 524), "Nucleus", DyeColor.RED) + ); + + public static void render(WorldRenderContext context) { + try { + boolean enabled = SkyblockerConfigManager.get().mining.crystalHollows.nucleusWaypoints; + boolean inCrystalHollows = Utils.isInCrystalHollows(); + + if (enabled && inCrystalHollows) { + for (Waypoint waypoint : WAYPOINTS) { + + int rgb = waypoint.color.getFireworkColor(); + TextColor textColor = TextColor.fromRgb(rgb); + + MutableText text = Text.literal(waypoint.name).setStyle(Style.EMPTY.withColor(textColor)); + + RenderHelper.renderText(context, text, waypoint.position.toCenterPos().add(0, 5, 0), 8, true); + } + } + } catch (Exception e) { + LOGGER.error("[{}] Error occurred while rendering Nucleus waypoints. {}", LOGGER.getName(), e); + } + } +} |