diff options
author | nopothegamer <40329022+nopothegamer@users.noreply.github.com> | 2021-12-10 22:54:22 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-10 06:54:22 -0500 |
commit | 9475677afdb86078f3c014b52ef1b0a414f3c5e5 (patch) | |
tree | 6ec8a48f935e827edef2780d9f46036174c5263f | |
parent | 112341e9a72e1f3a6e07cd3c38b1fcba6f222ce4 (diff) | |
download | NotEnoughUpdates-9475677afdb86078f3c014b52ef1b0a414f3c5e5.tar.gz NotEnoughUpdates-9475677afdb86078f3c014b52ef1b0a414f3c5e5.tar.bz2 NotEnoughUpdates-9475677afdb86078f3c014b52ef1b0a414f3c5e5.zip |
Slayer overlay (#28)
* idk where im commiting to
* idk where im commiting to
* made tita overlay and waypoints work with dwarven overlay off
"fixed" divan rarity in neuah
made eitherwarp block overlay turn off able
* Added change notes
* i stopped being pepega and worked out how neu config works
* Added mining skill overlay
* fixed mining overlay
* add option to hide Mining waypoints in Dwarven mines when at location
* better check location
* Make cata xp in /pv be calculated on how many runs you have
* Added master cata xp rates
* Make gitignore not show as changed
* Added warnings to some things in /neu
* maybe fix hiding waypoints
* Added a fishing skill overlay
its kinda scuffed because of the interp stuff
* Hopefully fix Rampart's quarry (for real now)
* Moul said i could
no one leak in general or smth
* Cache itemstacks in miningoverlay and crystalhollows overlay (untested)
* Fix preinit crash due to manager not existing yet
* Make tab do the same as down button while in tab completion mode
* remove debug print
* Added pitch to farming overlay
* Changed the panoramas back to the old one because ery is scuffed
* isnt finished but should work for ery
* Made it so if ur mining 60 it just says maxed level instead of b u g
* Made skills not show int limit when at max level in skill overlays
* wh :omegalul: made neu
* sad you cant type that long in search bar
* Hello don't mind me just improving your workflow
* æ
* Oh also this
* Added the cata xp scaling(idk if m3 and 4 values are right)
* Added Expertise Progress
* Fix farming overlay
* Added cult/crops to next cult level
* Go to the other end of the tab-completion List when hitting the end
* remove debug prints
* added combat skill overlay and some changes to the others (combat doesnt work rn could someone look into it :prayge:)
* Added cooldown to god pot showing in todo overlay
* comment
* Added option to remove enchant glint in storage gui
* Added option to remove enchant glint in storage gui
* please fix
* please fix
* Fixed the placement of help.png
* Added fairy soul waypoints to misc
* unclear not clear
* Added dg partner cape
* fix space cape
* Fix space cape
* Make it so you can hold down keys in sign GUIs
* Added a button in storage menu to open the settings
Added an option to change the click names for /pv to /ah
* Made it so ur config doesnt reset
* Added bhop (shhh dont tell anyone)
* Added a help menu to /neuec
* changed fisgifis overlay button no work
* make working fishing tiemr
* jani can you test this out for us
* Added a gui locations tab
* very important feature
* Fixed wart hoe overlay if not alch 50
* Make it so the ding time is customizable
* Added coins/m to farming overlay
* Basic mining tab in pv
* Just for jani
* Just for jani v2
* works ig
* my balls
* hotm pv is mostly done missing some perks
* hotm pv done
* message goes here
* push so i can pr jani
* Final hotm pv texture + fix m3 and m4 cata xp
* edit: didnt work
* fixed up stuff dokm said
* added image for hotm pv
* Fixed previews for furf and dg capes
* removed combat overlay from location gui menu in /neu
* Start of a custom pv page
* Removed custom pv because -2 people would use it
Removed neubhop (found out bhop is bannable)
* update build gradle
* - Made it so treecap shows foraging xp instead of farming xp on the farming overlay
- Made it so a jungle axe with cult will show the "farming" overlay
* Added entrance + made blur limit at 100
* Added blocking clicks back to the enchanting minigames
* update patch notes
* Fixed rounding issue
* let you use screenshot in et overlay
* Added /neurepomode to toggle item editing and dev mode
* Changed "NEUAH is DISABLED! Enable in /neusettings." to /neu
* Changed misc overlays tab to todo overlays
* Added config option for npc retexture (idk if it works i dont have a pack to test it with)
* update patch note
* Fixed api key autofill with dg copy chat feature
* Fixed api key autofill with dg copy chat feature v2
* Made missing enchants not show on an item if its not missing any enchants
* remove todo because pepega
* Added a config option for dirt wand overlay
Added a config option for hoe of tilling
* patch notes
* Fix pet getlorereplacements crash (im guessing) (#21)
* Added an option to use short numbers (1.5mil) for price tooltips
* Added warning to slotlocking + short prices default to off
* make it not dungeon map
* Fixed pet overlay not updating when going into /pets
* Dokm after not making his own patch notes
* Fixed capital letter
* Refactor miscoverlays to todooverlays
* idk man make the short number prices use like 5 less lines
* Added an option to show next click in chronomatron
* added bz price to farming overlay coins/m (only wart rn)
* added bz price to farming overlay coins/m
* me when cactus price was divided by 1296 :pepela:
* unrefactor todo overlay because it resets the config
* Fixed fetchur for the 765754465th time
* Fixed time that experiment table resets + Made prevent missclicks off by default
* Added slayer overlay
* fixed quickforge level 20 because it goes up +0.5% every level... and randomly the last level gives + 10.5%
* ery wanted to texture himself so i made a hidden toggle for it
* made it so if your modlist is under 15 and you do /neustats modlist it will just show /neustats
* Finished slayer overlay
* Auto turn off search mode after 2 minutes
* i forgor bout patch notes
* Added setting jani wanted
* removed hide incompatible enchants because no workie
* i forgor to make it build :skull:
* Added max enchant book to /neuec - Dokm
* Fixed the slayer overlay when ping
* edit: didnt work
* Made a lil error if you have new tab list off
* Fixed fishing overlay for lava fishing
* Fix spelling + comments
* Added bingo profile icon to /pv
* comments
* istg people are pepega
* ery made good texture for pv bingo
* making the pr fricked me
(please build)
* Fixed pet overlay not resetting pet when making new profile
* Fixed pet overlay not resetting pet when making new profile
* i forgor to add to LocationEdit neu page + last commit was added combat overlay
* Fix comments because either me or intellij was on crack
* comments stuff
* ok de duimon no0b
Co-authored-by: Lulonaut <lulonaut@tutanota.de>
Co-authored-by: Lulonaut <67191924+Lulonaut@users.noreply.github.com>
Co-authored-by: DoKM <mcazzyman@gmail.com>
Co-authored-by: TymanWasTaken <tyman@tyman.tech>
Co-authored-by: MicrocontrollersDev <microcontrollersyt@gmail.com>
Co-authored-by: jani270 <jani270@gmx.de>
Co-authored-by: DoKM <54663875+DoKM@users.noreply.github.com>
Co-authored-by: IRONM00N <64110067+IRONM00N@users.noreply.github.com>
26 files changed, 850 insertions, 33 deletions
diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index 1b623418..11b57447 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -3,6 +3,8 @@ ### **Major Changes** - Added mining skill overlay - Added fishing skill overlay +- Added combat skill overlay +- Added slayer overlay - [Added mining tab in /pv](https://cdn.discordapp.com/attachments/832652653292027904/903619242384056370/unknown.png) - Big thanks to kwev1n for some math and jani for the texture - Added blocking clicks back to the enchanting minigames (because apparently its not bannable?) @@ -31,7 +33,12 @@ - Added a config option for hoe of tilling - Added an option to use short numbers (1.5mil) for price tooltips - Added Drills and Gauntlet to the itemlist tools category - jani -- Added an option to show next click in chronomatron +- Added an option to turn off showing next click in chronomatron +- Turns off inv search mode after 2 minutes +- Made /neustats modlist show normal /neustats if under 15 mods +- Added max enchant book to /neuec - Dokm +- [Added bingo profile icon to /pv](https://cdn.discordapp.com/attachments/832652653292027904/915844465372065842/unknown.png) +- Fixed pet overlay not resetting pet when making new profile - Added a warning in the tooltip when price info couldn't be found/is outdated - Lulonaut ### **Bug Fixes** - Made titanium overlay and waypoints work with dwarven overlay off @@ -48,10 +55,12 @@ - Fixed Mining overlay crash - Dokm - Fixed pet crash - Dokm - Fixed fetchur for the 75th time -- Fixed time that experiment table resets +- [Made a lil error if you have new tab list off](https://cdn.discordapp.com/attachments/896407218151366687/913681097605398528/unknown.png) +- Fixed lava fishing with the fishing alert ### **Other** - New icons was added in storage_icons.png - Moved the help icon in /neucustomize over a lil - Added dg partner cape +- Changed custom_enchant_gui.png to remove top right button ### **Previous change log** https://github.com/NotEnoughUpdates/NotEnoughUpdates/blob/master/Update%20Notes/2.0-Pre31-Release.md 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 |