diff options
author | Cow <cow@volloeko.de> | 2021-07-07 11:28:14 +0200 |
---|---|---|
committer | Cow <cow@volloeko.de> | 2021-07-07 11:28:14 +0200 |
commit | f0b896d0d3cf9525d683dcc2de36e5a8016008c9 (patch) | |
tree | 968d5c219a44f0e8ce05263ca6c882aec9611a66 /src | |
parent | 8ab5f32ea86717b8b1e92780dff2735403484676 (diff) | |
download | Cowlection-f0b896d0d3cf9525d683dcc2de36e5a8016008c9.tar.gz Cowlection-f0b896d0d3cf9525d683dcc2de36e5a8016008c9.tar.bz2 Cowlection-f0b896d0d3cf9525d683dcc2de36e5a8016008c9.zip |
Fixed 2 edge cases
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/listener/skyblock/SkyBlockListener.java | 4 | ||||
-rw-r--r-- | src/main/java/de/cowtipper/cowlection/util/Utils.java | 20 |
2 files changed, 15 insertions, 9 deletions
diff --git a/src/main/java/de/cowtipper/cowlection/listener/skyblock/SkyBlockListener.java b/src/main/java/de/cowtipper/cowlection/listener/skyblock/SkyBlockListener.java index f619752..df716dc 100644 --- a/src/main/java/de/cowtipper/cowlection/listener/skyblock/SkyBlockListener.java +++ b/src/main/java/de/cowtipper/cowlection/listener/skyblock/SkyBlockListener.java @@ -74,7 +74,7 @@ public class SkyBlockListener { // example: " §a42§7x §fLeather §7for §6436.8 coins" private static final Pattern BAZAAR_SELL_ALL_PATTERN = Pattern.compile("^(?:§[0-9a-fl-or])* (?:§[0-9a-fl-or])+([0-9,]+)(?:§[0-9a-fl-or])+x (?:§[0-9a-fl-or])+.+ (?:§[0-9a-fl-or])+for (?:§[0-9a-fl-or])+([0-9,.]+) coins$"); private static final Pattern BAZAAR_TARGET_AMOUNT_PATTERN = Pattern.compile("^O(?:ff|rd)er amount: ([\\d,]+)x$"); - private static final Pattern BAZAAR_FILLED_PATTERN = Pattern.compile("^Filled: ([\\d,k]+)/(?:[\\d,k]+) \\(?([\\d.]+)%[)!]$"); + private static final Pattern BAZAAR_FILLED_PATTERN = Pattern.compile("^Filled: ([\\d,.k]+)/(?:[\\d,.k]+) \\(?([\\d.]+)%[)!]$"); List<BestiaryEntry> bestiaryOverview = null; private final NumberFormat numberFormatter; private final Cowlection main; @@ -184,7 +184,7 @@ public class SkyBlockListener { IInventory inventory = chestContainer.getLowerChestInventory(); String inventoryName = (inventory.hasCustomName() ? EnumChatFormatting.getTextWithoutFormattingCodes(inventory.getDisplayName().getUnformattedTextForChat()) : inventory.getName()); - if (inventoryName.endsWith("➜ Graphs")) { + if (inventoryName.contains("➜ G")) { // bazaar interface with graphs drawGraph = true; } diff --git a/src/main/java/de/cowtipper/cowlection/util/Utils.java b/src/main/java/de/cowtipper/cowlection/util/Utils.java index f7baba2..35b1231 100644 --- a/src/main/java/de/cowtipper/cowlection/util/Utils.java +++ b/src/main/java/de/cowtipper/cowlection/util/Utils.java @@ -320,9 +320,13 @@ public final class Utils { reforge = reforge.substring(0, modifierSuffix); } int reforgeInItemName = originalItemName.indexOf(reforge); - if (reforgeInItemName == -1 && reforge.equals("Light") && extraAttributes.getString("id").startsWith("HEAVY_")) { + String sbId = extraAttributes.getString("id"); + if (reforgeInItemName == -1 && reforge.equals("Light") && sbId.startsWith("HEAVY_")) { // special case: heavy armor with light reforge reforgeInItemName = originalItemName.indexOf("Heavy"); + } else if (reforgeInItemName > 10 && reforge.equals("Heavy") && sbId.startsWith("SUPER_HEAVY_")) { + // special case: super heavy armor with heavy reforge + reforgeInItemName = originalItemName.indexOf("Super Heavy"); } if (reforgeInItemName > 0 && !originalItemName.contains(EnumChatFormatting.STRIKETHROUGH.toString())) { @@ -331,16 +335,18 @@ public final class Utils { int reforgeLength = reforge.length(); String reforgePrefix = null; // special cases for reforge + item name - if (reforge.equals("Heavy") && extraAttributes.getString("id").startsWith("HEAVY_")) { + if (reforge.equals("Heavy") && sbId.startsWith("HEAVY_")) { reforgePrefix = "Extremely "; - } else if (reforge.equals("Light") && extraAttributes.getString("id").startsWith("HEAVY_")) { + } else if (reforge.equals("Light") && sbId.startsWith("HEAVY_")) { reforgePrefix = "Not So "; - } else if ((reforge.equals("Wise") && extraAttributes.getString("id").startsWith("WISE_DRAGON_")) - || (reforge.equals("Strong") && extraAttributes.getString("id").startsWith("STRONG_DRAGON_"))) { + } else if (reforge.equals("Heavy") && sbId.startsWith("SUPER_HEAVY_")) { + reforgePrefix = "Thicc "; + } else if ((reforge.equals("Wise") && sbId.startsWith("WISE_DRAGON_")) + || (reforge.equals("Strong") && sbId.startsWith("STRONG_DRAGON_"))) { reforgePrefix = "Very "; - } else if (reforge.equals("Superior") && extraAttributes.getString("id").startsWith("SUPERIOR_DRAGON_")) { + } else if (reforge.equals("Superior") && sbId.startsWith("SUPERIOR_DRAGON_")) { reforgePrefix = "Highly "; - } else if (reforge.equals("Perfect") && extraAttributes.getString("id").startsWith("PERFECT_")) { + } else if (reforge.equals("Perfect") && sbId.startsWith("PERFECT_")) { reforgePrefix = "Absolutely "; } if (reforgePrefix != null) { |