Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Waypoint API #418

Merged
merged 5 commits into from
Nov 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/main/java/de/hysky/skyblocker/SkyblockerMod.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.debug.Debug;
import de.hysky.skyblocker.skyblock.*;
import de.hysky.skyblocker.skyblock.diana.MythologicalRitual;
import de.hysky.skyblocker.skyblock.waypoint.MythologicalRitual;
import de.hysky.skyblocker.skyblock.dungeon.*;
import de.hysky.skyblocker.skyblock.dungeon.secrets.DungeonSecrets;
import de.hysky.skyblocker.skyblock.dungeon.secrets.SecretsTracker;
Expand All @@ -18,10 +18,11 @@
import de.hysky.skyblocker.skyblock.rift.TheRift;
import de.hysky.skyblocker.skyblock.shortcut.Shortcuts;
import de.hysky.skyblocker.skyblock.special.SpecialEffects;
import de.hysky.skyblocker.skyblock.spidersden.Relics;
import de.hysky.skyblocker.skyblock.waypoint.Relics;
import de.hysky.skyblocker.skyblock.tabhud.TabHud;
import de.hysky.skyblocker.skyblock.tabhud.screenbuilder.ScreenMaster;
import de.hysky.skyblocker.skyblock.tabhud.util.PlayerListMgr;
import de.hysky.skyblocker.skyblock.waypoint.FairySouls;
import de.hysky.skyblocker.utils.ApiUtils;
import de.hysky.skyblocker.utils.NEURepoManager;
import de.hysky.skyblocker.utils.Utils;
Expand Down
41 changes: 26 additions & 15 deletions src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,9 @@ public static class General {
@SerialEntry
public Shortcuts shortcuts = new Shortcuts();

@SerialEntry
public Waypoints waypoints = new Waypoints();

@SerialEntry
public QuiverWarning quiverWarning = new QuiverWarning();

Expand Down Expand Up @@ -254,8 +257,8 @@ public enum NameSorting {
@Override
public String toString() {
return switch (this) {
case DEFAULT -> "Default";
case ALPHABETICAL -> "Alphabetical";
case DEFAULT -> "Default";
case ALPHABETICAL -> "Alphabetical";
};
}
}
Expand Down Expand Up @@ -293,10 +296,10 @@ public String toString() {

public int toInt() {
return switch (this) {
case LAYER1 -> 0;
case LAYER2 -> 1;
case RIGHT -> 2;
case NONE -> -1;
case LAYER1 -> 0;
case LAYER2 -> 1;
case RIGHT -> 2;
case NONE -> -1;
};
}
}
Expand Down Expand Up @@ -349,6 +352,14 @@ public static class Shortcuts {
public boolean enableCommandArgShortcuts = true;
}

public static class Waypoints {
@SerialEntry
public boolean enableWaypoints = true;

@SerialEntry
public Waypoint.Type waypointType = Waypoint.Type.WAYPOINT;
}

public static class QuiverWarning {
@SerialEntry
public boolean enableQuiverWarning = true;
Expand Down Expand Up @@ -419,8 +430,8 @@ public enum Direction {
@Override
public String toString() {
return switch (this) {
case HORIZONTAL -> "Horizontal";
case VERTICAL -> "Vertical";
case HORIZONTAL -> "Horizontal";
case VERTICAL -> "Vertical";
};
}
}
Expand All @@ -431,9 +442,9 @@ public enum Alignment {
@Override
public String toString() {
return switch (this) {
case LEFT -> "Left";
case RIGHT -> "Right";
case MIDDLE -> "Middle";
case LEFT -> "Left";
case RIGHT -> "Right";
case MIDDLE -> "Middle";
};
}
}
Expand Down Expand Up @@ -515,7 +526,7 @@ public enum RarityBackgroundStyle {

public final Identifier tex;

private RarityBackgroundStyle(Identifier tex) {
RarityBackgroundStyle(Identifier tex) {
this.tex = tex;
}

Expand Down Expand Up @@ -743,9 +754,9 @@ public enum DwarvenHudStyle {
@Override
public String toString() {
return switch (this) {
case SIMPLE -> "Simple";
case FANCY -> "Fancy";
case CLASSIC -> "Classic";
case SIMPLE -> "Simple";
case FANCY -> "Fancy";
case CLASSIC -> "Classic";
};
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig
.flag(OptionFlag.GAME_RESTART)
.build())
.option(Option.<Type>createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.waypointType"))
.description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.secretWaypoints.waypointType.@Tooltip")))
.name(Text.translatable("text.autoconfig.skyblocker.option.general.waypoints.waypointType"))
.description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.general.waypoints.waypointType.@Tooltip")))
.binding(defaults.locations.dungeons.secretWaypoints.waypointType,
() -> config.locations.dungeons.secretWaypoints.waypointType,
newValue -> config.locations.dungeons.secretWaypoints.waypointType = newValue)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import de.hysky.skyblocker.config.SkyblockerConfig;
import de.hysky.skyblocker.skyblock.shortcut.ShortcutsConfigScreen;
import de.hysky.skyblocker.utils.render.title.TitleContainerConfigScreen;
import de.hysky.skyblocker.utils.waypoint.Waypoint;
import dev.isxander.yacl3.api.*;
import dev.isxander.yacl3.api.controller.FloatFieldControllerBuilder;
import dev.isxander.yacl3.api.controller.FloatSliderControllerBuilder;
Expand Down Expand Up @@ -261,6 +262,27 @@ public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig
.build())
.build())

//Waypoints
.group(OptionGroup.createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.general.waypoints"))
.collapsed(true)
.option(Option.<Boolean>createBuilder()
kevinthegreat1 marked this conversation as resolved.
Show resolved Hide resolved
.name(Text.translatable("text.autoconfig.skyblocker.option.general.waypoints.enableWaypoints"))
.binding(defaults.general.waypoints.enableWaypoints,
() -> config.general.waypoints.enableWaypoints,
newValue -> config.general.waypoints.enableWaypoints = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<Waypoint.Type>createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.general.waypoints.waypointType"))
.description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.general.waypoints.waypointType.@Tooltip"), Text.translatable("text.autoconfig.skyblocker.option.general.waypoints.waypointType.generalNote")))
.binding(defaults.general.waypoints.waypointType,
() -> config.general.waypoints.waypointType,
newValue -> config.general.waypoints.waypointType = newValue)
.controller(ConfigUtils::createEnumCyclingListController)
.build())
.build())

//Quiver Warning
.group(OptionGroup.createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.general.quiverWarning"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.llamalad7.mixinextras.injector.WrapWithCondition;
import com.llamalad7.mixinextras.sugar.Local;
import de.hysky.skyblocker.skyblock.FishingHelper;
import de.hysky.skyblocker.skyblock.diana.MythologicalRitual;
import de.hysky.skyblocker.skyblock.waypoint.MythologicalRitual;
import de.hysky.skyblocker.skyblock.dungeon.secrets.DungeonSecrets;
import de.hysky.skyblocker.utils.Utils;
import dev.cbyrne.betterinject.annotations.Inject;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ private static void render(WorldRenderContext wrc, BlockHitResult blockHitResult
@SuppressWarnings("DataFlowIssue")
BlockState state = client.world.getBlockState(pos);
if (!state.isAir() && client.world.getBlockState(pos.up()).isAir() && client.world.getBlockState(pos.up(2)).isAir()) {
RenderHelper.renderFilledIfVisible(wrc, pos, COLOR_COMPONENTS, 0.5f);
RenderHelper.renderFilled(wrc, pos, COLOR_COMPONENTS, 0.5f, false);
}
}
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package de.hysky.skyblocker.skyblock.dungeon;

import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.skyblock.FairySouls;
import de.hysky.skyblocker.skyblock.waypoint.FairySouls;
import de.hysky.skyblocker.utils.chat.ChatFilterResult;
import de.hysky.skyblocker.utils.chat.ChatPatternListener;
import net.minecraft.client.MinecraftClient;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ protected static void render(WorldRenderContext context) {
for (BlockPos effigy : UNBROKEN_EFFIGIES) {
float[] colorComponents = DyeColor.RED.getColorComponents();
if (SkyblockerConfigManager.get().slayer.vampireSlayer.compactEffigyWaypoints) {
RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, effigy.down(6), colorComponents, 0.5F);
RenderHelper.renderFilledWithBeaconBeam(context, effigy.down(6), colorComponents, 0.5F, true);
} else {
RenderHelper.renderFilledThroughWallsWithBeaconBeam(context, effigy, colorComponents, 0.5F);
RenderHelper.renderFilledWithBeaconBeam(context, effigy, colorComponents, 0.5F, true);
for (int i = 1; i < 6; i++) {
RenderHelper.renderFilledThroughWalls(context, effigy.down(i), colorComponents, 0.5F - (0.075F * i));
RenderHelper.renderFilled(context, effigy.down(i), colorComponents, 0.5F - (0.075F * i), true);
}
}
}
Expand Down