blob: 84de64eb95f2faced6f763dcd1239a0ff37a2596 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
package me.xmrvizzy.skyblocker.gui;
import net.minecraft.item.ItemStack;
import java.util.List;
import java.util.Map;
import java.util.regex.Pattern;
/**
* Abstract class for gui solvers. Extend this class to add a new gui solver, like terminal solvers or experiment solvers.
*/
public abstract class ContainerSolver {
private final Pattern CONTAINER_NAME;
protected final static int GREEN_HIGHLIGHT = 128 << 24 | 64 << 16 | 196 << 8 | 64;
protected final static int GRAY_HIGHLIGHT = 128 << 24 | 64 << 16 | 64 << 8 | 64;
public ContainerSolver(String containerName) {
CONTAINER_NAME = Pattern.compile(containerName);
}
public abstract boolean isEnabled();
public Pattern getName() {
return CONTAINER_NAME;
}
public abstract List<ColorHighlight> getColors(String[] groups, Map<Integer, ItemStack> slots);
public void trimEdges(Map<Integer, ItemStack> slots, int rows) {
for (int i = 0; i < rows; i++) {
slots.remove(9 * i);
slots.remove(9 * i + 8);
}
for (int i = 1; i < 8; i++) {
slots.remove(i);
slots.remove((rows - 1) * 9 + i);
}
}
}
|