Skip to content

Commit

Permalink
Add waterboard toggle (#476)
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinthegreat1 authored Jan 4, 2024
1 parent 4dc26a1 commit 39fc7af
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -635,6 +635,9 @@ public static class Dungeons {
@SerialEntry
public boolean solveTicTacToe = true;

@SerialEntry
public boolean solveWaterboard = true;

@SerialEntry
public boolean fireFreezeStaffTimer = true;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,14 @@ public static ConfigCategory create(SkyblockerConfig defaults, SkyblockerConfig
newValue -> config.locations.dungeons.solveTicTacToe = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.solveWaterboard"))
.description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.solveWaterboard.@Tooltip")))
.binding(defaults.locations.dungeons.solveWaterboard,
() -> config.locations.dungeons.solveWaterboard,
newValue -> config.locations.dungeons.solveWaterboard = newValue)
.controller(ConfigUtils::createBooleanController)
.build())
.option(Option.<Boolean>createBuilder()
.name(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.fireFreezeStaffTimer"))
.description(OptionDescription.of(Text.translatable("text.autoconfig.skyblocker.option.locations.dungeons.fireFreezeStaffTimer.@Tooltip")))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import com.mojang.brigadier.Command;
import com.mojang.brigadier.arguments.IntegerArgumentType;
import de.hysky.skyblocker.SkyblockerMod;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.debug.Debug;
import de.hysky.skyblocker.skyblock.dungeon.puzzle.DungeonPuzzle;
import de.hysky.skyblocker.skyblock.dungeon.puzzle.waterboard.Cell.SwitchCell;
Expand Down Expand Up @@ -133,7 +134,7 @@ private static String boardToString(Cell[][] cells) {

@Override
public void tick(MinecraftClient client) {
if (client.world == null || !DungeonManager.isCurrentRoomMatched() || solve != null && !solve.isDone()) {
if (!SkyblockerConfigManager.get().locations.dungeons.solveWaterboard || client.world == null || !DungeonManager.isCurrentRoomMatched() || solve != null && !solve.isDone()) {
return;
}
Room room = DungeonManager.getCurrentRoom();
Expand Down Expand Up @@ -337,7 +338,7 @@ private void findBestCombinations() {

@Override
public void render(WorldRenderContext context) {
if (!DungeonManager.isCurrentRoomMatched()) return;
if (!SkyblockerConfigManager.get().locations.dungeons.solveWaterboard || !DungeonManager.isCurrentRoomMatched()) return;
Room room = DungeonManager.getCurrentRoom();

// Render the best combination.
Expand Down Expand Up @@ -377,7 +378,7 @@ public void render(WorldRenderContext context) {

private ActionResult onUseBlock(PlayerEntity player, World world, Hand hand, BlockHitResult blockHitResult) {
BlockState state = world.getBlockState(blockHitResult.getBlockPos());
if (blockHitResult.getType() == HitResult.Type.BLOCK && waypoints[6] != null && DungeonManager.isCurrentRoomMatched() && blockHitResult.getBlockPos().equals(DungeonManager.getCurrentRoom().relativeToActual(WATER_LEVER)) && state.contains(LeverBlock.POWERED)) {
if (SkyblockerConfigManager.get().locations.dungeons.solveWaterboard && blockHitResult.getType() == HitResult.Type.BLOCK && waypoints[6] != null && DungeonManager.isCurrentRoomMatched() && blockHitResult.getBlockPos().equals(DungeonManager.getCurrentRoom().relativeToActual(WATER_LEVER)) && state.contains(LeverBlock.POWERED)) {
if (!state.get(LeverBlock.POWERED)) {
bestCombinationsUpdated = false;
Scheduler.INSTANCE.schedule(() -> waypoints[6].setMissing(), 50);
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 @@ -223,6 +223,8 @@
"text.autoconfig.skyblocker.option.locations.dungeons.solveTrivia": "Solve Trivia Puzzle",
"text.autoconfig.skyblocker.option.locations.dungeons.solveTicTacToe": "Solve Tic Tac Toe Puzzle",
"text.autoconfig.skyblocker.option.locations.dungeons.solveTicTacToe.@Tooltip": "Puts a red box around the next best move for you to make!",
"text.autoconfig.skyblocker.option.locations.dungeons.solveWaterboard": "Solve Waterboard Puzzle",
"text.autoconfig.skyblocker.option.locations.dungeons.solveWaterboard.@Tooltip": "Click the levers with green boxes to solve the puzzle.",
"text.autoconfig.skyblocker.option.locations.dungeons.lividColor": "Livid Color",
"text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColorGlow": "Enable Livid Color Glow",
"text.autoconfig.skyblocker.option.locations.dungeons.lividColor.enableLividColorGlow.@Tooltip": "Applies the glowing effect to the correct Livid in F5/M5.",
Expand Down

0 comments on commit 39fc7af

Please sign in to comment.