-
-
Notifications
You must be signed in to change notification settings - Fork 84
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #710 from AzureAaron/block-incorrect-term-clicks
Block Incorrect Terminal Clicks
- Loading branch information
Showing
11 changed files
with
102 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/de/hysky/skyblocker/skyblock/dungeon/terminal/LightsOnTerminal.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package de.hysky.skyblocker.skyblock.dungeon.terminal; | ||
|
||
import java.util.List; | ||
|
||
import de.hysky.skyblocker.utils.render.gui.ColorHighlight; | ||
import de.hysky.skyblocker.utils.render.gui.ContainerSolver; | ||
import it.unimi.dsi.fastutil.ints.Int2ObjectMap; | ||
import net.minecraft.item.ItemStack; | ||
import net.minecraft.item.Items; | ||
|
||
/** | ||
* The terminal where you change all the panes that are red to green. | ||
* | ||
* This doesn't solve the terminal because you don't need a solver for it, but rather to simply allow for click blocking. | ||
*/ | ||
public class LightsOnTerminal extends ContainerSolver implements TerminalSolver { | ||
private static final List<ColorHighlight> EMPTY = List.of(); | ||
|
||
public LightsOnTerminal() { | ||
super("^Correct all the panes!$"); | ||
} | ||
|
||
@Override | ||
protected boolean isEnabled() { | ||
return shouldBlockIncorrectClicks(); | ||
} | ||
|
||
@Override | ||
protected List<ColorHighlight> getColors(String[] groups, Int2ObjectMap<ItemStack> slots) { | ||
return EMPTY; | ||
} | ||
|
||
@Override | ||
protected boolean onClickSlot(int slot, ItemStack stack, int screenId, String[] groups) { | ||
return stack.isOf(Items.LIME_STAINED_GLASS_PANE); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/de/hysky/skyblocker/skyblock/dungeon/terminal/TerminalSolver.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package de.hysky.skyblocker.skyblock.dungeon.terminal; | ||
|
||
import de.hysky.skyblocker.config.SkyblockerConfigManager; | ||
|
||
public interface TerminalSolver { | ||
|
||
default boolean shouldBlockIncorrectClicks() { | ||
return SkyblockerConfigManager.get().dungeons.terminals.blockIncorrectClicks; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters