blob: de9bd0480719e82e0f680fec74edb273dd637167 (
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 de.hysky.skyblocker.skyblock.dungeon;
import de.hysky.skyblocker.config.SkyblockerConfigManager;
import de.hysky.skyblocker.utils.ItemUtils;
import de.hysky.skyblocker.utils.render.gui.ColorHighlight;
import de.hysky.skyblocker.utils.container.ContainerSolver;
import it.unimi.dsi.fastutil.ints.Int2ObjectMap;
import net.minecraft.component.DataComponentTypes;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import java.util.List;
public class CroesusHelper extends ContainerSolver {
public CroesusHelper() {
super("^Croesus$");
}
@Override
public boolean isEnabled() {
return SkyblockerConfigManager.get().dungeons.croesusHelper;
}
@Override
public List<ColorHighlight> getColors(Int2ObjectMap<ItemStack> slots) {
List<ColorHighlight> highlights = new ArrayList<>();
for (Int2ObjectMap.Entry<ItemStack> entry : slots.int2ObjectEntrySet()) {
ItemStack stack = entry.getValue();
if (stack != null && stack.contains(DataComponentTypes.LORE)) {
if (ItemUtils.getLoreLineIf(stack, s -> s.contains("Opened Chest:")) != null) {
highlights.add(ColorHighlight.gray(entry.getIntKey()));
} else if (ItemUtils.getLoreLineIf(stack, s -> s.contains("No more Chests to open!")) != null) {
highlights.add(ColorHighlight.red(entry.getIntKey()));
}
}
}
return highlights;
}
}
|