aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/io
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/io')
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java15
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java77
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java8
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java4
-rw-r--r--src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java11
5 files changed, 65 insertions, 50 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
index 716c62c1..212bb8a4 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java
@@ -19,10 +19,7 @@ import io.github.moulberry.notenoughupdates.overlays.*;
import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer;
import io.github.moulberry.notenoughupdates.util.*;
import net.minecraft.client.Minecraft;
-import net.minecraft.client.gui.FontRenderer;
-import net.minecraft.client.gui.Gui;
-import net.minecraft.client.gui.GuiScreen;
-import net.minecraft.client.gui.ScaledResolution;
+import net.minecraft.client.gui.*;
import net.minecraft.client.gui.inventory.GuiChest;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.gui.inventory.GuiEditSign;
@@ -206,7 +203,9 @@ public class NEUEventListener {
@SubscribeEvent
public void onTick(TickEvent.ClientTickEvent event) {
- Keyboard.enableRepeatEvents(false);
+ if(Minecraft.getMinecraft().currentScreen == null || !(Minecraft.getMinecraft().currentScreen instanceof GuiChat)) {
+ Keyboard.enableRepeatEvents(false);
+ }
if(event.phase != TickEvent.Phase.START) return;
if(Minecraft.getMinecraft().theWorld == null) return;
if(Minecraft.getMinecraft().thePlayer == null) return;
@@ -2406,7 +2405,7 @@ public class NEUEventListener {
}
//7 is just a random number i chose, prob no pets with less lines than 7
if (event.toolTip.size() > 7) {
- if (Utils.cleanColour(event.toolTip.get(1)).matches("((Farming)|(Combat)|(Fishing)|(Mining)|(Foraging)|(Enchanting)|(Alchemy)) ((Mount)|(Pet)|(Morph)).*")) {
+ if (Utils.cleanColour(event.toolTip.get(1)).matches(petToolTipRegex)) {
GuiProfileViewer.PetLevel petlevel = null;
@@ -2442,12 +2441,14 @@ public class NEUEventListener {
}
return tooltipText;
}
+
+ private static final String petToolTipRegex = "((Farming)|(Combat)|(Fishing)|(Mining)|(Foraging)|(Enchanting)|(Alchemy)) ((Mount)|(Pet)|(Morph)).*";
private void petToolTipXPExtendPetMenu(ItemTooltipEvent event) {
if (NotEnoughUpdates.INSTANCE.config.tooltipTweaks.petExtendExp) {
//7 is just a random number i chose, prob no pets with less lines than 7
if (event.toolTip.size() > 7) {
- if (Utils.cleanColour(event.toolTip.get(1)).matches("((Farming)|(Combat)|(Fishing)|(Mining)|(Foraging)|(Enchanting)|(Alchemy)) ((Mount)|(Pet)).*")) {
+ if (Utils.cleanColour(event.toolTip.get(1)).matches(petToolTipRegex)) {
GuiProfileViewer.PetLevel petlevel = null;
int xpLine = -1;
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java
index 75a63644..66fb5637 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java
@@ -67,47 +67,52 @@ public class CapeManager {
}
public CapeData[] capes = new CapeData[]{
- //Content Creator
- new CapeData("jakethybro", false, true),
- new CapeData("krusty", false, true),
- new CapeData("krusty_day", false, true),
- new CapeData("krusty_sunset", false, true),
- new CapeData("krusty_night", false, true),
- new CapeData("zera", false, true),
- new CapeData("soldier", false, true),
- new CapeData("alexxoffi", false, true),
-
- //Patreon
- new CapeData("patreon1", false, false),
- new CapeData("patreon2", false, false),
- new CapeData("fade", false, false),
- new CapeData("space", false, false),
- new CapeData("mcworld", false, false),
- new CapeData("negative", false, false),
- new CapeData("void", false, false),
- new CapeData("lava", false, false),
- new CapeData("tunnel", false, false),
- new CapeData("planets", false, false),
//Admins
- new CapeData("nullzee", true, false),
- new CapeData("ironmoon", true, false),
- new CapeData("gravy", true, false),
+ new CapeData("nullzee", true, false),
+ new CapeData("ironmoon", true, false),
+ new CapeData("gravy", true, false),
+
+ //Special Other
+ new CapeData("contrib", true, false),
+ new CapeData("mbstaff", true, false),
//Partner
- new CapeData("thebakery", true, false),
- new CapeData("furf", true, false),
- new CapeData("dsm", true, false),
- new CapeData("skyclient", true, false),
- new CapeData("subreddit_dark", true, false),
- new CapeData("subreddit_light", true, false),
- new CapeData("packshq", true, false),
- new CapeData("skytils", true, false),
- new CapeData("sbp", true, false),
+ new CapeData("thebakery", true, false),
+ new CapeData("furf", true, false),
+ new CapeData("dsm", true, false),
+ new CapeData("skyclient", true, false),
+ new CapeData("subreddit_dark", true, false),
+ new CapeData("subreddit_light", true, false),
+ new CapeData("packshq", true, false),
+ new CapeData("skytils", true, false),
+ new CapeData("sbp", true, false),
+
+ //Content Creator
+ new CapeData("jakethybro", false, true),
+ new CapeData("krusty", false, true),
+ new CapeData("krusty_day", false, true),
+ new CapeData("krusty_sunset", false, true),
+ new CapeData("krusty_night", false, true),
+ new CapeData("zera", false, true),
+ new CapeData("soldier", false, true),
+ new CapeData("alexxoffi", false, true),
+ new CapeData("secondpfirsisch", false, true),
+ new CapeData("stormy_lh", false, true),
+
+ //Patreon
+ new CapeData("patreon1", false, false),
+ new CapeData("patreon2", false, false),
+ new CapeData("fade", false, false),
+ new CapeData("space", false, false),
+ new CapeData("mcworld", false, false),
+ new CapeData("negative", false, false),
+ new CapeData("void", false, false),
+ new CapeData("lava", false, false),
+ new CapeData("tunnel", false, false),
+ new CapeData("planets", false, false)
+
- //Special Other
- new CapeData("contrib", true, false),
- new CapeData("mbstaff", true, false)
};
/*private String[] capes = new String[]{"patreon1", "patreon2", "fade", "contrib", "nullzee",
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java
index a73320fc..aafcfb4d 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java
@@ -18,7 +18,7 @@ public class DamageCommas {
private static final WeakHashMap<EntityLivingBase, ChatComponentText> replacementMap = new WeakHashMap<>();
- private static final EnumChatFormatting[] colours = {EnumChatFormatting.RED, EnumChatFormatting.GOLD, EnumChatFormatting.YELLOW, EnumChatFormatting.WHITE};
+ private static final EnumChatFormatting[] coloursHypixel = {EnumChatFormatting.WHITE, EnumChatFormatting.YELLOW, EnumChatFormatting.GOLD, EnumChatFormatting.RED, EnumChatFormatting.RED, EnumChatFormatting.WHITE};
private static final char STAR = '\u2727';
private static final Pattern PATTERN_CRIT = Pattern.compile("\u00a7f"+STAR+"((?:\u00a7.\\d)+)\u00a7."+STAR+"(.*)");
@@ -81,7 +81,11 @@ public class DamageCommas {
int colourIndex = 0;
for(char c : newFormatted.toString().toCharArray()) {
- newFormattedCrit.append(colours[colourIndex++ % colours.length]);
+ if(c == ',') {
+ newFormattedCrit.append(EnumChatFormatting.GRAY);
+ } else {
+ newFormattedCrit.append(coloursHypixel[colourIndex++ % coloursHypixel.length]);
+ }
newFormattedCrit.append(c);
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java
index e18c28be..7a37c0ce 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java
@@ -123,6 +123,10 @@ public class ItemCooldowns {
if(lastChar >= '0' && lastChar <= '9') {
return true;
}
+ } else if(internalname.equals("DIVAN_DRILL")){
+ return true;
+ } else if(internalname.equals("GEMSTONE_GAUNTLET")){
+ return true;
}
return false;
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
index c5bfc057..a2f78e22 100644
--- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
+++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java
@@ -1910,14 +1910,15 @@ public class GuiProfileViewer extends GuiScreen {
}
- public int countItemsInInventory(String internalname, JsonObject inventoryInfo, String... invsToSearch) {
+ public int countItemsInInventory(String internalname, JsonObject inventoryInfo, boolean specific, String... invsToSearch) {
int count = 0;
for(String inv : invsToSearch) {
JsonArray invItems = inventoryInfo.get(inv).getAsJsonArray();
for(int i=0; i<invItems.size(); i++) {
if(invItems.get(i) == null || !invItems.get(i).isJsonObject()) continue;
JsonObject item = invItems.get(i).getAsJsonObject();
- if(item.get("internalname").getAsString().equals(internalname)) {
+ if((specific && item.get("internalname").getAsString().equals(internalname)) ||
+ (!specific && item.get("internalname").getAsString().contains(internalname))) {
if(item.has("count")) {
count += item.get("count").getAsInt();
} else {
@@ -2276,13 +2277,13 @@ public class GuiProfileViewer extends GuiScreen {
}
if(arrowCount == -1) {
- arrowCount = countItemsInInventory("ARROW", inventoryInfo, "quiver");
+ arrowCount = countItemsInInventory("ARROW", inventoryInfo, false,"quiver");
}
if(greenCandyCount == -1) {
- greenCandyCount = countItemsInInventory("GREEN_CANDY", inventoryInfo, "candy_inventory_contents");
+ greenCandyCount = countItemsInInventory("GREEN_CANDY", inventoryInfo, true,"candy_inventory_contents");
}
if(purpleCandyCount == -1) {
- purpleCandyCount = countItemsInInventory("PURPLE_CANDY", inventoryInfo, "candy_inventory_contents");
+ purpleCandyCount = countItemsInInventory("PURPLE_CANDY", inventoryInfo, true, "candy_inventory_contents");
}
Utils.drawItemStackWithText(NotEnoughUpdates.INSTANCE.manager.jsonToStack(