aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorDoKM <mcazzyman@gmail.com>2021-08-15 15:57:42 +0200
committerDoKM <mcazzyman@gmail.com>2021-08-15 15:57:42 +0200
commitdfa28718b54de915bb823eea54313b40842c1ce9 (patch)
tree5f348fe4e778c3aadf8047fdec4484ba20749baf /src/main
parentfb08aa9689264222eeda0c0196d0554ff543ab4b (diff)
downloadNotEnoughUpdates-dfa28718b54de915bb823eea54313b40842c1ce9.tar.gz
NotEnoughUpdates-dfa28718b54de915bb823eea54313b40842c1ce9.tar.bz2
NotEnoughUpdates-dfa28718b54de915bb823eea54313b40842c1ce9.zip
Add Sba chroma support to neuec
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
index 4603b4c1..0933c1a7 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
@@ -51,6 +51,7 @@ import net.minecraftforge.client.ClientCommandHandler;
import net.minecraftforge.client.event.*;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import net.minecraftforge.event.world.WorldEvent;
+import net.minecraftforge.fml.common.Loader;
import net.minecraftforge.fml.common.eventhandler.EventPriority;
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
import net.minecraftforge.fml.common.gameevent.TickEvent;
@@ -1675,6 +1676,19 @@ public class NEUEventListener {
private boolean copied = false;
+ //just to try and optimize it a bit
+ private int sbaloaded = -1;
+ private boolean isSbaloaded(){
+ if(sbaloaded == -1){
+ if(Loader.isModLoaded("skyblockaddons")) {
+ sbaloaded = 1;
+ } else {
+ sbaloaded = 0;
+ }
+ }
+ return sbaloaded == 1;
+ }
+
@SubscribeEvent(priority = EventPriority.LOW)
public void onItemTooltipLow(ItemTooltipEvent event) {
if(!NotEnoughUpdates.INSTANCE.isOnSkyblock()) return;
@@ -1952,7 +1966,12 @@ public class NEUEventListener {
} catch(Exception e) { continue; }
if(comparatorI < 0) continue;
- if("0123456789abcdefz".indexOf(colourCode.charAt(0)) < 0) continue;
+ String regexText = "0123456789abcdefz";
+ if(isSbaloaded()) {
+ regexText = regexText + "Z";
+ }
+
+ if (regexText.indexOf(colourCode.charAt(0)) < 0) continue;
//item_lore = item_lore.replaceAll("\\u00A79("+lvl4Max+" IV)", EnumChatFormatting.DARK_PURPLE+"$1");
//9([a-zA-Z ]+?) ([0-9]+|(I|II|III|IV|V|VI|VII|VIII|IX|X))(,|$)