diff options
| author | Kevin <92656833+kevinthegreat1@users.noreply.github.com> | 2024-12-06 14:23:11 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-12-06 14:23:11 -0500 |
| commit | bd63e40ffa10e49354409f4f37d73b8fca667f08 (patch) | |
| tree | 06744cdb9a7aa0baa87ecfe6f055bef9cbf2840f /src | |
| parent | fa726da23c40146c78fbf5e3824616e91284f4b1 (diff) | |
| download | Skyblocker-bd63e40ffa10e49354409f4f37d73b8fca667f08.tar.gz Skyblocker-bd63e40ffa10e49354409f4f37d73b8fca667f08.tar.bz2 Skyblocker-bd63e40ffa10e49354409f4f37d73b8fca667f08.zip | |
Waypoints refactor (#976)
* Add ordered waypoints gui
* Use InstancedUtils
* Add fromColeweightJson
* Add soopy waypoints importing
* Refactor category to group
* Add skyblocker format
* Fix UI
* Deprecate OrderedWaypoints and migrate to Waypoints
* Start indices at 1
* Remove unused translations
* Add Javadocs
* Update waypoint text size
* Refactor mining waypoints
* Migrate from String to Location
* Fix export translation key
* Refactor individual waypoint
* Remove unused translation strings
* Update GoldorWaypointsManager
* Migrate waypoints to both dwarven and crystal hollows
* Refactor Waypoints api
* Add Javadocs
Diffstat (limited to 'src')
34 files changed, 1254 insertions, 870 deletions
diff --git a/src/main/java/de/hysky/skyblocker/config/categories/MiningCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/MiningCategory.java index 74be78cb..364e9b07 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/MiningCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/MiningCategory.java @@ -181,14 +181,6 @@ public class MiningCategory { newValue -> config.mining.crystalsWaypoints.enabled = newValue) .controller(ConfigUtils::createBooleanController) .build()) - .option(Option.<Float>createBuilder() - .name(Text.translatable("skyblocker.config.mining.crystalsWaypoints.textScale")) - .description(OptionDescription.of(Text.translatable("skyblocker.config.mining.crystalsWaypoints.textScale.@Tooltip"))) - .binding(defaults.mining.crystalsWaypoints.textScale, - () -> config.mining.crystalsWaypoints.textScale, - newValue -> config.mining.crystalsWaypoints.textScale = newValue) - .controller(FloatFieldControllerBuilder::create) - .build()) .option(Option.<Boolean>createBuilder() .name(Text.translatable("skyblocker.config.mining.crystalsWaypoints.findInChat")) .description(OptionDescription.of(Text.translatable("skyblocker.config.mining.crystalsWaypoints.findInChat.@Tooltip"))) @@ -224,14 +216,6 @@ public class MiningCategory { newValue -> config.mining.commissionWaypoints.mode = newValue) .controller(ConfigUtils::createEnumCyclingListController) .build()) - .option(Option.<Float>createBuilder() - .name(Text.translatable("skyblocker.config.mining.commissionWaypoints.textScale")) - .description(OptionDescription.of(Text.translatable("skyblocker.config.mining.commissionWaypoints.textScale.@Tooltip"))) - .binding(defaults.mining.commissionWaypoints.textScale, - () -> config.mining.commissionWaypoints.textScale, - newValue -> config.mining.commissionWaypoints.textScale = newValue) - .controller(FloatFieldControllerBuilder::create) - .build()) .option(Option.<Boolean>createBuilder() .name(Text.translatable("skyblocker.config.mining.commissionWaypoints.useColor")) .description(OptionDescription.of(Text.translatable("skyblocker.config.mining.commissionWaypoints.useColor.@Tooltip"))) diff --git a/src/main/java/de/hysky/skyblocker/config/configs/MiningConfig.java b/src/main/java/de/hysky/skyblocker/config/configs/MiningConfig.java index 2ef5a4dc..d2b3beb5 100644 --- a/src/main/java/de/hysky/skyblocker/config/configs/MiningConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/configs/MiningConfig.java @@ -102,6 +102,7 @@ public class MiningConfig { @SerialEntry public boolean enabled = true; + @Deprecated @SerialEntry public float textScale = 1; @@ -116,6 +117,7 @@ public class MiningConfig { @SerialEntry public CommissionWaypointMode mode = CommissionWaypointMode.BOTH; + @Deprecated @SerialEntry public float textScale = 1; diff --git a/src/main/java/de/hysky/skyblocker/skyblock/chat/chatcoords/ChatWaypointLocation.java b/src/main/java/de/hysky/skyblocker/skyblock/chat/ChatPositionShare.java index b291a763..92f17a5f 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/chat/chatcoords/ChatWaypointLocation.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/chat/ChatPositionShare.java @@ -1,14 +1,23 @@ -package de.hysky.skyblocker.skyblock.chat.chatcoords; +package de.hysky.skyblocker.skyblock.chat; +import com.mojang.brigadier.Command; import de.hysky.skyblocker.annotations.Init; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.utils.Constants; import de.hysky.skyblocker.utils.Utils; +import de.hysky.skyblocker.utils.scheduler.MessageScheduler; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; +import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; +import net.fabricmc.fabric.api.client.command.v2.FabricClientCommandSource; import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents; import net.minecraft.client.MinecraftClient; import net.minecraft.text.ClickEvent; +import net.minecraft.text.HoverEvent; +import net.minecraft.text.MutableText; import net.minecraft.text.Text; import net.minecraft.util.Formatting; +import net.minecraft.util.math.Vec3d; +import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -16,9 +25,8 @@ import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -public class ChatWaypointLocation { - - private static final Logger LOGGER = LoggerFactory.getLogger(ChatWaypointLocation.class); +public class ChatPositionShare { + private static final Logger LOGGER = LoggerFactory.getLogger(ChatPositionShare.class); private static final Pattern GENERIC_COORDS_PATTERN = Pattern.compile("x: (?<x>-?[0-9]+), y: (?<y>[0-9]+), z: (?<z>-?[0-9]+)"); private static final Pattern SKYBLOCKER_COORDS_PATTERN = Pattern.compile("x: (?<x>-?[0-9]+), y: (?<y>[0-9]+), z: (?<z>-?[0-9]+)(?: \\| (?<area>[^|]+))"); @@ -27,12 +35,20 @@ public class ChatWaypointLocation { @Init public static void init() { - ClientReceiveMessageEvents.GAME.register(ChatWaypointLocation::onMessage); + ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> dispatcher.register( + ClientCommandManager.literal("skyblocker").then(ClientCommandManager.literal("sharePosition").executes(context -> sharePlayerPosition(context.getSource()))) + )); + ClientReceiveMessageEvents.GAME.register(ChatPositionShare::onMessage); } + private static int sharePlayerPosition(FabricClientCommandSource source) { + Vec3d pos = source.getPosition(); + MessageScheduler.INSTANCE.sendMessageAfterCooldown("x: " + (int) pos.getX() + ", y: " + (int) pos.getY() + ", z: " + (int) pos.getZ() + " | " + Utils.getIslandArea(), true); + return Command.SINGLE_SUCCESS; + } + private static void onMessage(Text text, boolean overlay) { if (Utils.isOnSkyblock() && SkyblockerConfigManager.get().uiAndVisuals.waypoints.enableWaypoints) { - String message = text.getString(); for (Pattern pattern : PATTERNS) { @@ -42,10 +58,10 @@ public class ChatWaypointLocation { String x = matcher.group("x"); String y = matcher.group("y"); String z = matcher.group("z"); - String area = matcher.group("area"); + String area = matcher.namedGroups().containsKey("area") ? matcher.group("area") : ""; requestWaypoint(x, y, z, area); } catch (Exception e) { - LOGGER.error("[SKYBLOCKER CHAT WAYPOINTS] Error creating chat waypoint: ", e); + LOGGER.error("[Skyblocker Chat Waypoints] Error creating chat waypoint: ", e); } break; } @@ -53,14 +69,17 @@ public class ChatWaypointLocation { } } - private static void requestWaypoint(String x, String y, String z, String area) { + private static void requestWaypoint(String x, String y, String z, @NotNull String area) { String command = "/skyblocker waypoints individual " + x + " " + y + " " + z + " " + area; - - Text text = Constants.PREFIX.get() - .append(Text.translatable("skyblocker.config.chat.waypoints.display").formatted(Formatting.AQUA) - .styled(style -> style.withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command)))) - .append(Text.of(area != null ? " at " + area : "")); - - MinecraftClient.getInstance().player.sendMessage(text, false); + MutableText requestMessage = Constants.PREFIX.get().append(Text.translatable("skyblocker.config.chat.waypoints.display").formatted(Formatting.AQUA) + .styled(style -> style + .withHoverEvent(new HoverEvent(HoverEvent.Action.SHOW_TEXT, Text.translatable("skyblocker.config.chat.waypoints.display"))) + .withClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, command)) + ) + ); + if (!area.isEmpty()) { + requestMessage = requestMessage.append(" at ").append(Text.literal(area).formatted(Formatting.AQUA)); + } + MinecraftClient.getInstance().player.sendMessage(requestMessage, false); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/chat/chatcoords/ChatLocation.java b/src/main/java/de/hysky/skyblocker/skyblock/chat/chatcoords/ChatLocation.java deleted file mode 100644 index d519a414..00000000 --- a/src/main/java/de/hysky/skyblocker/skyblock/chat/chatcoords/ChatLocation.java +++ /dev/null @@ -1,26 +0,0 @@ -package de.hysky.skyblocker.skyblock.chat.chatcoords; - -import com.mojang.brigadier.Command; -import de.hysky.skyblocker.annotations.Init; -import de.hysky.skyblocker.utils.Utils; -import de.hysky.skyblocker.utils.scheduler.MessageScheduler; -import net.fabricmc.fabric.api.client.command.v2.ClientCommandManager; -import net.fabricmc.fabric.api.client.command.v2.ClientCommandRegistrationCallback; -import net.minecraft.client.MinecraftClient; -import net.minecraft.client.network.ClientPlayerEntity; - -public class ChatLocation { - @Init - public static void init() { - ClientCommandRegistrationCallback.EVENT.register((dispatcher, registryAccess) -> dispatcher.register( - ClientCommandManager.literal("skyblocker").then(ClientCommandManager.literal("location").executes(context -> sharePlayerLocation())) - )); - } - - private static int sharePlayerLocation() { - ClientPlayerEntity thePlayer = MinecraftClient.getInstance().player; - MessageScheduler.INSTANCE.sendMessageAfterCooldown("x: " + (int) thePlayer.getX() + ", y: " + (int) thePlayer.getY() + ", z: " + (int) thePlayer.getZ() + " | " + Utils.getIslandArea(), true); - return Command.SINGLE_SUCCESS; - } - -} diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/GoldorWaypointsManager.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/GoldorWaypointsManager.java index 6d995ce8..2fd04655 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/GoldorWaypointsManager.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/GoldorWaypointsManager.java @@ -11,6 +11,7 @@ import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.skyblock.dungeon.secrets.DungeonManager; import de.hysky.skyblocker.utils.Utils; import de.hysky.skyblocker.utils.waypoint.NamedWaypoint; +import de.hysky.skyblocker.utils.waypoint.Waypoint; import it.unimi.dsi.fastutil.objects.ObjectArrayList; import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientLifecycleEvents; import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents; @@ -110,20 +111,15 @@ public class GoldorWaypointsManager { * @param waypoints The list of waypoints to operate on * @param playerName The name of the player to check against */ - private static void removeNearestWaypoint(ObjectArrayList<GoldorWaypoint> waypoints, String playerName) { + private static void removeNearestWaypoint(List<GoldorWaypoint> waypoints, String playerName) { MinecraftClient client = MinecraftClient.getInstance(); if (client.world == null) return; + // Get the position of the player with the given name Optional<Vec3d> posOptional = client.world.getPlayers().stream().filter(player -> player.getGameProfile().getName().equals(playerName)).findAny().map(Entity::getPos); - if (posOptional.isPresent()) { - Vec3d pos = posOptional.get(); - - waypoints.stream().filter(GoldorWaypoint::shouldRender).min(Comparator.comparingDouble(waypoint -> waypoint.centerPos.squaredDistanceTo(pos))).map(waypoint -> { - waypoint.setShouldRender(false); - return null; - }); - } + // Find the nearest waypoint to the player and hide it + posOptional.flatMap(pos -> waypoints.stream().filter(GoldorWaypoint::shouldRender).min(Comparator.comparingDouble(waypoint -> waypoint.centerPos.squaredDistanceTo(pos)))).ifPresent(Waypoint::setFound); } /** @@ -143,7 +139,7 @@ public class GoldorWaypointsManager { * @param waypoints The set of waypoints to enable rendering for */ private static void enableAll(ObjectArrayList<GoldorWaypoint> waypoints) { - waypoints.forEach(waypoint -> waypoint.setShouldRender(true)); + waypoints.forEach(Waypoint::setMissing); } /** diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java index 3779a66e..df3d9bf9 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/secrets/SecretWaypoint.java @@ -7,19 +7,15 @@ import com.mojang.serialization.JsonOps; import com.mojang.serialization.codecs.RecordCodecBuilder; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.config.configs.DungeonsConfig; -import de.hysky.skyblocker.utils.render.RenderHelper; -import de.hysky.skyblocker.utils.waypoint.NamedWaypoint; +import de.hysky.skyblocker.utils.waypoint.DistancedNamedWaypoint; import de.hysky.skyblocker.utils.waypoint.Waypoint; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; -import net.minecraft.client.MinecraftClient; import net.minecraft.command.argument.EnumArgumentType; import net.minecraft.entity.Entity; import net.minecraft.text.Text; import net.minecraft.text.TextCodecs; -import net.minecraft.util.Formatting; import net.minecraft.util.StringIdentifiable; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; import org.jetbrains.annotations.NotNull; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -29,7 +25,7 @@ import java.util.function.Predicate; import java.util.function.Supplier; import java.util.function.ToDoubleFunction; -public class SecretWaypoint extends NamedWaypoint { +public class SecretWaypoint extends DistancedNamedWaypoint { private static final Logger LOGGER = LoggerFactory.getLogger(SecretWaypoint.class); public static final Codec<SecretWaypoint> CODEC = RecordCodecBuilder.create(instance -> instance.group( Codec.INT.fieldOf("secretIndex").forGetter(secretWaypoint -> secretWaypoint.secretIndex), @@ -94,7 +90,7 @@ public class SecretWaypoint extends NamedWaypoint { @Override protected boolean shouldRenderName() { - return CONFIG.get().showSecretText; + return super.shouldRenderName() && CONFIG.get().showSecretText; } /** @@ -104,12 +100,6 @@ public class SecretWaypoint extends NamedWaypoint { public void render(WorldRenderContext context) { //TODO In the future, shrink the box for wither essence and items so its more realistic super.render(context); - - if (CONFIG.get().showSecretText) { - Vec3d posUp = centerPos.add(0, 1, 0); - double distance = context.camera().getPos().distanceTo(centerPos); - RenderHelper.renderText(context, Text.literal(Math.round(distance) + "m").formatted(Formatting.YELLOW), posUp, 1, MinecraftClient.getInstance().textRenderer.fontHeight + 1, true); - } } @NotNull diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java index 80a3f232..8689df83 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsHud.java @@ -74,19 +74,17 @@ public class CrystalsHud { //if enabled add waypoint locations to map if (SkyblockerConfigManager.get().mining.crystalsHud.showLocations) { - Map<String, MiningLocationLabel> ActiveWaypoints = CrystalsLocationsManager.activeWaypoints; - - for (MiningLocationLabel waypoint : ActiveWaypoints.values()) { - int waypointColor = waypoint.category().getColor(); - Vector2ic renderPos = transformLocation(waypoint.centerPos().getX(), waypoint.centerPos().getZ()); + for (MiningLocationLabel waypoint : CrystalsLocationsManager.activeWaypoints.values()) { + MiningLocationLabel.Category category = waypoint.category(); + Vector2ic renderPos = transformLocation(waypoint.centerPos.getX(), waypoint.centerPos.getZ()); int locationSize = SkyblockerConfigManager.get().mining.crystalsHud.locationSize; - if (SMALL_LOCATIONS.contains(waypoint.category().getName())) {//if small location half the location size + if (SMALL_LOCATIONS.contains(category.getName())) {//if small location half the location size locationSize /= 2; } //fill square of size locationSize around the coordinates of the location - context.fill(renderPos.x() - locationSize / 2, renderPos.y() - locationSize / 2, renderPos.x() + locationSize / 2, renderPos.y() + locationSize / 2, waypointColor); + context.fill(renderPos.x() - locationSize / 2, renderPos.y() - locationSize / 2, renderPos.x() + locationSize / 2, renderPos.y() + locationSize / 2, category.getColor()); } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java index 48dfdd34..a97e6051 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/CrystalsLocationsManager.java @@ -294,8 +294,8 @@ public class CrystalsLocationsManager { public static int shareWaypoint(String place) { if (activeWaypoints.containsKey(place)) { - Vec3d pos = activeWaypoints.get(place).centerPos(); - MessageScheduler.INSTANCE.sendMessageAfterCooldown(Constants.PREFIX.get().getString() + " " + place + ": " + (int) pos.getX() + ", " + (int) pos.getY() + ", " + (int) pos.getZ()); + BlockPos pos = activeWaypoints.get(place).pos; + MessageScheduler.INSTANCE.sendMessageAfterCooldown(Constants.PREFIX.get().getString() + " " + place + ": " + pos.getX() + ", " + pos.getY() + ", " + pos.getZ()); } else { //send fail message if (CLIENT.player == null || CLIENT.getNetworkHandler() == null) { @@ -349,7 +349,7 @@ public class CrystalsLocationsManager { String name = MiningLocationLabel.CrystalHollowsLocationsCategory.UNKNOWN.getName(); MiningLocationLabel unknownWaypoint = activeWaypoints.getOrDefault(name, null); if (unknownWaypoint != null) { - double distance = unknownWaypoint.centerPos().distanceTo(location.toCenterPos()); + double distance = unknownWaypoint.centerPos.distanceTo(location.toCenterPos()); if (distance < REMOVE_UNKNOWN_DISTANCE) { activeWaypoints.remove(name); } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MiningLocationLabel.java b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MiningLocationLabel.java index 9aabd117..632ea3fc 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MiningLocationLabel.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dwarven/MiningLocationLabel.java @@ -1,49 +1,42 @@ package de.hysky.skyblocker.skyblock.dwarven; +import com.mojang.serialization.Codec; import de.hysky.skyblocker.config.SkyblockerConfigManager; -import de.hysky.skyblocker.utils.Utils; -import de.hysky.skyblocker.utils.render.RenderHelper; -import de.hysky.skyblocker.utils.render.Renderable; -import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; -import net.minecraft.client.MinecraftClient; +import de.hysky.skyblocker.utils.waypoint.DistancedNamedWaypoint; import net.minecraft.text.Text; import net.minecraft.util.DyeColor; -import net.minecraft.util.Formatting; import net.minecraft.util.StringIdentifiable; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.math.Vec3d; import java.awt.*; -import com.mojang.serialization.Codec; +public class MiningLocationLabel extends DistancedNamedWaypoint { + private final Category category; -// TODO: Clean up into the waypoint system with a new `DistancedWaypoint` that extends `NamedWaypoint` for this and secret waypoints. -public record MiningLocationLabel(Category category, Vec3d centerPos) implements Renderable { public MiningLocationLabel(Category category, BlockPos pos) { - this(category, pos.toCenterPos()); + // Set enabled to false in order to prevent the waypoint from being rendered, but the name text and distance will still be rendered. + super(pos, getName(category), new float[]{0, 0, 0}, false); + this.category = category; } - private Text getName() { + private static Text getName(Category category) { if (SkyblockerConfigManager.get().mining.commissionWaypoints.useColor) { return Text.literal(category.getName()).withColor(category.getColor()); } return Text.literal(category.getName()); } + public Category category() { + return category; + } + /** - * Renders the name and distance to the label scaled so can be seen at a distance - * - * @param context render context + * Override the {@link DistancedNamedWaypoint#shouldRenderName()} method to always return true, + * as the name should always be rendered, even though this waypoint is always disabled. */ @Override - public void render(WorldRenderContext context) { - Vec3d posUp = centerPos.add(0, 1, 0); - double distance = context.camera().getPos().distanceTo(centerPos); - //set scale config based on if in crystals or not - float textScale = Utils.isInCrystalHollows() ? SkyblockerConfigManager.get().mining.crystalsWaypoints.textScale : SkyblockerConfigManager.get().mining.commissionWaypoints.textScale; - float scale = (float) (textScale * (distance / 10)); - RenderHelper.renderText(context, getName(), posUp, scale, true); - RenderHelper.renderText(context, Text.literal(Math.round(distance) + "m").formatted(Formatting.YELLOW), posUp, scale, MinecraftClient.getInstance().textRenderer.fontHeight + 1, true); + protected boolean shouldRenderName() { + return true; } public interface Category { diff --git a/src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java b/src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java index 8e3d1a91..e7d07f34 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java @@ -61,7 +61,7 @@ public class EnigmaSouls { for (int i = 0; i < waypoints.size(); i++) { JsonObject waypoint = waypoints.get(i).getAsJsonObject(); BlockPos pos = new BlockPos(waypoint.get("x").getAsInt(), waypoint.get("y").getAsInt(), waypoint.get("z").getAsInt()); - SOUL_WAYPOINTS.put(pos, new ProfileAwareWaypoint(pos, TYPE_SUPPLIER, GREEN, RED)); + SOUL_WAYPOINTS.put(pos, new EnigmaSoul(pos, TYPE_SUPPLIER, GREEN, RED)); } } catch (IOException e) { @@ -114,9 +114,7 @@ public class EnigmaSouls { if (Utils.isInTheRift() && config.enigmaSoulWaypoints && soulsLoaded.isDone()) { for (Waypoint soul : SOUL_WAYPOINTS.values()) { - if (soul.shouldRender()) { - soul.render(context); - } else if (config.highlightFoundEnigmaSouls) { + if (soul.shouldRender() || config.highlightFoundEnigmaSouls) { soul.render(context); } } @@ -161,4 +159,15 @@ public class EnigmaSouls { .filter(soul -> soul.pos.getSquaredDistance(player.getPos()) <= 16) .ifPresent(Waypoint::setFound); } + + private static class EnigmaSoul extends ProfileAwareWaypoint { + public EnigmaSoul(BlockPos pos, Supplier<Type> typeSupplier, float[] missingColor, float[] foundColor) { + super(pos, typeSupplier, missingColor, foundColor); + } + + @Override + public boolean shouldRender() { + return super.shouldRender() || SkyblockerConfigManager.get().otherLocations.rift.highlightFoundEnigmaSouls; + } + } } diff --git a/src/main/java/de/hysky/skyblocker/skyblock/waypoint/AbstractWaypointsScreen.java b/src/main/java/de/hysky/skyblocker/skyblock/waypoint/AbstractWaypointsScreen.java index da6f52c8..8111f41e 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/waypoint/AbstractWaypointsScreen.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/waypoint/AbstractWaypointsScreen.java @@ -5,7 +5,7 @@ import com.google.common.collect.MultimapBuilder; import de.hysky.skyblocker.utils.Location; import de.hysky.skyblocker.utils.Utils; import de.hysky.skyblocker.utils.waypoint.NamedWaypoint; |
