Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 16 additions & 4 deletions src/main/java/de/hysky/skyblocker/skyblock/rift/EnigmaSouls.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public class EnigmaSouls {
private static final Logger LOGGER = LoggerFactory.getLogger(EnigmaSouls.class);
private static final Supplier<Waypoint.Type> TYPE_SUPPLIER = () -> SkyblockerConfigManager.get().uiAndVisuals.waypoints.waypointType;
private static final Identifier WAYPOINTS_JSON = SkyblockerMod.id("rift/enigma_soul_waypoints.json");
private static final Map<BlockPos, ProfileAwareWaypoint> SOUL_WAYPOINTS = new HashMap<>(42);
private static final Map<BlockPos, ProfileAwareWaypoint> SOUL_WAYPOINTS = new HashMap<>(50);
private static final Path FOUND_SOULS_FILE = SkyblockerMod.CONFIG_DIR.resolve("found_enigma_souls.json");
private static final float[] GREEN = ColorUtils.getFloatComponents(DyeColor.GREEN);
private static final float[] RED = ColorUtils.getFloatComponents(DyeColor.RED);
Expand Down Expand Up @@ -131,7 +131,7 @@ static boolean onMessage(Component text, boolean overlay) {
String message = text.getString();

if (message.equals("You have already found that Enigma Soul!") || ChatFormatting.stripFormatting(message).equals("SOUL! You unlocked an Enigma Soul!"))
markClosestSoulAsFound();
markClosestSoul(true);
}

return true;
Expand All @@ -151,11 +151,23 @@ static void registerCommands(CommandDispatcher<FabricClientCommandSource> dispat
SOUL_WAYPOINTS.values().forEach(Waypoint::setMissing);
context.getSource().sendFeedback(Constants.PREFIX.get().append(Component.translatable("skyblocker.rift.enigmaSouls.markAllMissing")));

return Command.SINGLE_SUCCESS;
}))
.then(literal("markClosestFound").executes(context -> {
markClosestSoul(true);
context.getSource().sendFeedback(Constants.PREFIX.get().append(Component.translatable("skyblocker.rift.enigmaSouls.markClosestFound")));

return Command.SINGLE_SUCCESS;
}))
.then(literal("markClosestMissing").executes(context -> {
markClosestSoul(false);
context.getSource().sendFeedback(Constants.PREFIX.get().append(Component.translatable("skyblocker.rift.enigmaSouls.markClosestMissing")));

return Command.SINGLE_SUCCESS;
})))));
}

private static void markClosestSoulAsFound() {
private static void markClosestSoul(boolean asFound) {
LocalPlayer player = Minecraft.getInstance().player;

if (!soulsLoaded.isDone() || player == null) return;
Expand All @@ -164,7 +176,7 @@ private static void markClosestSoulAsFound() {
.filter(Waypoint::shouldRender)
.min(Comparator.comparingDouble(soul -> soul.pos.distToCenterSqr(player.position())))
.filter(soul -> soul.pos.distToCenterSqr(player.position()) <= 16)
.ifPresent(Waypoint::setFound);
.ifPresent(asFound ? Waypoint::setFound : Waypoint::setMissing);
}

private static class EnigmaSoul extends ProfileAwareWaypoint {
Expand Down
2 changes: 2 additions & 0 deletions src/main/resources/assets/skyblocker/lang/en_us.json
Original file line number Diff line number Diff line change
Expand Up @@ -1818,6 +1818,8 @@

"skyblocker.rift.enigmaSouls.markAllFound": "Marked all enigma souls as found!",
"skyblocker.rift.enigmaSouls.markAllMissing": "Marked all enigma souls as missing!",
"skyblocker.rift.enigmaSouls.markClosestFound": "Marked closest enigma soul as found!",
"skyblocker.rift.enigmaSouls.markClosestMissing": "Marked closest enigma soul as missing!",
"skyblocker.rift.healNow": "Heal now!",
"skyblocker.rift.iceNow": "Ice now!",
"skyblocker.rift.mania": "Mania!",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,46 @@
"x": 256,
"y": 130,
"z": 75
},
{
"x": 7,
"y": 113,
"z": 73
},
{
"x": 35,
"y": 98,
"z": 166
},
{
"x": 22,
"y": 208,
"z": -5
},
{
"x": 21,
"y": 108,
"z": 55
},
{
"x": 39,
"y": 133,
"z": 16
},
{
"x": 8,
"y": 157,
"z": 59
},
{
"x": -20.5,
"y": 135,
"z": 38.5
},
{
"x": 26,
"y": 166,
"z": 7
}
]
}
}