aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2021-08-24 10:40:18 +0200
committerDeDiamondPro <67508414+DeDiamondPro@users.noreply.github.com>2021-08-24 10:40:18 +0200
commit6d0e71699f4ec29c444aa867748ecb408756a01d (patch)
tree00a4822b818a7a14f1f4553189e29a37f12822b7 /src/main/java
parentc974622ac48bbe92621f6297e2eb7cec7df1e17a (diff)
downloadNotEnoughUpdates-6d0e71699f4ec29c444aa867748ecb408756a01d.tar.gz
NotEnoughUpdates-6d0e71699f4ec29c444aa867748ecb408756a01d.tar.bz2
NotEnoughUpdates-6d0e71699f4ec29c444aa867748ecb408756a01d.zip
semi finished crystal hollow overlay
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java8
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java46
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java204
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/AutomatonOverlay.java166
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java403
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/DivanMinesOverlay.java142
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java95
7 files changed, 560 insertions, 504 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
index 4f565fa6..62a94ab8 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
@@ -836,10 +836,10 @@ public class NEUEventListener {
if (unformatted.startsWith("You found ") && SBInfo.getInstance().getLocation() != null && SBInfo.getInstance().getLocation().equals("crystal_hollows")){
CrystalMetalDetectorSolver.reset();
}
- if(unformatted.startsWith("[NPC] Professor Robot: ") || unformatted.startsWith(" "))
- OverlayManager.automatonOverlay.message(unformatted);
- else if(unformatted.startsWith("[NPC] Keeper of "))
- OverlayManager.divanMinesOverlay.message(unformatted);
+ if(unformatted.startsWith("[NPC] Keeper of ") | unformatted.startsWith("[NPC] Professor Robot: ") || unformatted.startsWith(" ") || unformatted.startsWith("✦") ||
+ unformatted.equals(" You've earned a Crystal Loot Bundle!"))
+ OverlayManager.crystalHollowOverlay.message(unformatted);
+ System.out.println(unformatted);
}
public static boolean drawingGuiScreen = false;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
index ee24472f..9327636a 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java
@@ -16,6 +16,7 @@ import io.github.moulberry.notenoughupdates.overlays.*;
import io.github.moulberry.notenoughupdates.util.SBInfo;
import net.minecraft.client.Minecraft;
import net.minecraftforge.client.ClientCommandHandler;
+import org.luaj.vm2.ast.Str;
import org.lwjgl.util.vector.Vector2f;
import java.util.ArrayList;
@@ -86,10 +87,7 @@ public class NEUConfig extends Config {
editOverlay(activeConfigCategory, OverlayManager.bonemerangOverlay, itemOverlays.bonemerangPosition);
return;
case 10:
- editOverlay(activeConfigCategory, OverlayManager.automatonOverlay, mining.automatonOverlayPosition);
- return;
- case 11:
- editOverlay(activeConfigCategory, OverlayManager.divanMinesOverlay, mining.divanMinesOverlayPosition);
+ editOverlay(activeConfigCategory, OverlayManager.crystalHollowOverlay, mining.crystalHollowOverlayPosition);
}
}
@@ -338,23 +336,29 @@ public class NEUConfig extends Config {
@Expose public int commissionMilestone = 0;
- @Expose public HashMap<String, Boolean> automatonParts = new HashMap<>();
-
- @Expose public HashMap<String, Boolean> divanMinesParts = new HashMap<>();
-
- public HiddenProfileSpecific(){
- automatonParts.putIfAbsent("Electron Transmitter", false);
- automatonParts.putIfAbsent("FTX 3070", false);
- automatonParts.putIfAbsent("Robotron Reflector", false);
- automatonParts.putIfAbsent("Superlite Motor", false);
- automatonParts.putIfAbsent("Control Switch", false);
- automatonParts.putIfAbsent("Synthetic Heart", false);
-
- divanMinesParts.putIfAbsent("Scavenged Lapis Sword", false);
- divanMinesParts.putIfAbsent("Scavenged Golden Hammer", false);
- divanMinesParts.putIfAbsent("Scavenged Diamond Axe", false);
- divanMinesParts.putIfAbsent("Scavenged Emerald Hammer", false);
- }
+ @Expose public HashMap<String, Boolean> automatonParts = new HashMap<String, Boolean>(){{
+ put("Electron Transmitter", false);
+ put("FTX 3070", false);
+ put("Robotron Reflector", false);
+ put("Superlite Motor", false);
+ put("Control Switch", false);
+ put("Synthetic Heart", false);
+ }};
+
+ @Expose public HashMap<String, Boolean> divanMinesParts = new HashMap<String, Boolean>(){{
+ put("Scavenged Lapis Sword", false);
+ put("Scavenged Golden Hammer", false);
+ put("Scavenged Diamond Axe", false);
+ put("Scavenged Emerald Hammer", false);
+ }};
+
+ @Expose public HashMap<String, Integer> crystals = new HashMap<String, Integer>(){{
+ put("Jade", 0);
+ put("Amber", 0);
+ put("Amethyst", 0);
+ put("Sapphire", 0);
+ put("Topaz", 0);
+ }};
}
public static List<InventoryButton> createDefaultInventoryButtons() {
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java
index b35704d0..4a4d5e23 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java
@@ -166,169 +166,109 @@ public class Mining {
public boolean metalDetectorShowPossible = false;
@ConfigOption(
- name = "Automaton Parts Overlay",
+ name = "Crystal Hollows Overlay",
desc = ""
)
- @ConfigEditorAccordion(id = 4)
- public boolean automatonOverlayAccordion = false;
+ @ConfigEditorAccordion(id = 6)
+ public boolean crystalHollowOverlayAccordion = false;
@Expose
@ConfigOption(
name = "Enabled",
- desc = "Enables the Automaton parts overlay."
+ desc = "Enables the Crystal Hollows Overlay."
)
@ConfigEditorBoolean
- @ConfigAccordionId(id = 4)
- public boolean automatonOverlay = false;
+ @ConfigAccordionId(id = 6)
+ public boolean crystalHollowOverlay = false;
@Expose
@ConfigOption(
name = "Position",
- desc = "Change the position of the Automaton parts overlay."
+ desc = "Change the position of the Crystal Hollows Overlay overlay."
)
@ConfigEditorButton(
runnableId = 10,
buttonText = "Edit"
)
- @ConfigAccordionId(id = 4)
- public Position automatonOverlayPosition = new Position(200, 0);
-
- @Expose
- @ConfigOption(
- name = "Style",
- desc = "Change the style of the Automaton parts overlay."
- )
- @ConfigEditorDropdown(
- values = {"Background", "No Shadow", "Shadow", "Full Shadow"}
- )
- @ConfigAccordionId(id = 4)
- public int automatonOverlayStyle = 0;
-
- @Expose
- @ConfigOption(
- name = "Show Icons",
- desc = "Show icons in the overlay that represent the part."
- )
- @ConfigEditorBoolean
- @ConfigAccordionId(id = 4)
- public boolean automatonIcons = true;
-
-
- @Expose
- @ConfigOption(
- name = "Hide Done",
- desc = "Don't show parts you've given to Professor Robot."
- )
- @ConfigEditorBoolean
- @ConfigAccordionId(id = 4)
- public boolean automatonHideDone = false;
-
- @ConfigOption(
- name = "Colours",
- desc = ""
- )
- @ConfigEditorAccordion(id = 5)
- @ConfigAccordionId(id = 4)
- public boolean AutomatonColourAccordion = false;
-
- @Expose
- @ConfigOption(
- name = "Part colour",
- desc = "Change the colour of the part text."
-
- )
- @ConfigEditorDropdown(
- values = {"Black", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray", "Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow", "White"}
- )
- @ConfigAccordionId(id = 5)
- public int automatonPartColor = 3;
-
- @Expose
- @ConfigOption(
- name = "Ready colour",
- desc = "Change the colour when the part is given to Professor Robot."
-
- )
- @ConfigEditorDropdown(
- values = {"Black", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray", "Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow", "White"}
- )
- @ConfigAccordionId(id = 5)
- public int automatonDoneColor = 10;
-
- @Expose
- @ConfigOption(
- name = "In Inventory Color",
- desc = "Change the colour when the part is in the inventory."
-
- )
- @ConfigEditorDropdown(
- values = {"Black", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray", "Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow", "White"}
- )
- @ConfigAccordionId(id = 5)
- public int automatonInventoryColor = 14;
+ @ConfigAccordionId(id = 6)
+ public Position crystalHollowOverlayPosition = new Position(200, 0);
@Expose
@ConfigOption(
- name = "In Storage Color",
- desc = "Change the colour when the part is in the storage."
-
+ name = "Text",
+ desc = "\u00a7eDrag text to change the appearance of the overlay"
)
- @ConfigEditorDropdown(
- values = {"Black", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray", "Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow", "White"}
+ @ConfigEditorDraggableList(
+ exampleText = {
+ "\u00a73Amber Crystal: \u00a7aPlaced\n" +
+ "\u00a73Sapphire Crystal: \u00a7eCollected\n" +
+ "\u00a73Jade Crystal: \u00a7eMissing\n" +
+ "\u00a73Amethyst Crystal: \u00a7cMissing\n" +
+ "\u00a73Topaz Crystal: \u00a7cMissing\n",
+ "\u00a73Crystals: \u00a7a4/5",
+ "\u00a73Crystals: \u00a7a80%",
+ "\u00a73Electron Transmitter: \u00a7aDone\n" +
+ "\u00a73Robotron Reflector: \u00a7eIn Storage\n" +
+ "\u00a73Superlite Motor: \u00a7eIn Inventory\n" +
+ "\u00a73Synthetic Hearth: \u00a7cMissing\n" +
+ "\u00a73Control Switch: \u00a7cMissing\n" +
+ "\u00a73FTX 3070: \u00a7cMissing",
+ "\u00a73Electron Transmitter: \u00a7a3\n" +
+ "\u00a73Robotron Reflector: \u00a7e2\n" +
+ "\u00a73Superlite Motor: \u00a7e1\n" +
+ "\u00a73Synthetic Hearth: \u00a7c0\n" +
+ "\u00a73Control Switch: \u00a7c0\n" +
+ "\u00a73FTX 3070: \u00a7c0",
+ "\u00a73Automaton parts: \u00a7a5/6",
+ "\u00a73Automaton parts: \u00a7a83%",
+ "\u00a73Scavenged Lapis Sword: \u00a7aDone\n" +
+ "\u00a73Scavenged Golden Hammer: \u00a7eIn Storage\n" +
+ "\u00a73Scavenged Diamond Axe: \u00a7eIn Inventory\n" +
+ "\u00a73Scavenged Emerald Hammer: \u00a7cMissing\n",
+ "\u00a73Scavenged Lapis Sword: \u00a7a3\n" +
+ "\u00a73Scavenged Golden Hammer: \u00a7e2\n" +
+ "\u00a73Scavenged Diamond Axe: \u00a7e1\n" +
+ "\u00a73Scavenged Emerald Hammer: \u00a7c0\n",
+ "\u00a73Mines of Divan parts: \u00a7a3/4",
+ "\u00a73Mines of Divan parts: \u00a7a75%"
+ }
)
- @ConfigAccordionId(id = 5)
- public int automatonStorageColor = 14;
+ @ConfigAccordionId(id = 6)
+ public List<Integer> crystalHollowText = new ArrayList<>(Arrays.asList(0, 3, 7));
@Expose
@ConfigOption(
- name = "Missing Color",
- desc = "Change the colour when the part is missing."
-
+ name = "Style",
+ desc = "Change the style of the Crystal Hollows Overlay overlay."
)
@ConfigEditorDropdown(
- values = {"Black", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray", "Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow", "White"}
- )
- @ConfigAccordionId(id = 5)
- public int automatonMissingColor = 12;
-
- @ConfigOption(
- name = "Mines of Divan overlay",
- desc = ""
- )
- @ConfigEditorAccordion(id = 6)
- public boolean divanMinesOverlayAccordion = false;
-
- @Expose
- @ConfigOption(
- name = "Enabled",
- desc = "Enables the Mines of Divan overlay."
+ values = {"Background", "No Shadow", "Shadow", "Full Shadow"}
)
- @ConfigEditorBoolean
@ConfigAccordionId(id = 6)
- public boolean divanMinesOverlay = false;
+ public int crystalHollowOverlayStyle = 0;
@Expose
@ConfigOption(
- name = "Position",
- desc = "Change the position of the AMines of Divan overlay."
+ name = "Show Automaton",
+ desc = "Change where to show Automaton parts."
)
- @ConfigEditorButton(
- runnableId = 11,
- buttonText = "Edit"
+ @ConfigEditorDropdown(
+ values = {"Crystal Hollows", "Precursor Remnants", "Lost Precursor City"}
)
@ConfigAccordionId(id = 6)
- public Position divanMinesOverlayPosition = new Position(200, 0);
+ public int crystalHollowAutomatonLocation = 2;
@Expose
@ConfigOption(
- name = "Style",
- desc = "Change the style of the Mines of Divan overlay."
+ name = "Show Automaton",
+ desc = "Change where to show Automaton parts."
)
@ConfigEditorDropdown(
- values = {"Background", "No Shadow", "Shadow", "Full Shadow"}
+ values = {"Crystal Hollows", "Mithril Deposits", "Mines of Divan"}
)
@ConfigAccordionId(id = 6)
- public int divanMinesOverlayStyle = 0;
+ public int crystalHollowDivanLocation = 2;
+
@Expose
@ConfigOption(
@@ -337,17 +277,17 @@ public class Mining {
)
@ConfigEditorBoolean
@ConfigAccordionId(id = 6)
- public boolean divanMinesIcons = true;
+ public boolean crystalHollowIcons = true;
@Expose
@ConfigOption(
name = "Hide Done",
- desc = "Don't show parts you've given to the Keepers."
+ desc = "Don't show parts you've given to the NPC."
)
@ConfigEditorBoolean
@ConfigAccordionId(id = 6)
- public boolean divanMinesHideDone = false;
+ public boolean crystalHollowHideDone = false;
@ConfigOption(
name = "Colours",
@@ -355,7 +295,7 @@ public class Mining {
)
@ConfigEditorAccordion(id = 7)
@ConfigAccordionId(id = 6)
- public boolean divanMinesColourAccordion = false;
+ public boolean crystalHollowColourAccordion = false;
@Expose
@ConfigOption(
@@ -367,19 +307,19 @@ public class Mining {
values = {"Black", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray", "Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow", "White"}
)
@ConfigAccordionId(id = 7)
- public int divanMinesPartColor = 3;
+ public int crystalHollowPartColor = 3;
@Expose
@ConfigOption(
- name = "Ready colour",
- desc = "Change the colour when the part is given to the Keepers."
+ name = "Done colour",
+ desc = "Change the colour when the part is given to the NPC."
)
@ConfigEditorDropdown(
values = {"Black", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray", "Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow", "White"}
)
@ConfigAccordionId(id = 7)
- public int divanMinesDoneColor = 10;
+ public int crystalHollowDoneColor = 10;
@Expose
@ConfigOption(
@@ -391,7 +331,7 @@ public class Mining {
values = {"Black", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray", "Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow", "White"}
)
@ConfigAccordionId(id = 7)
- public int divanMinesInventoryColor = 14;
+ public int crystalHollowInventoryColor = 14;
@Expose
@ConfigOption(
@@ -403,7 +343,7 @@ public class Mining {
values = {"Black", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray", "Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow", "White"}
)
@ConfigAccordionId(id = 7)
- public int divanMinesStorageColor = 14;
+ public int crystalHollowStorageColor = 14;
@Expose
@ConfigOption(
@@ -415,7 +355,7 @@ public class Mining {
values = {"Black", "Dark Blue", "Dark Green", "Dark Aqua", "Dark Red", "Dark Purple", "Gold", "Gray", "Dark Gray", "Blue", "Green", "Aqua", "Red", "Light Purple", "Yellow", "White"}
)
@ConfigAccordionId(id = 7)
- public int divanMinesMissingColor = 12;
+ public int crystalHollowMissingColor = 12;
@Expose
@ConfigOption(
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/AutomatonOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/AutomatonOverlay.java
deleted file mode 100644
index a0ef88b8..00000000
--- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/AutomatonOverlay.java
+++ /dev/null
@@ -1,166 +0,0 @@
-package io.github.moulberry.notenoughupdates.overlays;
-
-import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
-import io.github.moulberry.notenoughupdates.core.config.Position;
-import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager;
-import io.github.moulberry.notenoughupdates.options.NEUConfig;
-import io.github.moulberry.notenoughupdates.util.SBInfo;
-import io.github.moulberry.notenoughupdates.util.Utils;
-import net.minecraft.client.Minecraft;
-import net.minecraft.client.renderer.GlStateManager;
-import net.minecraft.item.ItemStack;
-import net.minecraft.util.EnumChatFormatting;
-import org.lwjgl.util.vector.Vector2f;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.function.Supplier;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-
-public class AutomatonOverlay extends TextOverlay {
- private static final Minecraft mc = Minecraft.getMinecraft();
- private final StorageManager storageManager = StorageManager.getInstance();
- private final Pattern givePattern = Pattern.compile("\\[NPC] Professor Robot: Thanks for bringing me the (?<part>[a-zA-Z0-9 ]+)! Bring me (\\d+|one) more components? to fix the giant!");
- private final Pattern notFinalPattern = Pattern.compile("\\[NPC] Professor Robot: That's not the final component! Bring me a (?<part>[a-zA-Z0-9 ]+) to gain access to Automaton Prime's storage container!");
-
- public AutomatonOverlay(Position position, Supplier<List<String>> dummyStrings, Supplier<TextOverlayStyle> styleSupplier) {
- super(position, dummyStrings, styleSupplier);
- }
-
- @Override
- public void update() {
- overlayStrings = null;
- if (!NotEnoughUpdates.INSTANCE.config.mining.automatonOverlay || SBInfo.getInstance().getLocation() == null ||
- !SBInfo.getInstance().getLocation().equals("crystal_hollows") || !SBInfo.getInstance().location.equals("Lost Precursor City"))
- return;
-
- NEUConfig.HiddenProfileSpecific hidden = NotEnoughUpdates.INSTANCE.config.getProfileSpecific();
- if (hidden == null) return;
- overlayStrings = new ArrayList<>();
- HashMap<String, String> states = new HashMap<>();
- for (String key : hidden.automatonParts.keySet()) {
- Boolean has = hidden.automatonParts.get(key);
- if (has)
- states.put(key, EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.mining.automatonDoneColor] + "Done");
- }
- for (ItemStack item : mc.thePlayer.inventory.mainInventory) {
- if (item != null) {
- String name = Utils.cleanColour(item.getDisplayName());
- if (!states.containsKey(name)) {
- states.put(name, EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.mining.automatonInventoryColor] + "In Inventory");
- }
- }
- }
- for (Map.Entry<Integer, Integer> entry : storageManager.storageConfig.displayToStorageIdMap.entrySet()) {
- int storageId = entry.getValue();
- StorageManager.StoragePage page = storageManager.getPage(storageId, false);
- if (page != null && page.rows > 0) {
- for (ItemStack item : page.items) {
- if (item != null) {
- String name = Utils.cleanColour(item.getDisplayName());
- if (!states.containsKey(name)) {
- states.put(name, EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.mining.automatonStorageColor] + "In Storage");
- }
- }
- }
- }
- }
- for (String key : hidden.automatonParts.keySet()) {
- if (!NotEnoughUpdates.INSTANCE.config.mining.automatonHideDone || !hidden.automatonParts.get(key)) {
- if (!states.containsKey(key))
- states.put(key, EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.mining.automatonMissingColor] + "Missing");
- overlayStrings.add(EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.mining.automatonPartColor] + key + ": " + states.get(key));
- }
- }
- }
-
- public void message(String message) {
- NEUConfig.HiddenProfileSpecific hidden = NotEnoughUpdates.INSTANCE.config.getProfileSpecific();
- if (hidden == null) return;
- if (message.startsWith(" ")) {
- String item = message.replace(" ", "");
- if (hidden.automatonParts.containsKey(item)) {
- hidden.automatonParts.put(item, false);
- }
- } else if (message.startsWith("[NPC] Professor Robot: ")) {
- switch (message) {
- case "[NPC] Professor Robot: That's not one of the components I need! Bring me one of the missing components:":
- hidden.automatonParts.replaceAll((k, v) -> true);
- break;
- case "[NPC] Professor Robot: You've brought me all of the components!":
- case "[NPC] Professor Robot: You haven't placed the Sapphire Crystal yet!":
- case "[NPC] Professor Robot: You have already placed the Sapphire Crystal!":
- hidden.automatonParts.replaceAll((k, v) -> false);
- break;
- default:
- Matcher giveMatcher = givePattern.matcher(message);
- Matcher notFinalMatcher = notFinalPattern.matcher(message);
- if (giveMatcher.matches()) {
- String item = giveMatcher.group("part");
- if (hidden.automatonParts.containsKey(item)) {
- hidden.automatonParts.put(item, true);
- }
- } else if (notFinalMatcher.matches()) {
- String item = notFinalMatcher.group("part");
- if (hidden.automatonParts.containsKey(item)) {
- hidden.automatonParts.replaceAll((k, v) -> true);
- hidden.automatonParts.put(item, false);
- }
- }
- break;
- }
- }
- }
-
- @Override
- protected void renderLine(String line, Vector2f position, boolean dummy) {
- if (!NotEnoughUpdates.INSTANCE.config.mining.automatonIcons) return;
- GlStateManager.enableDepth();
-
- ItemStack icon = null;
- String cleaned = Utils.cleanColour(line);
- String beforeColon = cleaned.split(":")[0];
- switch (beforeColon) {
- case "Electron Transmitter":
- icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ELECTRON_TRANSMITTER"));
- break;
- case "FTX 3070":
- icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("FTX_3070"));
- break;
- case "Robotron Reflector":
- icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("ROBOTRON_REFLECTOR"));
- break;
- case "Superlite Motor":
- icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("SUPERLITE_MOTOR"));
- break;
- case "Control Switch":
- icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("CONTROL_SWITCH"));
- break;
- case "Synthetic Heart":
- icon = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("SYNTHETIC_HEART"));
- break;
- }
-
- if (icon != null) {
- GlStateManager.pushMatrix();
- GlStateManager.translate(position.x - 2, position.y - 2, 0);
- GlStateManager.scale(0.7f, 0.7f, 1f);
- Utils.drawItemStack(icon, 0, 0);
- GlStateManager.popMatrix();
-
- position.x += 12;
- }
-
- super.renderLine(line, position, dummy);
- }
-
- @Override
- protected Vector2f getSize(List<String> strings) {
- if (NotEnoughUpdates.INSTANCE.config.mining.automatonIcons)
- return super.getSize(strings).translate(12, 0);
- return super.getSize(strings);
- }
-}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java
new file mode 100644
index 00000000..3dadca29
--- /dev/null
+++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CrystalHollowOverlay.java
@@ -0,0 +1,403 @@
+package io.github.moulberry.notenoughupdates.overlays;
+
+import io.github.moulberry.notenoughupdates.NotEnoughUpdates;
+import io.github.moulberry.notenoughupdates.core.config.Position;
+import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager;
+import io.github.moulberry.notenoughupdates.options.NEUConfig;
+import io.github.moulberry.notenoughupdates.util.SBInfo;
+import io.github.moulberry.notenoughupdates.util.Utils;
+import net.minecraft.client.Minecraft;
+import net.minecraft.client.renderer.GlStateManager;
+import net.minecraft.item.ItemStack;
+import net.minecraft.util.EnumChatFormatting;
+import org.lwjgl.util.vector.Vector2f;
+
+import java.text.DecimalFormat;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.function.Supplier;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class CrystalHollowOverlay extends TextOverlay {
+ private static final Minecraft mc = Minecraft.getMinecraft();
+ private final StorageManager storageManager = StorageManager.getInstance();
+ private final Pattern notFoundPattern = Pattern.compile("\\[NPC] Keeper of \\w+: Talk to me when you have found a (?<item>[a-z-A-Z ]+)!");
+ private final Pattern foundPattern = Pattern.compile("\\[NPC] Keeper of \\w+: Excellent! You have returned the (?<item>[a-z-A-Z ]+) to its rightful place!");
+ private final Pattern resetPattern = Pattern.compile("\\[NPC] Keeper of \\w+: (You found all of the items! Behold\\.\\.\\. the Jade Crystal!)");
+ private final Pattern alreadyFoundPattern = Pattern.compile("\\[NPC] Keeper of \\w+: You have already restored this Dwarf's (?<item>[a-z-A-Z ]+)!");
+ private final Pattern givePattern = Pattern.compile("\\[NPC] Professor Robot: Thanks for bringing me the (?<part>[a-zA-Z0-9 ]+)! Bring me (\\d+|one) more components? to fix the giant!");
+ private final Pattern notFinalPattern = Pattern.compile("\\[NPC] Professor Robot: That's not the final component! Bring me a (?<part>[a-zA-Z0-9 ]+) to gain access to Automaton Prime's storage container!");
+ private final Pattern obtainCrystalPattern = Pattern.compile(" +(?<crystal>[a-zA-Z]+) Crystal");
+ private final Pattern crystalNotPlacedPattern = Pattern.compile(".*: You haven't placed the (?<crystal>[a-zA-Z]+) Crystal yet!");
+ private final Pattern crystalPlacedPattern = Pattern.compile(".*: You have already placed the (?<crystal>[a-zA-Z]+) Crystal!");
+ private final Pattern crystalPlacePattern = Pattern.compile("✦ You placed the (?<crystal>[a-zA-Z]+) Crystal!");
+ private final Pattern crystalReclaimPattern = Pattern.compile("✦ You reclaimed the (?<crystal>[a-zA-Z]+) Crystal!");
+
+ public CrystalHollowOverlay(Position position, Supplier<List<String>> dummyStrings, Supplier<TextOverlayStyle> styleSupplier) {
+ super(position, dummyStrings, styleSupplier);
+ }
+
+ @Override
+ public void update() {
+ overlayStrings = null;
+ if (!NotEnoughUpdates.INSTANCE.config.mining.crystalHollowOverlay || SBInfo.getInstance().getLocation() == null ||
+ !SBInfo.getInstance().getLocation().equals("crystal_hollows"))
+ return;
+
+ NEUConfig.HiddenProfileSpecific hidden = NotEnoughUpdates.INSTANCE.config.getProfileSpecific();
+ if (hidden == null) return;
+ overlayStrings = new ArrayList<>();
+ HashMap<String, Integer> inventoryData = new HashMap<>();
+ for (String key : hidden.automatonParts.keySet())
+ inventoryData.put(key, 0);
+ for (String key : hidden.divanMinesParts.keySet())
+ inventoryData.put(key, 0);
+ HashMap<String, Integer> storageData = new HashMap<>(inventoryData);
+ for (ItemStack item : mc.thePlayer.inventory.mainInventory)
+ if (item != null) {
+ String name = Utils.cleanColour(item.getDisplayName());
+ if (inventoryData.containsKey(name))
+ inventoryData.put(name, inventoryData.get(name) + item.stackSize);
+ }
+ for (Map.Entry<Integer, Integer> entry : storageManager.storageConfig.displayToStorageIdMap.entrySet()) {
+ int storageId = entry.getValue();
+ StorageManager.StoragePage page = storageManager.getPage(storageId, false);
+ if (page != null && page.rows > 0)
+ for (ItemStack item : page.items)
+ if (item != null) {
+ String name = Utils.cleanColour(item.getDisplayName());
+ if (storageData.containsKey(name))
+ storageData.put(name, storageData.get(name) + item.stackSize);
+ }
+ }
+
+ for (int i : NotEnoughUpdates.INSTANCE.config.mining.crystalHollowText) {
+ switch (i) {
+ case 0:
+ if (crystalCheck()) {
+ for (String part : hidden.crystals.keySet()) {
+ switch (hidden.crystals.get(part)) {
+ case 2:
+ overlayStrings.add(EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.mining.crystalHollowPartColor] + part + ": " +
+ EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.mining.crystalHollowDoneColor] + "Placed");
+ break;
+ case 1:
+ overlayStrings.add(EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.mining.crystalHollowPartColor] + part + ": " +
+ EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.mining.crystalHollowInventoryColor] + "Collected");
+ break;
+ case 0:
+ overlayStrings.add(EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.mining.crystalHollowPartColor] + part + ": " +
+ EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.mining.crystalHollowMissingColor] + "Missing");
+ break;
+ }
+ }
+ }
+ break;
+ case 1:
+ if (crystalCheck()) {
+ int count = getCountCrystal(hidden.crystals);
+