diff options
author | Linnea Gräf <nea@nea.moe> | 2024-04-10 20:54:50 +0200 |
---|---|---|
committer | Linnea Gräf <nea@nea.moe> | 2024-04-11 11:39:09 +0200 |
commit | 0dde442debc27d1167e398140dcce71f0b32142c (patch) | |
tree | 5acee77c0546622ad56a5d34415c25a384c6f315 /src | |
parent | d6128f0dac37768bb295efe3f92c55ba890073de (diff) | |
download | NotEnoughUpdates-0dde442debc27d1167e398140dcce71f0b32142c.tar.gz NotEnoughUpdates-0dde442debc27d1167e398140dcce71f0b32142c.tar.bz2 NotEnoughUpdates-0dde442debc27d1167e398140dcce71f0b32142c.zip |
Add waypoints to gemstone spawns
Diffstat (limited to 'src')
3 files changed, 160 insertions, 3 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java index b485535e..c3d9b88d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/separatesections/Mining.java @@ -20,7 +20,6 @@ package io.github.moulberry.notenoughupdates.options.separatesections; import com.google.gson.annotations.Expose; -import io.github.moulberry.notenoughupdates.core.config.Position; import io.github.moulberry.moulconfig.annotations.ConfigAccordionId; import io.github.moulberry.moulconfig.annotations.ConfigEditorAccordion; import io.github.moulberry.moulconfig.annotations.ConfigEditorBoolean; @@ -29,6 +28,8 @@ import io.github.moulberry.moulconfig.annotations.ConfigEditorDraggableList; import io.github.moulberry.moulconfig.annotations.ConfigEditorDropdown; import io.github.moulberry.moulconfig.annotations.ConfigEditorSlider; import io.github.moulberry.moulconfig.annotations.ConfigOption; +import io.github.moulberry.notenoughupdates.core.config.Position; +import org.jetbrains.annotations.NotNull; import java.util.ArrayList; import java.util.Arrays; @@ -94,6 +95,41 @@ public class Mining { @ConfigAccordionId(id = 0) public boolean fallenStarWaypoint = true; + @Expose + @ConfigOption( + name = "Glacite Tunnel Waypoints", + desc = "Show waypoints in the Glacite Tunnels to the various gemstone locations, when you have a commission for them." + ) + @ConfigEditorDropdown + @ConfigAccordionId(id = 0) + public @NotNull GlaciteTunnelWaypointBehaviour tunnelWaypoints = GlaciteTunnelWaypointBehaviour.SHOW_ALL; + + @Expose + @ConfigOption( + name = "Always show Glacite Tunnel Waypoints", + desc = "Always show the Gemstone waypoints in the tunnels, instead of only for your current commissions." + ) + @ConfigEditorBoolean + @ConfigAccordionId(id = 0) + public boolean alwaysShowTunnelWaypoints = false; + + public enum GlaciteTunnelWaypointBehaviour { + SHOW_ALL("Show all"), + SHOW_NEAREST("Show nearest"), + NONE("Show none"), + ; + String text; + + GlaciteTunnelWaypointBehaviour(String text) { + this.text = text; + } + + @Override + public String toString() { + return text; + } + } + @ConfigOption( name = "Drill Fuel Bar", desc = "" diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java index 8b12026d..39f7b716 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java @@ -625,7 +625,7 @@ public class MiningOverlay extends TextTabOverlay { if (name.equals("Glacite Collector")) return "Break ice"; if (name.equals("Onyx Gemstone Collector")) return "Break black glass"; if (name.equals("Aquamarine Gemstone Collector")) return "Break aqua glass"; - if (name.equals("Peridot Gemstone Collecto")) return "Break dark green glass"; + if (name.equals("Peridot Gemstone Collector")) return "Break dark green glass"; if (name.equals("Citrine Gemstone Collector")) return "Break brown glass"; } else if (SBInfo.getInstance().getLocation().equals("crystal_hollows")) { // Crystal Hollows @@ -671,7 +671,7 @@ public class MiningOverlay extends TextTabOverlay { if (name.equals("Glacite Collector")) return "Break ice"; if (name.equals("Onyx Gemstone Collector")) return "Break black glass"; if (name.equals("Aquamarine Gemstone Collector")) return "Break aqua glass"; - if (name.equals("Peridot Gemstone Collecto")) return "Break dark green glass"; + if (name.equals("Peridot Gemstone Collector")) return "Break dark green glass"; if (name.equals("Citrine Gemstone Collector")) return "Break brown glass"; } diff --git a/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/GlaciteTunnelWaypoints.kt b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/GlaciteTunnelWaypoints.kt new file mode 100644 index 00000000..e0f89e87 --- /dev/null +++ b/src/main/kotlin/io/github/moulberry/notenoughupdates/miscfeatures/GlaciteTunnelWaypoints.kt @@ -0,0 +1,121 @@ +/* + * Copyright (C) 2024 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see <https://www.gnu.org/licenses/>. + */ + +package io.github.moulberry.notenoughupdates.miscfeatures + +import io.github.moulberry.notenoughupdates.NotEnoughUpdates +import io.github.moulberry.notenoughupdates.autosubscribe.NEUAutoSubscribe +import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils +import io.github.moulberry.notenoughupdates.options.separatesections.Mining +import io.github.moulberry.notenoughupdates.overlays.MiningOverlay +import io.github.moulberry.notenoughupdates.util.SBInfo +import net.minecraft.client.Minecraft +import net.minecraft.util.BlockPos +import net.minecraftforge.client.event.RenderWorldLastEvent +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +@NEUAutoSubscribe +class GlaciteTunnelWaypoints { + val glaciteTunnelLocations = setOf( + "Glacite Tunnels", + "Glacite Lake", + "Dwarven Base Camp", + ) + + + data class Waypoints( + val title: String, + val waypoints: List<BlockPos>, + ) + + val waypointsForQuest: Map<String, Waypoints> = mapOf( + "Onyx Gemstone Collector" to Waypoints( + "§0Onyx Gemstone Mine", + listOf( + BlockPos(-68, 130, 407), + BlockPos(9, 137, 412), + BlockPos(-17, 133, 393), + BlockPos(12, 137, 365), + BlockPos(23, 137, 386), + BlockPos(79, 119, 412), + ) + ), + "Aquamarine Gemstone Collector" to Waypoints( + "§3Aquamarine Gemstone Mine", + listOf( + BlockPos(-3, 139, 437), + BlockPos(72, 151, 387), + BlockPos(86, 150, 323), + ) + ), + "Peridot Gemstone Collector" to Waypoints( + "§2Peridot Gemstone Mine", + listOf( + BlockPos(-62, 47, 301), + BlockPos(-76, 120, 281), + BlockPos(91, 122, 393), + ) + ), + "Citrine Gemstone Collector" to Waypoints( + "§6Citrine Gemstone Mine", + listOf( + BlockPos(-95, 145, 258), + BlockPos(-57, 144, 422), + BlockPos(37, 119, 387), + ) + ), + ) + + @SubscribeEvent + fun onRender(event: RenderWorldLastEvent) { + if (NotEnoughUpdates.INSTANCE.config.mining.tunnelWaypoints == Mining.GlaciteTunnelWaypointBehaviour.NONE) + return + + if (SBInfo.getInstance().scoreboardLocation !in glaciteTunnelLocations) + return + + val wantedGemstones = if (NotEnoughUpdates.INSTANCE.config.mining.alwaysShowTunnelWaypoints) + waypointsForQuest.keys + else + MiningOverlay.commissionProgress.entries.filter { it.value < 1 }.map { it.key } + val player = Minecraft.getMinecraft().thePlayer?.position ?: return + for (entry in wantedGemstones) { + val waypoints = waypointsForQuest[entry] ?: continue + val waypointLocations = when (NotEnoughUpdates.INSTANCE.config.mining.tunnelWaypoints) { + Mining.GlaciteTunnelWaypointBehaviour.SHOW_ALL -> { + waypoints.waypoints + } + + Mining.GlaciteTunnelWaypointBehaviour.SHOW_NEAREST -> { + listOf(waypoints.waypoints.minByOrNull { it.distanceSq(player) }) + } + + Mining.GlaciteTunnelWaypointBehaviour.NONE -> break + } + for (waypoint in waypointLocations) { + if (waypoint == null) continue + RenderUtils.renderWayPoint( + waypoints.title, + waypoint, + event.partialTicks + ) + } + } + } +} |