diff options
author | Kevin <92656833+kevinthegreat1@users.noreply.github.com> | 2024-01-04 14:56:54 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-01-04 01:56:54 -0500 |
commit | 39fc7afc81197e2c637fd10322c1a15ec587337a (patch) | |
tree | e817f5e14fef1568d4395c4772664f2102fa978b /src/main | |
parent | 4dc26a13ced11281a4da74bd52d00ef36c0d03d5 (diff) | |
download | Skyblocker-39fc7afc81197e2c637fd10322c1a15ec587337a.tar.gz Skyblocker-39fc7afc81197e2c637fd10322c1a15ec587337a.tar.bz2 Skyblocker-39fc7afc81197e2c637fd10322c1a15ec587337a.zip |
Add waterboard toggle (#476)
Diffstat (limited to 'src/main')
4 files changed, 17 insertions, 3 deletions
diff --git a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java index 7e6dbdd8..a2c82215 100644 --- a/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java +++ b/src/main/java/de/hysky/skyblocker/config/SkyblockerConfig.java @@ -636,6 +636,9 @@ public class SkyblockerConfig { public boolean solveTicTacToe = true; @SerialEntry + public boolean solveWaterboard = true; + + @SerialEntry public boolean fireFreezeStaffTimer = true; @SerialEntry diff --git a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java index b300be36..e4340ebc 100644 --- a/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java +++ b/src/main/java/de/hysky/skyblocker/config/categories/DungeonsCategory.java @@ -355,6 +355,14 @@ public class DungeonsCategory { .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"))) .binding(defaults.locations.dungeons.fireFreezeStaffTimer, diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/puzzle/waterboard/Waterboard.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/puzzle/waterboard/Waterboard.java index 0006e6e2..3244996a 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/puzzle/waterboard/Waterboard.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/puzzle/waterboard/Waterboard.java @@ -5,6 +5,7 @@ import com.google.common.collect.MultimapBuilder; 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; @@ -133,7 +134,7 @@ public class Waterboard extends DungeonPuzzle { @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(); @@ -337,7 +338,7 @@ public class Waterboard extends DungeonPuzzle { @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. @@ -377,7 +378,7 @@ public class Waterboard extends DungeonPuzzle { 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); diff --git a/src/main/resources/assets/skyblocker/lang/en_us.json b/src/main/resources/assets/skyblocker/lang/en_us.json index 1f177ac8..e2d092fb 100644 --- a/src/main/resources/assets/skyblocker/lang/en_us.json +++ b/src/main/resources/assets/skyblocker/lang/en_us.json @@ -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.", |