diff options
Diffstat (limited to 'src')
25 files changed, 839 insertions, 31 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index 6ba3c244..09505c52 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -68,6 +68,7 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.regex.Matcher; import java.util.regex.Pattern; +import static io.github.moulberry.notenoughupdates.overlays.SlayerOverlay.*; import static io.github.moulberry.notenoughupdates.util.GuiTextures.dungeon_chest_worth; public class NEUEventListener { @@ -171,6 +172,7 @@ public class NEUEventListener { private static boolean showNotificationOverInv = false; private static final Pattern BAD_ITEM_REGEX = Pattern.compile("x[0-9]{1,2}$"); + private static final Pattern SLAYER_XP = Pattern.compile(" (Spider|Zombie|Wolf|Enderman) Slayer LVL (\\d) - (?:Next LVL in ([\\d,]+) XP!|LVL MAXED OUT!)"); /** * 1)Will send the cached message from #sendChatMessage when at least 200ms has passed since the last message. @@ -830,6 +832,7 @@ public class NEUEventListener { String r = null; String unformatted = Utils.cleanColour(e.message.getUnformattedText()); + Matcher matcher = SLAYER_XP.matcher(unformatted); if (unformatted.startsWith("You are playing on profile: ")) { neu.manager.setCurrentProfile(unformatted.substring("You are playing on profile: ".length()).split(" ")[0].trim()); } else if (unformatted.startsWith("Your profile was changed to: ")) {//Your profile was changed to: @@ -846,6 +849,29 @@ public class NEUEventListener { } else if (e.message.getFormattedText().startsWith(EnumChatFormatting.RESET.toString() + EnumChatFormatting.RED + "Invalid recipe ")) { r = ""; + } else if (unformatted.equals(" NICE! SLAYER BOSS SLAIN!")) { + SlayerOverlay.isSlain = true; + } else if (unformatted.equals(" SLAYER QUEST STARTED!")) { + SlayerOverlay.isSlain = false; + if (timeSinceLastBoss == 0) { + SlayerOverlay.timeSinceLastBoss = System.currentTimeMillis(); + } else { + timeSinceLastBoss2 = timeSinceLastBoss; + timeSinceLastBoss = System.currentTimeMillis(); + } + } else if (unformatted.startsWith(" RNGesus Meter:")) { + RNGMeter = unformatted.substring(" RNGesus Meter: -------------------- ".length()); + } else if (matcher.matches()) { + //matcher.group(1); + SlayerOverlay.slayerLVL = matcher.group(2); + if (!SlayerOverlay.slayerLVL.equals("9")) { + SlayerOverlay.slayerXp = matcher.group(3); + } else { + slayerXp = "maxed"; + } + } else if (unformatted.startsWith("Sending to server") || (unformatted.startsWith("Your Slayer Quest has been cancelled!"))) { + SlayerOverlay.slayerQuest = false; + SlayerOverlay.unloadOverlayTimer = System.currentTimeMillis(); } if (e.message.getFormattedText().contains(EnumChatFormatting.YELLOW + "Visit the Auction House to collect your item!")) { if (NotEnoughUpdates.INSTANCE.manager.auctionManager.customAH.latestBid != null && diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index ef2c14b9..d943d135 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -96,6 +96,7 @@ public class NEUOverlay extends Gui { //Various constants used for GUI structure private final int searchBarYOffset = 10; private final int searchBarPadding = 2; + private long lastSearchMode = 0; private float oldWidthMult = 0; @@ -197,6 +198,7 @@ public class NEUOverlay extends Gui { } else { if (System.currentTimeMillis() - millisLastLeftClick < 300) { searchMode = !searchMode; + lastSearchMode = System.currentTimeMillis(); if (searchMode && NotEnoughUpdates.INSTANCE.config.hidden.firstTimeSearchFocus) { NEUEventListener.displayNotification(Lists.newArrayList( "\u00a7eSearch Highlight", @@ -205,13 +207,16 @@ public class NEUOverlay extends Gui { "\u00a77This allows you easily find items as the item will stand out.", "\u00a77To toggle this please double click on the search bar in your inventory.", "\u00a77", - "\u00a77Press X on your keyboard to close this notifcation"), true, true); + "\u00a77Press X on your keyboard to close this notification"), true, true); NotEnoughUpdates.INSTANCE.config.hidden.firstTimeSearchFocus = false; } } textField.setCursorPosition(getClickedIndex(mouseX, mouseY)); millisLastLeftClick = System.currentTimeMillis(); + if (searchMode) { + lastSearchMode = System.currentTimeMillis(); + } } } } @@ -2041,6 +2046,11 @@ public class NEUOverlay extends Gui { GlStateManager.disableLighting(); Utils.pushGuiScale(-1); + + if (System.currentTimeMillis() - lastSearchMode > 120000 && NotEnoughUpdates.INSTANCE.config.toolbar.autoTurnOffSearchMode + || !NotEnoughUpdates.INSTANCE.config.toolbar.searchBar) { + searchMode = false; + } } /** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java index 7d1ef905..3be881ac 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java @@ -716,7 +716,7 @@ public class Commands { "Ok, this is actually the last message, use the command again and you'll crash I promise"}; private int devFailIndex = 0; - private static final List<String> devTestUsers = new ArrayList<>(Arrays.asList("moulberry", "lucycoconut", "ironm00n", "ariyio")); + private static final List<String> devTestUsers = new ArrayList<>(Arrays.asList("moulberry", "lucycoconut", "ironm00n", "ariyio", "throwpo")); SimpleCommand devTestCommand = new SimpleCommand("neudevtest", new SimpleCommand.ProcessCommandRunnable() { @Override public void processCommand(ICommandSender sender, String[] args) { @@ -767,6 +767,11 @@ public class Commands { NotEnoughUpdates.INSTANCE.saveConfig(); return; } + if (args.length == 1 && args[0].equalsIgnoreCase("searchmode")) { + NotEnoughUpdates.INSTANCE.config.hidden.firstTimeSearchFocus = true; + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.AQUA + "I would never search")); + return; + } if (args.length == 1 && args[0].equalsIgnoreCase("center")) { double x = Math.floor(Minecraft.getMinecraft().thePlayer.posX) + 0.5f; double z = Math.floor(Minecraft.getMinecraft().thePlayer.posZ) + 0.5f; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java index e0743162..3888e3ea 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/StatsCommand.java @@ -34,12 +34,18 @@ public class StatsCommand extends ClientCommandBase { super("neustats"); } + private static int activeModCount = Loader.instance().getActiveModList().size(); + @Override public void processCommand(ICommandSender sender, String[] args) { if (args.length > 0) { switch (args[0].toLowerCase(Locale.ROOT)) { case "modlist": - clipboardAndSendMessage(createModList(new DiscordMarkdownBuilder()).toString()); + if (activeModCount > 15) { + clipboardAndSendMessage(createModList(new DiscordMarkdownBuilder()).toString()); + } else { + clipboardAndSendMessage(createStats()); + } break; case "dump": modPrefixedMessage(EnumChatFormatting.GREEN + "This will upload a dump of the java classes your game has loaded how big they are and how many there are. This can take a few seconds as it is uploading to HasteBin."); @@ -95,7 +101,6 @@ public class StatsCommand extends ClientCommandBase { long totalMemory = Runtime.getRuntime().totalMemory(); long freeMemory = Runtime.getRuntime().freeMemory(); long currentMemory = totalMemory - freeMemory; - int activeModCount = Loader.instance().getActiveModList().size(); builder.category("System Stats"); builder.append("OS", System.getProperty("os.name")); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java index 8e712012..94e308a1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java @@ -355,8 +355,13 @@ public class FishingHelper { Minecraft.getMinecraft().thePlayer.fishEntity != null && Minecraft.getMinecraft().thePlayer.fishEntity.getEntityId() == hookEntityId && chain.particleNum > 3) { - - if (newDistance <= 0.2f + 0.1f * pingDelayTicks && NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) { + float lavaOffset = 0.1f; + if (particleType == EnumParticleTypes.SMOKE_NORMAL) { + lavaOffset = 0.03f; + } else if (particleType == EnumParticleTypes.WATER_WAKE) { + lavaOffset = 0.1f; + } + if (newDistance <= 0.2f + lavaOffset * pingDelayTicks && NotEnoughUpdates.INSTANCE.config.fishing.incomingFishWarningR) { if (NotEnoughUpdates.INSTANCE.config.fishing.incomingFishHookedSounds && hookedWarningStateTicks <= 0) { float vol = NotEnoughUpdates.INSTANCE.config.fishing.incomingFishHookedSoundsVol / 100f; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/NPCRetexturing.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/NPCRetexturing.java index 9180cca6..19dca439 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/NPCRetexturing.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/NPCRetexturing.java @@ -43,7 +43,7 @@ public class NPCRetexturing implements IResourceManagerReloadListener { public Skin getSkin(AbstractClientPlayer player) { if (gettingSkin) return null; - if (player.getUniqueID().version() == 4) return null; + if (player.getUniqueID().version() == 4 && !NotEnoughUpdates.INSTANCE.config.hidden.npcRetextureOnSelf) return null; if (skinOverrideCache.containsKey(player)) { return skinOverrideCache.get(player); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java index 0415c629..955fbbbd 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java @@ -764,6 +764,9 @@ public class PetInfoOverlay extends TextOverlay { foundDespawn = true; break; } + if (line.equals("\u00a77\u00a77Selected pet: \u00a7cNone")){ + clearPet(); + } } if (!foundDespawn && config.selectedPet == petIndex && currentTime - lastPetSelect > 500) { clearPet(); @@ -1140,9 +1143,8 @@ public class PetInfoOverlay extends TextOverlay { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "[NEU] Can't find pet \u00a7" + petStringMatch + EnumChatFormatting.RED + " try revisiting all pages of /pets.")); } - } else if (chatMessage.toLowerCase().startsWith("you despawned your")) { - clearPet(); - } else if (chatMessage.toLowerCase().contains("switching to profile")) { + } else if ((chatMessage.toLowerCase().startsWith("you despawned your")) || (chatMessage.toLowerCase().contains("switching to profile")) + || (chatMessage.toLowerCase().contains("transferring you to a new island..."))) { clearPet(); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java index 218076a5..4510c675 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java @@ -586,9 +586,9 @@ public class GuiCustomEnchant extends Gui { Utils.drawTexturedRect(guiLeft + 295, guiTop + 147, 16, 16, 0, 16 / 512f, 387 / 512f, (387 + 16) / 512f, GL11.GL_NEAREST); //Incompatible Settings Button - float incompatibleMinU = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.incompatibleEnchants * 16 / 512f; + /*float incompatibleMinU = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.incompatibleEnchants * 16 / 512f; Utils.drawTexturedRect(guiLeft + 295 + 18, guiTop + 147, 16, 16, - incompatibleMinU, incompatibleMinU + 16 / 512f, 403 / 512f, (403 + 16) / 512f, GL11.GL_NEAREST); + incompatibleMinU, incompatibleMinU + 16 / 512f, 403 / 512f, (403 + 16) / 512f, GL11.GL_NEAREST);*/ //Sorting Settings Button float sortingMinU = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enchantSorting * 16 / 512f; Utils.drawTexturedRect(guiLeft + 295, guiTop + 147 + 18, 16, 16, @@ -606,7 +606,7 @@ public class GuiCustomEnchant extends Gui { Gui.drawRect(guiLeft + 295, guiTop + 147, guiLeft + 295 + 16, guiTop + 147 + 16, 0x80ffffff); tooltipToDisplay = createTooltip("Enable GUI", 0, "On", "Off"); break; - case 1: + /*case 1: Gui.drawRect(guiLeft + 295 + 18, guiTop + 147, guiLeft + 295 + 16 + 18, guiTop + 147 + 16, 0x80ffffff); tooltipToDisplay = createTooltip("Incompatible Enchants", NotEnoughUpdates.INSTANCE.config.enchantingSolvers.incompatibleEnchants, @@ -614,7 +614,7 @@ public class GuiCustomEnchant extends Gui { tooltipToDisplay.add(1, EnumChatFormatting.GRAY + "How to display enchants that are"); tooltipToDisplay.add(2, EnumChatFormatting.GRAY + "incompatible with your current item,"); tooltipToDisplay.add(3, EnumChatFormatting.GRAY + "eg. Smite on a sword with Sharpness"); - break; + break;*/ case 2: Gui.drawRect(guiLeft + 295, guiTop + 147 + 18, guiLeft + 295 + 16, guiTop + 147 + 16 + 18, 0x80ffffff); tooltipToDisplay = createTooltip("Sort enchants...", @@ -1435,14 +1435,14 @@ public class GuiCustomEnchant extends Gui { NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI = false; break; } - case 1: { + /*case 1: { int val = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.incompatibleEnchants; val += direction; if (val < 0) val = 1; if (val > 1) val = 0; NotEnoughUpdates.INSTANCE.config.enchantingSolvers.incompatibleEnchants = val; break; - } + }*/ case 2: { int val = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enchantSorting; val += direction; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java index 87084199..e1280bb9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java @@ -14,6 +14,7 @@ import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import org.lwjgl.input.Keyboard; @@ -85,6 +86,9 @@ public class GuiEnchantColour extends GuiScreen { return enchantNamesPretty; } + private ItemStack maxedBook; + private int maxedBookFound =0; + private List<String> getEnchantColours() { return NotEnoughUpdates.INSTANCE.config.hidden.enchantColours; } @@ -192,8 +196,30 @@ public class GuiEnchantColour extends GuiScreen { GlStateManager.color(1, 1, 1, 1); Minecraft.getMinecraft().getTextureManager().bindTexture(help); Utils.drawTexturedRect(guiLeft + xSize + 3, guiTopSidebar - 18, 16, 16, GL11.GL_NEAREST); + if(maxedBookFound == 0){ + try { + if (NotEnoughUpdates.INSTANCE.manager.jsonToStack( + NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("MAXED_ENCHANT_BOOK")).hasDisplayName()) { + maxedBook = NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("MAXED_ENCHANT_BOOK")); + maxedBookFound = 1; + } else { + maxedBookFound = 2; + } + + } catch(Exception ignored){ + maxedBookFound = 2; + } + } + if (maxedBookFound == 1){ + Utils.drawItemStack(maxedBook, guiLeft + xSize +3, guiTopSidebar - 34); + } if (mouseX >= guiLeft + xSize + 3 && mouseX < guiLeft + xSize + 19) { + if(mouseY >= guiTopSidebar - 34 && mouseY <= guiTopSidebar - 18 && maxedBookFound == 1){ + tooltipToDisplay = maxedBook.getTooltip(Minecraft.getMinecraft().thePlayer, false); + Utils.drawHoveringText(tooltipToDisplay, mouseX, mouseY, width, height, -1, fr); + tooltipToDisplay = null; + } if (mouseY >= guiTopSidebar - 18 && mouseY <= guiTopSidebar - 2) { tooltipToDisplay = Lists.newArrayList( EnumChatFormatting.AQUA+"NEUEC Colouring Guide", 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 7087961c..8dce4cc1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java @@ -101,6 +101,13 @@ public class NEUConfig extends Config { return; case 17: ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/neusouls unclear"); + return; + case 18: + editOverlay(activeConfigCategory, OverlayManager.slayerOverlay, slayerOverlay.slayerPosition); + return; + case 19: + editOverlay(activeConfigCategory, OverlayManager.combatSkillOverlay, skillOverlays.combatPosition); + } } @@ -183,6 +190,13 @@ public class NEUConfig extends Config { @Expose @Category( + name = "Slayer Overlay", + desc = "Slayer Overlay" + ) + public SlayerOverlay slayerOverlay = new SlayerOverlay(); + + @Expose + @Category( name = "Storage GUI", desc = "Storage GUI" ) @@ -331,6 +345,10 @@ public class NEUConfig extends Config { @Expose public boolean disableBrokenCapes = false; + //Ery wanted to texture himself because its ery + @Expose + public boolean npcRetextureOnSelf = false; + } public static ArrayList<String> createDefaultEnchantColours() { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Enchanting.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Enchanting.java index 6666302e..16288f21 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Enchanting.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Enchanting.java @@ -20,7 +20,7 @@ public class Enchanting { @ConfigAccordionId(id = 1) public boolean enableTableGUI = true; - @Expose + /*@Expose @ConfigOption( name = "Incompatible Enchants", desc = "How to display enchants that are incompatible with your current item, eg. Smite on a sword with Sharpness" @@ -29,7 +29,7 @@ public class Enchanting { values = {"Highlight", "Hide"} ) @ConfigAccordionId(id = 1) - public int incompatibleEnchants = 0; + public int incompatibleEnchants = 0;*/ @Expose @ConfigOption( @@ -68,7 +68,8 @@ public class Enchanting { @ConfigEditorBoolean @ConfigAccordionId(id = 0) public boolean enableEnchantingSolvers = true; - + //In an email from Donpireso (admin) he says not sending a packet at all isn't bannable + //https://cdn.discordapp.com/attachments/823769568933576764/906101631861526559/unknown.png @Expose @ConfigOption( name = "Prevent Misclicks", diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/LocationEdit.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/LocationEdit.java index edd0ad46..1fe90985 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/LocationEdit.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/LocationEdit.java @@ -135,4 +135,26 @@ public class LocationEdit { ) public Position fishingPosition = new Position(10, 200); + @Expose + @ConfigOption( + name = "Slayer Position", + desc = "Change the position of the Slayer overlay" + ) + @ConfigEditorButton( + runnableId = 18, + buttonText = "Edit" + ) + public Position slayerPosition = new Position(10, 200); + + @Expose + @ConfigOption( + name = "Combat Position", + desc = "Change the position of the Combat overlay" + ) + @ConfigEditorButton( + runnableId = 19, + buttonText = "Edit" + ) + public Position combatPosition = new Position(10, 200); + } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SkillOverlays.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SkillOverlays.java index d9278280..cc419380 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SkillOverlays.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SkillOverlays.java @@ -236,4 +236,81 @@ public class SkillOverlays { )
@ConfigAccordionId(id = 3)
public int customFishTimer = 300;
+
+ @ConfigOption(
+ name = "Combat",
+ desc = ""
+ )
+ @ConfigEditorAccordion(id = 4)
+ public boolean combatAccordion = false;
+
+ @Expose
+ @ConfigOption(
+ name = "\u00A7cWarning",
+ desc = "The combat display will only show if you have a Book of Stats on the item you are using"
+ )
+ @ConfigEditorFSR(
+ runnableId = 12,
+ buttonText = ""
+ )
+ @ConfigAccordionId(id = 4)
+ public boolean combatInfo = false;
+
+ @Expose
+ @ConfigOption(
+ name = "Enable Combat Overlay",
+ desc = "Show an overlay while Combat with useful information"
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 4)
+ public boolean combatSkillOverlay = true;
+
+ @Expose
+ @ConfigOption(
+ name = "Combat Text",
+ desc = "\u00a7eDrag text to change the appearance of the overlay\n" +
+ "\u00a7rHold an item with Book of Stats to show the display"
+ )
+ @ConfigEditorDraggableList(
+ exampleText = {"\u00a7bKills: \u00a7e547,860",
+ "\u00a7bCombat: \u00a7e12\u00a77 [\u00a7e|||||||||||||||||\u00a78||||||||\u00a77] \u00a7e67%",
+ "\u00a7bCurrent XP: \u00a7e6,734",
+ "\u00a7bRemaining XP: \u00a7e3,265",
+ "\u00a7bXP/h: \u00a7e238,129",
+ "\u00a7bETA: \u00a7e13h12m"}
+ )
+ @ConfigAccordionId(id = 4)
+ public List<Integer> combatText = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5));
+
+ @Expose
+ @ConfigOption(
+ name = "Combat Position",
+ desc = "Change the position of the Combat overlay"
+ )
+ @ConfigEditorButton(
+ runnableId = 19,
+ buttonText = "Edit"
+ )
+ @ConfigAccordionId(id = 4)
+ public Position combatPosition = new Position(10, 200);
+
+ @Expose
+ @ConfigOption(
+ name = "Combat Style",
+ desc = "Change the style of the Combat overlay"
+ )
+ @ConfigEditorDropdown(
+ values = {"Background", "No Shadow", "Shadow", "Full Shadow"}
+ )
+ @ConfigAccordionId(id = 4)
+ public int combatStyle = 0;
+
+ @Expose
+ @ConfigOption(
+ name = "Always show combat overlay",
+ desc = "Shows combat overlay even if you dont have Book of Stats"
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 4)
+ public boolean alwaysShowCombatOverlay = false;
}
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SlayerOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SlayerOverlay.java new file mode 100644 index 00000000..8ea34c52 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/SlayerOverlay.java @@ -0,0 +1,68 @@ +package io.github.moulberry.notenoughupdates.options.seperateSections; + +import com.google.gson.annotations.Expose; +import io.github.moulberry.notenoughupdates.core.config.Position; +import io.github.moulberry.notenoughupdates.core.config.annotations.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +public class SlayerOverlay { + + @Expose + @ConfigOption( + name = "\u00A7cWarning", + desc = "You may have to do 2 bosses before everything shows" + ) + @ConfigEditorFSR( + runnableId = 12 + ) + public boolean slayerWarning = false; + + @Expose + @ConfigOption( + name = "Slayer Overlay", + desc = "Toggles the slayer overlay" + ) + @ConfigEditorBoolean + public boolean slayerOverlay = false; + + @Expose + @ConfigOption( + name = "Slayer Text", + desc = "\u00a7eDrag text to change the appearance of the overlay" + ) + @ConfigEditorDraggableList( + exampleText = {"\u00a7eSlayer: \u00a74Sven", + "\u00a7eRNG Meter: \u00a75100%", + "\u00a7eLvl: \u00a7d7", + "\u00a7eKill time: \u00a7c1:30", + "\u00a7eXP: \u00a7d75,450/100,000", + "\u00a7eBosses till next Lvl: \u00a7d17", + "\u00a7eAverage kill time: \u00a7c3:20" + } + ) + public List<Integer> slayerText = new ArrayList<>(Arrays.asList(0, 1, 4, 5, 3, 6)); + + @Expose + @ConfigOption( + name = "Slayer Position", + desc = "Change the position of the Slayer overlay" + ) + @ConfigEditorButton( + runnableId = 18, + buttonText = "Edit" + ) + public Position slayerPosition = new Position(10, 200); + + @Expose + @ConfigOption( + name = "Slayer Style", + desc = "Change the style of the Slayer overlay" + ) + @ConfigEditorDropdown( + values = {"Background", "No Shadow", "Shadow", "Full Shadow"} + ) + public int slayerStyle = 0; +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java index 6f5865ed..734c517c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Toolbar.java @@ -74,6 +74,15 @@ public class Toolbar { @Expose
@ConfigOption(
+ name = "Auto turnoff search mode",
+ desc = "Turns off the inventory search mode after 2 minutes"
+ )
+ @ConfigEditorBoolean
+ @ConfigAccordionId(id = 0)
+ public boolean autoTurnOffSearchMode = true;
+
+ @Expose
+ @ConfigOption(
name = "Show Quick Commands",
desc = "Show QuickCommands\u2122 in the NEU toolbar"
)
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java new file mode 100644 index 00000000..36d3e17a --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java @@ -0,0 +1,246 @@ +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.core.util.lerp.LerpUtils; +import io.github.moulberry.notenoughupdates.util.Utils; +import io.github.moulberry.notenoughupdates.util.XPInformation; +import net.minecraft.client.Minecraft; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.util.EnumChatFormatting; + +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedList; +import java.util.List; +import java.util.function.Supplier; + +public class CombatSkillOverlay extends TextOverlay { //Im sure there is a much better way to do this besides making another class ¯\_(ツ)_/¯ + + private long lastUpdate = -1; + private int killLast = -1; + private int kill = -1; + private LinkedList<Integer> killQueue = new LinkedList<>(); + + private XPInformation.SkillInfo skillInfo = null; + private XPInformation.SkillInfo skillInfoLast = null; + + private float lastTotalXp = -1; + private boolean isKilling = false; + private LinkedList<Float> xpGainQueue = new LinkedList<>(); + private float xpGainHourLast = -1; + private float xpGainHour = -1; + + private int xpGainTimer = 0; + + private String skillType = "Combat"; + + public CombatSkillOverlay(Position position, Supplier<List<String>> dummyStrings, Supplier<TextOverlayStyle> styleSupplier) { + super(position, dummyStrings, styleSupplier); + } + + private float interp(float now, float last) { + float interp = now; + if(last >= 0 && last != now) { + float factor = (System.currentTimeMillis()-lastUpdate)/1000f; + factor = LerpUtils.clampZeroOne(factor); + interp = last + (now - last) * factor; + } + return interp; + } + + @Override + public void update() { + if(!NotEnoughUpdates.INSTANCE.config.skillOverlays.combatSkillOverlay) { + kill = -1; + overlayStrings = null; + return; + } + + lastUpdate = System.currentTimeMillis(); + killLast = kill; + xpGainHourLast = xpGainHour; + kill = -1; + + if(Minecraft.getMinecraft().thePlayer == null) return; + + ItemStack stack = Minecraft.getMinecraft().thePlayer.getHeldItem(); + if(stack != null && stack.hasTagCompound()) { + NBTTagCompound tag = stack.getTagCompound(); + + if(tag.hasKey("ExtraAttributes", 10)) { + NBTTagCompound ea = tag.getCompoundTag("ExtraAttributes"); + + if(ea.hasKey("stats_book", 99)) { + kill = ea.getInteger("stats_book"); + killQueue.add(0, kill); + } + } + } + + String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); + + skillInfoLast = skillInfo; + skillInfo = XPInformation.getInstance().getSkillInfo(skillType); + if(skillInfo != null) { + float totalXp = skillInfo.totalXp; + + if(lastTotalXp > 0) { + float delta = totalXp - lastTotalXp; + + if(delta > 0 && delta < 1000) { + xpGainTimer = 3; + + xpGainQueue.add(0, delta); + while(xpGainQueue.size() > 30) { + xpGainQueue.removeLast(); + } + + float totalGain = 0; + for(float f : xpGainQueue) totalGain += f; + + xpGainHour = totalGain * (60 * 60) / xpGainQueue.size(); + + isKilling = true; + } else if(xpGainTimer > 0) { + xpGainTimer--; + + xpGainQueue.add(0, 0f); + while(xpGainQueue.size() > 30) { + xpGainQueue.removeLast(); + } + + float totalGain = 0; + for(float f : xpGainQueue) totalGain += f; + + xpGainHour = totalGain * (60 * 60) / xpGainQueue.size(); + + isKilling = true; + } else if(delta <= 0) { + isKilling = false; + } + } + + lastTotalXp = totalXp; + } + + while(killQueue.size() >= 4) { + killQueue.removeLast(); + } + + if(kill != -1) { + overlayStrings = new ArrayList<>(); + } else { + overlayStrings = null; + } + + } + + @Override + public void updateFrequent() { + super.updateFrequent(); + + if(kill < 0 && !NotEnoughUpdates.INSTANCE.config.skillOverlays.alwaysShowCombatOverlay) { + overlayStrings = null; + } else { + HashMap<Integer, String> lineMap = new HashMap<>(); + + overlayStrings = new ArrayList<>(); + + NumberFormat format = NumberFormat.getIntegerInstance(); + + if (kill >= 0) { + int counterInterp = (int) interp(kill, killLast); + + lineMap.put(0, EnumChatFormatting.AQUA + "Kills: " + EnumChatFormatting.YELLOW + format.format(counterInterp)); + } + + float xpInterp = xpGainHour; + if (xpGainHourLast == xpGainHour && xpGainHour <= 0) { + lineMap.put(4, EnumChatFormatting.AQUA + "XP/h: " + EnumChatFormatting.YELLOW + "N/A"); + } else { + xpInterp = interp(xpGainHour, xpGainHourLast); + + lineMap.put(4, EnumChatFormatting.AQUA + "XP/h: " + EnumChatFormatting.YELLOW + + format.format(xpInterp) + (isKilling ? "" : EnumChatFormatting.RED + " (PAUSED)")); + } + + if (skillInfo != null && skillInfo.level < 60) { + StringBuilder levelStr = new StringBuilder(EnumChatFormatting.AQUA + "Combat" + ": "); + + levelStr.append(EnumChatFormatting.YELLOW) + .append(skillInfo.level) + .append(EnumChatFormatting.GRAY) + .append(" ["); + + float progress = skillInfo.currentXp / skillInfo.currentXpMax; + if (skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + progress = interp(progress, skillInfoLast.currentXp / skillInfoLast.currentXpMax); + } + + float lines = 25; + for (int i = 0; i < lines; i++) { + if (i / lines < progress) { + levelStr.append(EnumChatFormatting.YELLOW); + } else { + levelStr.append(EnumChatFormatting.DARK_GRAY); + } + levelStr.append('|'); + } + + levelStr.append(EnumChatFormatting.GRAY) + .append("] ") + .append(EnumChatFormatting.YELLOW) + .append((int) (progress * 100)) + .append("%"); + + int current = (int) skillInfo.currentXp; + if (skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + current = (int) interp(current, skillInfoLast.currentXp); + } + + int remaining = (int) (skillInfo.currentXpMax - skillInfo.currentXp); + if (skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + remaining = (int) interp(remaining, (int) (skillInfoLast.currentXpMax - skillInfoLast.currentXp)); + } + + lineMap.put(1, levelStr.toString()); + lineMap.put(2, EnumChatFormatting.AQUA + "Current XP: " + EnumChatFormatting.YELLOW + format.format(current)); + if (remaining < 0) { + lineMap.put(3, EnumChatFormatting.AQUA + "Remaining XP: " + EnumChatFormatting.YELLOW + "MAXED!"); + lineMap.put(5, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + "MAXED!"); + } else { + lineMap.put(3, EnumChatFormatting.AQUA + "Remaining XP: " + EnumChatFormatting.YELLOW + format.format(remaining)); + if (xpGainHour < 1000) { + lineMap.put(5, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + "N/A"); + } else { + lineMap.put(5, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + Utils.prettyTime((long) (remaining) * 1000 * 60 * 60 / (long) xpInterp)); + } + } + + } + + if (skillInfo != null && skillInfo.level == 60) { + int current = (int) skillInfo.currentXp; + if (skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + current = (int) interp(current, skillInfoLast.currentXp); + } + + lineMap.put(1, EnumChatFormatting.AQUA + "Combat: " + EnumChatFormatting.YELLOW + "60 " + EnumChatFormatting.RED + "(Maxed)"); + lineMap.put(2, EnumChatFormatting.AQUA + "Current XP: " + EnumChatFormatting.YELLOW + format.format(current)); + + } + + for(int strIndex : NotEnoughUpdates.INSTANCE.config.skillOverlays.combatText) { + if(lineMap.get(strIndex) != null) { + overlayStrings.add(lineMap.get(strIndex)); + } + } + if(overlayStrings != null && overlayStrings.isEmpty()) overlayStrings = null; + } + } + + +}
\ No newline at end of file diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java index 84b5f716..acace238 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java @@ -282,10 +282,17 @@ public class MiningOverlay extends TextOverlay { if (name.contains("Mithril Powder:")) { mithrilPowder = DARK_AQUA + Utils.trimIgnoreColour(name).replaceAll("\u00a7[f|F|r]", ""); continue; + } else if (mithrilPowder == null) { + mithrilPowder = RED + "[NEU] Failed to get data from your tablist"; + continue; } + if (name.contains("Gemstone Powder:")) { gemstonePowder = DARK_AQUA + Utils.trimIgnoreColour(name).replaceAll("\u00a7[f|F|r]", ""); continue; + } else if (gemstonePowder == null) { + gemstonePowder = RED + "Please enable player list info in your skyblock settings"; + continue; } if (name.matches("\\xa7r\\xa79\\xa7lForges \\xa7r(?:\\xa7f\\(\\+1 more\\)\\xa7r)?") && hidden != null) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningSkillOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningSkillOverlay.java index 43d6ab70..d143aa6c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningSkillOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningSkillOverlay.java @@ -317,7 +317,7 @@ public class MiningSkillOverlay extends TextOverlay { //Im sure there is a much current = (int) interp(current, skillInfoLast.currentXp); } - lineMap.put(2, EnumChatFormatting.AQUA + "Mine: " + EnumChatFormatting.YELLOW + "60 " + EnumChatFormatting.RED + "(Maxed)"); + lineMap.put(2, EnumChatFormatting.AQUA + "Mining: " + EnumChatFormatting.YELLOW + "60 " + EnumChatFormatting.RED + "(Maxed)"); lineMap.put(3, EnumChatFormatting.AQUA + "Current XP: " + EnumChatFormatting.YELLOW + format.format(current)); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java index aa52d874..dd9abc31 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java @@ -15,10 +15,12 @@ public class OverlayManager { public static FarmingOverlay farmingOverlay; public static FishingSkillOverlay fishingSkillOverlay; public static MiningSkillOverlay miningSkillOverlay; + public static CombatSkillOverlay combatSkillOverlay; public static PetInfoOverlay petInfoOverlay; public static TimersOverlay timersOverlay; public static BonemerangOverlay bonemerangOverlay; public static CrystalHollowOverlay crystalHollowOverlay; + public static SlayerOverlay slayerOverlay; public static final List<TextOverlay> textOverlays = new ArrayList<>(); static { @@ -131,6 +133,26 @@ public class OverlayManager { } return TextOverlayStyle.BACKGROUND; }); + List<String> combatSkillDummy = Lists.newArrayList( + "\u00a7bKills: \u00a7e547,860", + "\u00a7bCombat: \u00a7e12\u00a77 [\u00a7e|||||||||||||||||\u00a78||||||||\u00a77] \u00a7e67%", + "\u00a7bCurrent XP: \u00a7e6,734", + "\u00a7bRemaining XP: \u00a7e3,265", + "\u00a7bXP/h: \u00a7e238,129", + "\u00a7bETA: \u00a7e13h12m"); + combatSkillOverlay = new CombatSkillOverlay(NotEnoughUpdates.INSTANCE.config.skillOverlays.combatPosition, () -> { + List<String> strings = new ArrayList<>(); + for(int i : NotEnoughUpdates.INSTANCE.config.skillOverlays.combatText) { + if(i >= 0 && i < combatSkillDummy.size()) strings.add(combatSkillDummy.get(i)); + } + return strings; + }, () -> { + int style = NotEnoughUpdates.INSTANCE.config.skillOverlays.combatStyle; + if(style >= 0 && style < TextOverlayStyle.values().length) { + return TextOverlayStyle.values()[style]; + } + return TextOverlayStyle.BACKGROUND; + }); List<String> petInfoDummy = Lists.newArrayList("\u00a7a[Lvl 37] \u00a7fRock", "\u00a7b2,312.9/2,700\u00a7e (85.7%)", "\u00a7b2.3k/2.7k\u00a7e (85.7%)", @@ -210,14 +232,36 @@ public class OverlayManager { } return TextOverlayStyle.BACKGROUND; }); + List<String> slayerDummy = Lists.newArrayList("\u00a7eSlayer: \u00a74Sven", + "\u00a7eRNG Meter: \u00a75100%", + "\u00a7eLvl: \u00a7d7", + "\u00a7eKill time: \u00a7c1:30", + "\u00a7eXP: \u00a7d75,450/100,000", + "\u00a7eBosses till next Lvl: \u00a7d17", + "\u00a7eAverage kill time: \u00a7c3:20"); + slayerOverlay = new SlayerOverlay(NotEnoughUpdates.INSTANCE.config.slayerOverlay.slayerPosition, () -> { + List<String> strings = new ArrayList<>(); + for (int i : NotEnoughUpdates.INSTANCE.config.slayerOverlay.slayerText) { + if (i >= 0 && i < slayerDummy.size()) strings.add(slayerDummy.get(i)); + } + return strings; + }, () -> { + int style = NotEnoughUpdates.INSTANCE.config.slayerOverlay.slayerStyle; + if (style >= 0 && style < TextOverlayStyle.values().length) { + return TextOverlayStyle.values()[style]; + } + return TextOverlayStyle.BACKGROUND; + }); textOverlays.add(miningOverlay); textOverlays.add(farmingOverlay); textOverlays.add(miningSkillOverlay); + textOverlays.add(combatSkillOverlay); textOverlays.add(fishingSkillOverlay); textOverlays.add(petInfoOverlay); textOverlays.add(bonemerangOverlay); textOverlays.add(crystalHollowOverlay); + textOverlays.add(slayerOverlay); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/SlayerOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/SlayerOverlay.java new file mode 100644 index 00000000..6f5be7e9 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/SlayerOverlay.java @@ -0,0 +1,194 @@ +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.util.SBInfo; +import io.github.moulberry.notenoughupdates.util.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.util.EnumChatFormatting; + +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.function.Supplier; + +public class SlayerOverlay extends TextOverlay { + + public static boolean slayerQuest; + public static String RNGMeter = "?"; + public static boolean isSlain = false; + public static String slayerLVL = "-1"; + public static String slayerXp = "0"; + private static String slayerEXP = "0"; + private static int slayerIntXP; + private static int untilNextSlayerLevel; + private static int xpToLevelUp; + private static boolean useSmallXpNext = true; + public static long timeSinceLastBoss = 0; + public static long timeSinceLastBoss2 = 0; + private static long agvSlayerTime = 0; + private static boolean isSlayerNine = false; + public static int slayerTier = 0; + private static int xpPerBoss = 0; + private static int bossesUntilNextLevel = 0; + public static long unloadOverlayTimer = -1; + + public SlayerOverlay(Position position, Supplier<List<String>> dummyStrings, Supplier<TextOverlayStyle> styleSupplier) { + super(position, dummyStrings, styleSupplier); + } + + @Override + public void update() { + if (!NotEnoughUpdates.INSTANCE.config.slayerOverlay.slayerOverlay) { + overlayStrings = null; + return; + } + + if (Minecraft.getMinecraft().thePlayer == null) return; + + if (!slayerQuest) { + slayerTier = 0; + } + + if (slayerXp.equals("maxed")) { + isSlayerNine = true; + } else if (!slayerXp.equals("0")) { + slayerEXP = slayerXp.replace(",", ""); + slayerIntXP = Integer.parseInt(slayerEXP); + isSlayerNine = false; + } else { + slayerIntXP = 0; + isSlayerNine = false; + } + //System.out.println(slayerEXP); + if (SBInfo.getInstance().slayer.equals("Tarantula") || SBInfo.getInstance().slayer.equals("Revenant")) { + useSmallXpNext = true; + } else if (SBInfo.getInstance().slayer.equals("Sven") || SBInfo.getInstance().slayer.equals("Enderman")) { + useSmallXpNext = false; + } + switch (slayerLVL) { + case "9": + xpToLevelUp = 2000000; + break; + case "8": + xpToLevelUp = 1000000; + break; + case "7": + xpToLevelUp = 400000; + break; + case "6": + xpToLevelUp = 100000; + break; + case "5": + xpToLevelUp = 20000; + break; + case "4": + xpToLevelUp = 5000; + break; + case "3": + if (useSmallXpNext) { + xpToLevelUp = 1000; + } else { + xpToLevelUp = 1500; + } + break; + case "2": + if (useSmallXpNext) { + xpToLevelUp = 200; + } else { + xpToLevelUp = 250; + } + break; + case "1": + if (SBInfo.getInstance().slayer.equals("Revenant")) { + xpToLevelUp = 15; + } else if (SBInfo.getInstance().slayer.equals("Tarantula")) { + xpToLevelUp = 25; + } else { + xpToLevelUp = 30; + } + break; + case "0": + if (useSmallXpNext) { + xpToLevelUp = 5; + } else { + xpToLevelUp = 10; + } + break; + } + if (slayerTier == 5) { + xpPerBoss = 1500; + } else if (slayerTier == 4) { + xpPerBoss = 500; + } else if (slayerTier == 3) { + xpPerBoss = 100; + } else if (slayerTier == 2) { + xpPerBoss = 25; + } else if (slayerTier == 1) { + xpPerBoss = 5; + } else { + xpPerBoss = 0; + } + untilNextSlayerLevel = xpToLevelUp - slayerIntXP; + if (xpPerBoss != 0 && untilNextSlayerLevel != 0 && xpToLevelUp != 0) { + bossesUntilNextLevel = (xpToLevelUp - untilNextSlayerLevel) / xpPerBoss; + } else { + bossesUntilNextLevel = 0; + } + agvSlayerTime = (timeSinceLastBoss+timeSinceLastBoss2)/2; + } + + @Override + public void updateFrequent() { + super.updateFrequent(); + + if (!slayerQuest || !NotEnoughUpdates.INSTANCE.config.slayerOverlay.slayerOverlay) { + overlayStrings = null; + } else { + HashMap<Integer, String> lineMap = new HashMap<>(); + + NumberFormat format = NumberFormat.getIntegerInstance(); + //System.out.println(SBInfo.getInstance().isSlain); + overlayStrings = new ArrayList<>(); + lineMap.put(0, EnumChatFormatting.YELLOW + "Slayer: " + EnumChatFormatting.DARK_RED + SBInfo.getInstance().slayer + + EnumChatFormatting.GREEN + (isSlain ? " (Killed) " : " ")/* + slayerTier*/); + + if (!RNGMeter.equals("?")) { + lineMap.put(1, EnumChatFormatting.YELLOW + "RNG Meter: " + EnumChatFormatting.DARK_PURPLE + RNGMeter); + } + + if (!slayerLVL.equals("-1")) { + lineMap.put(2, EnumChatFormatting.YELLOW + "Lvl: " + EnumChatFormatting.LIGHT_PURPLE + slayerLVL); + } + + if (timeSinceLastBoss > 0) { + lineMap.put(3, EnumChatFormatting.YELLOW + "Kill time: " + EnumChatFormatting.RED + + Utils.prettyTime((System.currentTimeMillis() - timeSinceLastBoss))); + } + + if (slayerIntXP > 0) { + lineMap.put(4, EnumChatFormatting.YELLOW + "XP: " + EnumChatFormatting.LIGHT_PURPLE + + format.format(untilNextSlayerLevel) + "/" + format.format(xpToLevelUp)); + } else if (isSlayerNine) { + lineMap.put(4, EnumChatFormatting.YELLOW + "XP: " + EnumChatFormatting.LIGHT_PURPLE + "MAXED"); + } + + if (xpPerBoss != 0 && slayerIntXP > 0) { + lineMap.put(5, EnumChatFormatting.YELLOW + "Bosses till next Lvl: " + EnumChatFormatting.LIGHT_PURPLE + + (bossesUntilNextLevel > 1000 ? "?" : bossesUntilNextLevel)); + } + + if (timeSinceLastBoss > 0 && timeSinceLastBoss2 > 0) { + lineMap.put(6, EnumChatFormatting.YELLOW + "Average kill time: " + EnumChatFormatting.RED + + Utils.prettyTime((System.currentTimeMillis() - agvSlayerTime))); + } + for (int strIndex : NotEnoughUpdates.INSTANCE.config.slayerOverlay.slayerText) { + if (lineMap.get(strIndex) != null) { + overlayStrings.add(lineMap.get(strIndex)); + } + } + if (overlayStrings != null && overlayStrings.isEmpty()) overlayStrings = null; + } + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java index d5bc5d56..67873df8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java @@ -398,12 +398,10 @@ public class TimersOverlay extends TextOverlay { } long midnightReset = (currentTime - 18000000) / 86400000 * 86400000 + 18000000; - long experimentReset = (currentTime - 18000000) / 86400000 * 86400000 + 86400000; long fetchurComplete = hidden.fetchurCompleted; long timeDiffMidnightNow = midnightReset + 86400000 - currentTime; - long timeDiffMidnightNowExp = experimentReset + 86400000 - currentTime; //Fetchur Display if (fetchurComplete < midnightReset) { @@ -438,19 +436,19 @@ public class TimersOverlay extends TextOverlay { } //Experiment Display - if (hidden.experimentsCompleted < experimentReset) { + if (hidden.experimentsCompleted < midnightReset) { map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.readyColour] + "Ready!"); } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.experimentationDisplay >= DISPLAYTYPE.VERYSOON.ordinal() && - (hidden.experimentsCompleted < (experimentReset - TimeEnums.HALFANHOUR.time))) { - map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.verySoonColour] + Utils.prettyTime(timeDiffMidnightNowExp)); + (hidden.experimentsCompleted < (midnightReset - TimeEnums.HALFANHOUR.time))) { + map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.verySoonColour] + Utils.prettyTime(timeDiffMidnightNow)); } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.experimentationDisplay >= DISPLAYTYPE.SOON.ordinal() && - (hidden.experimentsCompleted < (experimentReset - TimeEnums.HOUR.time))) { - map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.soonColour] + Utils.prettyTime(timeDiffMidnightNowExp)); + (hidden.experimentsCompleted < (midnightReset - TimeEnums.HOUR.time))) { + map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.soonColour] + Utils.prettyTime(timeDiffMidnightNow)); } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.experimentationDisplay >= DISPLAYTYPE.KINDASOON.ordinal() && - (hidden.experimentsCompleted < (experimentReset - (TimeEnums.HOUR.time * 3)))) { - map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.kindaSoonColour] + Utils.prettyTime(timeDiffMidnightNowExp)); + (hidden.experimentsCompleted < (midnightReset - (TimeEnums.HOUR.time * 3)))) { + map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.kindaSoonColour] + Utils.prettyTime(timeDiffMidnightNow)); } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.experimentationDisplay >= DISPLAYTYPE.ALWAYS.ordinal()) { - map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.defaultColour] + Utils.prettyTime(timeDiffMidnightNowExp)); + map.put(6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.defaultColour] + Utils.prettyTime(timeDiffMidnightNow)); } overlayStrings = new ArrayList<>(); 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 8295fcbc..81453a8d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -73,6 +73,7 @@ public class GuiProfileViewer extends GuiScreen { public static final ResourceLocation pv_bg = new ResourceLocation("notenoughupdates:pv_bg.png"); public static final ResourceLocation pv_elements = new ResourceLocation("notenoughupdates:pv_elements.png"); public static final ResourceLocation pv_ironman = new ResourceLocation("notenoughupdates:pv_ironman.png"); + public static final ResourceLocation pv_bingo = new ResourceLocation("notenoughupdates:pv_bingo.png"); public static final ResourceLocation resource_packs = new ResourceLocation("minecraft:textures/gui/resource_packs.png"); public static final ResourceLocation icons = new ResourceLocation("textures/gui/icons.png"); @@ -200,11 +201,18 @@ public class GuiProfileViewer extends GuiScreen { 0, 100 / 200f, 0, 20 / 185f, GL11.GL_NEAREST); Utils.drawStringCenteredScaledMaxWidth(profileId, Minecraft.getMinecraft().fontRendererObj, guiLeft + 50, guiTop + sizeY + 3 + 10, true, 90, new Color(63, 224, 208, 255).getRGB()); + //ironman icon if (currProfileInfo != null && currProfileInfo.has("game_mode") && currProfileInfo.get("game_mode").getAsString().equals("ironman")) { GlStateManager.color(1, 1, 1, 1); Minecraft.getMinecraft().getTextureManager().bindTexture(pv_ironman); Utils.drawTexturedRect(guiLeft - 16 - 5, guiTop + sizeY + 5, 16, 16, GL11.GL_NEAREST); } + //bingo! icon + if (currProfileInfo != null && currProfileInfo.has("game_mode") && currProfileInfo.get("game_mode").getAsString().equals("bingo")) { + GlStateManager.color(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pv_bingo); + Utils.drawTexturedRect(guiLeft - 16 - 5, guiTop + sizeY + 5, 16, 16, GL11.GL_NEAREST); + } //Render Open In Skycrypt button renderBlurredBackground(width, height, guiLeft + 100 + 6 + 2, guiTop + sizeY + 3 + 2, 100 - 4, 20 - 4); Minecraft.getMinecraft().getTextureManager().bindTexture(pv_dropdown); @@ -237,6 +245,11 @@ public class GuiProfileViewer extends GuiScreen { Minecraft.getMinecraft().getTextureManager().bindTexture(pv_ironman); Utils.drawTexturedRect(guiLeft - 16 - 5, guiTop + sizeY + 2 + 23 + dropdownOptionSize * yIndex, 16, 16, GL11.GL_NEAREST); } + if (currProfileInfo != null && currProfileInfo.has("game_mode") && currProfileInfo.get("game_mode").getAsString().equals("bingo")) { + GlStateManager.color(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(pv_bingo); + Utils.drawTexturedRect(guiLeft - 16 - 5, guiTop + sizeY + 2 + 23 + dropdownOptionSize * yIndex, 16, 16, GL11.GL_NEAREST); + } } } @@ -3553,7 +3566,7 @@ public class GuiProfileViewer extends GuiScreen { "§7Level " + quickForge + EnumChatFormatting.DARK_GRAY + "/20", "", "§7Decreases the time it takes to", - "§7forge by §a" + quickForgeStat + "%§7." + "§7forge by §a" + (quickForgeStat < 20 ? quickForgeStat : 30) + "%§7." ); Utils.drawHoveringText(quickForgeTooltip, mouseX, mouseY, width, height, -1, fr); quickForgeTooltip = null; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java index 15906884..6b901622 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -2,6 +2,7 @@ package io.github.moulberry.notenoughupdates.util; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.overlays.SlayerOverlay; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.network.NetworkPlayerInfo; @@ -42,6 +43,7 @@ public class SBInfo { public String date = ""; public String time = ""; public String objective = ""; + public String slayer = ""; public String mode = ""; @@ -182,6 +184,36 @@ public class SBInfo { } isInDungeon = tempIsInDungeon; + for (String line : lines) { //Slayer stuff + //System.out.println(line); + if (line.contains("Tarantula Broodfather")) { + slayer = "Tarantula"; + } else if (line.contains("Revenant Horror")) { + slayer = "Revenant"; + } else if (line.contains("Sven Packmaster")) { + slayer = "Sven"; + } else if (line.contains("Voidgloom Seraph")) { + slayer = "Enderman"; + } + if (lines.contains("Slayer Quest") && SlayerOverlay.unloadOverlayTimer == -1 || + lines.contains("Slayer Quest") && System.currentTimeMillis() - SlayerOverlay.unloadOverlayTimer > 500) { + SlayerOverlay.slayerQuest = true; + } + if (SlayerOverlay.slayerQuest) { + if (line.contains(" I")) { + SlayerOverlay.slayerTier = 1; + } if (line.contains(" II")) { + SlayerOverlay.slayerTier = 2; + } if (line.contains(" III")) { + SlayerOverlay.slayerTier = 3; + } if (line.contains(" IV")) { + SlayerOverlay.slayerTier = 4; + } if (line.contains(" V")) { + SlayerOverlay.slayerTier = 5; + } + } + } + if (lines.size() >= 5) { date = Utils.cleanColour(lines.get(1)).trim(); //§74:40am diff --git a/src/main/resources/assets/notenoughupdates/custom_enchant_gui.png b/src/main/resources/assets/notenoughupdates/custom_enchant_gui.png Binary files differindex 06a1fb5d..735a3fb4 100644 --- a/src/main/resources/assets/notenoughupdates/custom_enchant_gui.png +++ b/src/main/resources/assets/notenoughupdates/custom_enchant_gui.png diff --git a/src/main/resources/assets/notenoughupdates/pv_bingo.png b/src/main/resources/assets/notenoughupdates/pv_bingo.png Binary files differnew file mode 100644 index 00000000..5651dfce --- /dev/null +++ b/src/main/resources/assets/notenoughupdates/pv_bingo.png |