diff options
author | DoKM <mcazzyman@gmail.com> | 2021-07-23 18:03:23 +0200 |
---|---|---|
committer | DoKM <mcazzyman@gmail.com> | 2021-07-23 18:03:23 +0200 |
commit | c8f7b7119b5ced019b02faa46136f94716516f19 (patch) | |
tree | 739d7465d603ec8221432fac0b132282aae32414 /src/main/java/io | |
parent | b19c711aadd8b6e41b52226c4f43d7689b9cfaa4 (diff) | |
download | NotEnoughUpdates-c8f7b7119b5ced019b02faa46136f94716516f19.tar.gz NotEnoughUpdates-c8f7b7119b5ced019b02faa46136f94716516f19.tar.bz2 NotEnoughUpdates-c8f7b7119b5ced019b02faa46136f94716516f19.zip |
Introduce alot of fixes from Ironm00n's pull request
not everything though
missing his cape (thats not for me to do)
and his version checker for PRE's
Diffstat (limited to 'src/main/java/io')
9 files changed, 103 insertions, 61 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index c3cb4a73..69ecc841 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -103,6 +103,7 @@ public class NEUEventListener { String version = o.get("version").getAsString(); boolean shouldUpdate = !NotEnoughUpdates.VERSION.equalsIgnoreCase(version); + if(o.has("version_id") && o.get("version_id").isJsonPrimitive()) { int version_id = o.get("version_id").getAsInt(); shouldUpdate = version_id > NotEnoughUpdates.VERSION_ID; @@ -248,7 +249,7 @@ public class NEUEventListener { longUpdate = true; lastLongUpdate = currentTime; } - if(!neu.config.dungeons.slowDungeonBlocks) { + if(!NotEnoughUpdates.INSTANCE.config.dungeons.slowDungeonBlocks) { DungeonBlocks.tick(); } DungeonWin.tick(); @@ -287,7 +288,7 @@ public class NEUEventListener { NotEnoughUpdates.profileViewer.putNameUuid(Minecraft.getMinecraft().thePlayer.getName(), Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", "")); - if(neu.config.dungeons.slowDungeonBlocks) { + if(NotEnoughUpdates.INSTANCE.config.dungeons.slowDungeonBlocks) { DungeonBlocks.tick(); } @@ -313,11 +314,11 @@ public class NEUEventListener { SBGamemodes.loadFromFile(); - if(neu.config.notifications.showUpdateMsg) { + if(NotEnoughUpdates.INSTANCE.config.notifications.showUpdateMsg) { displayUpdateMessageIfOutOfDate(); } - if(neu.config.notifications.doRamNotif) { + if(NotEnoughUpdates.INSTANCE.config.notifications.doRamNotif) { long maxMemoryMB = Runtime.getRuntime().maxMemory()/1024L/1024L; if(maxMemoryMB > 4100) { notificationDisplayMillis = System.currentTimeMillis(); @@ -331,8 +332,8 @@ public class NEUEventListener { } } - if(!neu.config.hidden.loadedModBefore) { - neu.config.hidden.loadedModBefore = true; + if(!NotEnoughUpdates.INSTANCE.config.hidden.loadedModBefore) { + NotEnoughUpdates.INSTANCE.config.hidden.loadedModBefore = true; Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("")); Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( @@ -571,7 +572,7 @@ public class NEUEventListener { && event.gui instanceof GuiContainer) { neu.overlay.reset(); } - if(event.gui != null && neu.config.hidden.dev) { + if(event.gui != null && NotEnoughUpdates.INSTANCE.config.hidden.dev) { if(event.gui instanceof GuiChest) { GuiChest eventGui = (GuiChest) event.gui; ContainerChest cc = (ContainerChest) eventGui.inventorySlots; @@ -755,7 +756,7 @@ public class NEUEventListener { } else if(unformatted.startsWith("Your profile was changed to: ")) {//Your profile was changed to: neu.manager.setCurrentProfile(unformatted.substring("Your profile was changed to: ".length()).split(" ")[0].trim()); } else if(unformatted.startsWith("Your new API key is ")) { - neu.config.apiKey.apiKey = unformatted.substring("Your new API key is ".length()); + NotEnoughUpdates.INSTANCE.config.apiKey.apiKey = unformatted.substring("Your new API key is ".length()); Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW+ "[NEU] API Key automatically configured")); } @@ -782,7 +783,7 @@ public class NEUEventListener { } //System.out.println(e.message); if(unformatted.startsWith("Sending to server") && - neu.isOnSkyblock() && neu.config.misc.streamerMode && e.message instanceof ChatComponentText) { + neu.isOnSkyblock() && NotEnoughUpdates.INSTANCE.config.misc.streamerMode && e.message instanceof ChatComponentText) { String m = e.message.getFormattedText(); String m2 = StreamerMode.filterChat(e.message.getFormattedText()); if(!m.equals(m2)) { @@ -851,7 +852,7 @@ public class NEUEventListener { } if(hoverInv) { renderDungeonChestOverlay(event.gui); - if(neu.config.accessoryBag.enableOverlay) { + if(NotEnoughUpdates.INSTANCE.config.accessoryBag.enableOverlay) { AccessoryBagOverlay.renderOverlay(); } } @@ -1030,7 +1031,7 @@ public class NEUEventListener { if(shouldRenderOverlay(event.gui) && neu.isOnSkyblock() && !hoverInv) { renderDungeonChestOverlay(event.gui); - if(neu.config.accessoryBag.enableOverlay) { + if(NotEnoughUpdates.INSTANCE.config.accessoryBag.enableOverlay) { AccessoryBagOverlay.renderOverlay(); } } @@ -1087,9 +1088,9 @@ public class NEUEventListener { } private void renderDungeonChestOverlay(GuiScreen gui) { - if(neu.config.dungeons.profitDisplayLoc == 3) return; + if(NotEnoughUpdates.INSTANCE.config.dungeons.profitDisplayLoc == 3) return; - if(gui instanceof GuiChest && neu.config.dungeons.profitDisplayLoc != 2) { + if(gui instanceof GuiChest && NotEnoughUpdates.INSTANCE.config.dungeons.profitDisplayLoc != 2) { try { int xSize = ((GuiContainer)gui).xSize; int ySize = ((GuiContainer)gui).ySize; @@ -1136,7 +1137,7 @@ public class NEUEventListener { if(bazaarPrice > 0) { worth = bazaarPrice; } else { - switch(neu.config.dungeons.profitType) { + switch(NotEnoughUpdates.INSTANCE.config.dungeons.profitType) { case 1: worth = neu.manager.auctionManager.getItemAvgBin(internal); break; @@ -1228,7 +1229,7 @@ public class NEUEventListener { plStringBIN = prefix + "-" + format.format(-profitLossBIN) + " coins"; } - if(neu.config.dungeons.profitDisplayLoc == 1 && !valueStringBIN2.equals(missingItem)) { + if(NotEnoughUpdates.INSTANCE.config.dungeons.profitDisplayLoc == 1 && !valueStringBIN2.equals(missingItem)) { int w = Minecraft.getMinecraft().fontRendererObj.getStringWidth(plStringBIN); GlStateManager.disableLighting(); GlStateManager.translate(0, 0, 200); @@ -1350,7 +1351,7 @@ public class NEUEventListener { } if(shouldRenderOverlay(event.gui) && neu.isOnSkyblock()) { - if(!neu.config.accessoryBag.enableOverlay || !AccessoryBagOverlay.mouseClick()) { + if(!NotEnoughUpdates.INSTANCE.config.accessoryBag.enableOverlay || !AccessoryBagOverlay.mouseClick()) { if(!(hoverInv && focusInv)) { if(neu.overlay.mouseInput()) { event.setCanceled(true); @@ -1473,7 +1474,7 @@ public class NEUEventListener { event.setCanceled(true); } } - if(neu.config.hidden.dev && neu.config.hidden.enableItemEditing && Minecraft.getMinecraft().theWorld != null && + if(NotEnoughUpdates.INSTANCE.config.hidden.dev && NotEnoughUpdates.INSTANCE.config.hidden.enableItemEditing && Minecraft.getMinecraft().theWorld != null && Keyboard.getEventKey() == Keyboard.KEY_N && Keyboard.getEventKeyState()) { GuiScreen gui = Minecraft.getMinecraft().currentScreen; if(gui instanceof GuiChest) { @@ -1529,7 +1530,7 @@ public class NEUEventListener { System.out.println(essenceJson); } } - if(neu.config.hidden.dev && neu.config.hidden.enableItemEditing && Minecraft.getMinecraft().theWorld != null && + if(NotEnoughUpdates.INSTANCE.config.hidden.dev && NotEnoughUpdates.INSTANCE.config.hidden.enableItemEditing && Minecraft.getMinecraft().theWorld != null && Keyboard.getEventKey() == Keyboard.KEY_O && Keyboard.getEventKeyState()) { GuiScreen gui = Minecraft.getMinecraft().currentScreen; if(gui instanceof GuiChest) { @@ -1643,7 +1644,7 @@ public class NEUEventListener { JsonObject enchantsConst = Constants.ENCHANTS; JsonArray allItemEnchs = null; Set<String> ignoreFromPool = new HashSet<>(); - if(enchantsConst != null && hasEnchantments && neu.config.tooltipTweaks.missingEnchantList) { + if(enchantsConst != null && hasEnchantments && NotEnoughUpdates.INSTANCE.config.tooltipTweaks.missingEnchantList) { try { JsonArray enchantPools = enchantsConst.get("enchant_pools").getAsJsonArray(); for(JsonElement element : enchantPools) { @@ -1833,7 +1834,7 @@ public class NEUEventListener { line = line.replace("\u00A7cR\u00A76a\u00A7ei\u00A7an\u00A7bb\u00A79o\u00A7dw\u00A79 Rune", Utils.chromaString("Rainbow Rune", index, false)+EnumChatFormatting.BLUE); } else if(hasEnchantments) { - if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && neu.config.tooltipTweaks.missingEnchantList) { + if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && NotEnoughUpdates.INSTANCE.config.tooltipTweaks.missingEnchantList) { boolean lineHasEnch = false; for(String s : enchantIds) { String enchantName = WordUtils.capitalizeFully(s.replace("_", " ")); @@ -1876,7 +1877,7 @@ public class NEUEventListener { } } } - for(String op : neu.config.hidden.enchantColours) { + for(String op : NotEnoughUpdates.INSTANCE.config.hidden.enchantColours) { List<String> colourOps = GuiEnchantColour.splitter.splitToList(op); String enchantName = GuiEnchantColour.getColourOpIndex(colourOps, 0); String comparator = GuiEnchantColour.getColourOpIndex(colourOps, 1); @@ -2018,7 +2019,7 @@ public class NEUEventListener { newTooltip.add(line); - if(neu.config.tooltipTweaks.showPriceInfoAucItem) { + if(NotEnoughUpdates.INSTANCE.config.tooltipTweaks.showPriceInfoAucItem) { if(line.contains(EnumChatFormatting.GRAY+"Buy it now: ") || line.contains(EnumChatFormatting.GRAY+"Bidder: ") || line.contains(EnumChatFormatting.GRAY+"Starting bid: ")) { @@ -2032,7 +2033,7 @@ public class NEUEventListener { } } - if(neu.config.dungeons.profitDisplayLoc == 2 && Minecraft.getMinecraft().currentScreen instanceof GuiChest) { + if(NotEnoughUpdates.INSTANCE.config.dungeons.profitDisplayLoc == 2 && Minecraft.getMinecraft().currentScreen instanceof GuiChest) { if(line.contains(EnumChatFormatting.GREEN+"Open Reward Chest")) { dungeonProfit = true; } else if(index == 7 && dungeonProfit) { @@ -2074,7 +2075,7 @@ public class NEUEventListener { if(bazaarPrice > 0) { worth = bazaarPrice; } else { - switch(neu.config.dungeons.profitType) { + switch(NotEnoughUpdates.INSTANCE.config.dungeons.profitType) { case 1: worth = neu.manager.auctionManager.getItemAvgBin(internal); break; @@ -2199,7 +2200,7 @@ public class NEUEventListener { hypixelOrder.add("reforge_bonus"); hypixelOrder.add("rarity"); - if(neu.config.tooltipTweaks.showPriceInfoInvItem) { + if(NotEnoughUpdates.INSTANCE.config.tooltipTweaks.showPriceInfoInvItem) { ItemPriceInformation.addToTooltip(event.toolTip, internalname, event.itemStack); } } @@ -2211,7 +2212,7 @@ public class NEUEventListener { @SubscribeEvent public void onItemTooltip(ItemTooltipEvent event) { if(!neu.isOnSkyblock()) return; - if(neu.config.improvedSBMenu.hideEmptyPanes && + if(NotEnoughUpdates.INSTANCE.config.improvedSBMenu.hideEmptyPanes && event.itemStack.getItem().equals(Item.getItemFromBlock(Blocks.stained_glass_pane))) { String first = Utils.cleanColour(event.toolTip.get(0)); first = first.replaceAll("\\(.*\\)", "").trim(); @@ -2268,7 +2269,7 @@ public class NEUEventListener { } } }*/ - if(Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && neu.config.hidden.dev && + if(Keyboard.isKeyDown(Keyboard.KEY_LCONTROL) && NotEnoughUpdates.INSTANCE.config.hidden.dev && event.toolTip.size()>0&&event.toolTip.get(event.toolTip.size()-1).startsWith(EnumChatFormatting.DARK_GRAY + "NBT: ")) { event.toolTip.remove(event.toolTip.size()-1); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java index 181b9225..38925b77 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -66,7 +66,7 @@ public class NEUManager { private ExecutorService repoLoaderES = Executors.newSingleThreadExecutor(); - private static final String GIT_COMMITS_URL = "https://api.github.com/repos/Moulberry/NotEnoughUpdates-REPO/commits/master"; + private static String GIT_COMMITS_URL; private HashMap<String, Set<String>> usagesMap = new HashMap<>(); @@ -80,6 +80,7 @@ public class NEUManager { this.neu = neu; this.configLocation = configLocation; this.auctionManager = new APIManager(this); + GIT_COMMITS_URL = neu.config.hidden.repoCommitsURL; gson = new GsonBuilder().setPrettyPrinting().create(); @@ -188,8 +189,8 @@ public class NEUManager { Utils.recursiveDelete(repoLocation); repoLocation.mkdirs(); - //TODO: Store hard-coded value somewhere else - String dlUrl = "https://github.com/Moulberry/NotEnoughUpdates-REPO/archive/master.zip"; + + String dlUrl = neu.config.hidden.repoURL; pane.setMessage("Downloading NEU Master Archive. (DL# >20)"); dialog.pack(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index 2a6160f1..9e3c863c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -1044,6 +1044,7 @@ public class NEUOverlay extends Gui { EnumChatFormatting.BLUE+EnumChatFormatting.BOLD.toString()+"RARE", EnumChatFormatting.DARK_PURPLE+EnumChatFormatting.BOLD.toString()+"EPIC", EnumChatFormatting.GOLD+EnumChatFormatting.BOLD.toString()+"LEGENDARY", + EnumChatFormatting.LIGHT_PURPLE+EnumChatFormatting.BOLD.toString()+"MYTHIC", EnumChatFormatting.LIGHT_PURPLE+EnumChatFormatting.BOLD.toString()+"SPECIAL", }; @@ -1055,7 +1056,8 @@ public class NEUOverlay extends Gui { * 2 = RARE * 3 = EPIC * 4 = LEGENDARY - * 5 = SPECIAL + * 5 = MYTHIC + * 6 = SPECIAL */ public int getRarity(JsonArray lore) { for(int i=lore.size()-1; i>=0; i--) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index cfab28e0..eb53a29a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -389,6 +389,7 @@ public class NotEnoughUpdates { float zombie = Utils.getElementAsFloat(skill.get("level_slayer_zombie"), 0); float spider = Utils.getElementAsFloat(skill.get("level_slayer_spider"), 0); float wolf = Utils.getElementAsFloat(skill.get("level_slayer_wolf"), 0); + float enderman = Utils.getElementAsFloat(skill.get("level_slayer_enderman"), 0); float avgSkillLVL = totalSkillLVL/totalSkillCount; @@ -404,11 +405,13 @@ public class NotEnoughUpdates { EnumChatFormatting zombiePrefix = zombie>3?(zombie>6?EnumChatFormatting.GREEN:EnumChatFormatting.YELLOW):EnumChatFormatting.RED; EnumChatFormatting spiderPrefix = spider>3?(spider>6?EnumChatFormatting.GREEN:EnumChatFormatting.YELLOW):EnumChatFormatting.RED; EnumChatFormatting wolfPrefix = wolf>3?(wolf>6?EnumChatFormatting.GREEN:EnumChatFormatting.YELLOW):EnumChatFormatting.RED; + EnumChatFormatting endermanPrefix = enderman>3?(enderman>6?EnumChatFormatting.GREEN:EnumChatFormatting.YELLOW):EnumChatFormatting.RED; EnumChatFormatting avgPrefix = avgSkillLVL>20?(avgSkillLVL>35?EnumChatFormatting.GREEN:EnumChatFormatting.YELLOW):EnumChatFormatting.RED; overallScore += zombie*zombie/81f; overallScore += spider*spider/81f; overallScore += wolf*wolf/81f; + overallScore += enderman*enderman/81f; overallScore += avgSkillLVL/20f; int cata = (int)Utils.getElementAsFloat(skill.get("level_skill_catacombs"), 0); @@ -422,7 +425,9 @@ public class NotEnoughUpdates { g+" - AVG: " + avgPrefix+(int)Math.floor(avgSkillLVL))); Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( g+"Slayer: "+zombiePrefix+(int)Math.floor(zombie)+g+"-"+ - spiderPrefix+(int)Math.floor(spider)+g+"-"+wolfPrefix+(int)Math.floor(wolf))); + spiderPrefix+(int)Math.floor(spider)+g+"-"+ + wolfPrefix+(int)Math.floor(wolf)+"-"+ + endermanPrefix+(int)Math.floor(enderman))); } if(stats == null) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( @@ -727,11 +732,12 @@ public class NotEnoughUpdates { "\u00a7dFrom \u00a7c[ADMIN] Minikloon\u00a77: If you use that command again, I'll have to ban you", "", "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")); SimpleCommand devTestCommand = new SimpleCommand("neudevtest", new SimpleCommand.ProcessCommandRunnable() { @Override public void processCommand(ICommandSender sender, String[] args) { - if(!Minecraft.getMinecraft().thePlayer.getName().equalsIgnoreCase("Moulberry") && - !Minecraft.getMinecraft().thePlayer.getName().equalsIgnoreCase("LucyCoconut")) { + if(!devTestUsers.contains(Minecraft.getMinecraft().thePlayer.getName().toLowerCase())) { if(devFailIndex >= devFailStrings.length) { throw new Error("L") { @Override diff --git a/src/main/java/io/github/moulberry/notenoughupdates/infopanes/DevInfoPane.java b/src/main/java/io/github/moulberry/notenoughupdates/infopanes/DevInfoPane.java index 22427cee..b33dc888 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/infopanes/DevInfoPane.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/infopanes/DevInfoPane.java @@ -35,7 +35,7 @@ public class DevInfoPane extends TextInfoPane { */ public DevInfoPane(NEUOverlay overlay, NEUManager manager) { - super(overlay, manager, "Dev", ""); + super(overlay, manager, "Missing Items", ""); text = getText(); } @@ -61,7 +61,7 @@ public class DevInfoPane extends TextInfoPane { //if(true) return text; for(String internalname : manager.auctionManager.getItemAuctionInfoKeySet()) { - if(internalname.contains("-")) continue; + if (internalname.matches("^.*-[0-9]{1,3}$")) continue; if(!manager.getItemInformation().containsKey(internalname)) { text += internalname + "\n"; } @@ -464,7 +464,9 @@ public class DevInfoPane extends TextInfoPane { ItemStack stack = shaped.recipeItems[recipeIndex]; if(stack != null) { if(stack.getItem() != stackToAdd.getItem() || - (stackToAdd.getItemDamage() < 32000 && stack.getItemDamage() != stackToAdd.getItemDamage())) addStack(stack, depth+1); + (stackToAdd.getItemDamage() < 32000 && stack.getItemDamage() != stackToAdd.getItemDamage())) { + addStack(stack, depth+1); + } Item stackItem = stack.getItem(); String regName = stackItem.getRegistryName().replace("minecraft:", ""); @@ -516,7 +518,9 @@ public class DevInfoPane extends TextInfoPane { } if(stack != null) { if(stack.getItem() != stackToAdd.getItem() || - (stackToAdd.getItemDamage() < 32000 && stack.getItemDamage() != stackToAdd.getItemDamage())) addStack(stack, depth+1); + (stackToAdd.getItemDamage() < 32000 && stack.getItemDamage() != stackToAdd.getItemDamage())) { + addStack(stack, depth+1); + } Item stackItem = stack.getItem(); String regName = stackItem.getRegistryName().replace("minecraft:", ""); for(String bukkit2 : bukkitList) { @@ -554,7 +558,9 @@ public class DevInfoPane extends TextInfoPane { } if(stack != null) { if(stack.getItem() != stackToAdd.getItem() || - (stackToAdd.getItemDamage() < 32000 && stack.getItemDamage() != stackToAdd.getItemDamage())) addStack(stack, depth+1); + (stackToAdd.getItemDamage() < 32000 && stack.getItemDamage() != stackToAdd.getItemDamage())) { + addStack(stack, depth + 1); + } Item stackItem = stack.getItem(); String regName = stackItem.getRegistryName().replace("minecraft:", ""); for(String bukkit2 : bukkitList) { @@ -588,7 +594,7 @@ public class DevInfoPane extends TextInfoPane { ItemStack stack = null; if(i < shapeless.getRecipeSize()) { - Object o = shapeless.getInput().get(i);; + Object o = shapeless.getInput().get(i); if(o instanceof ItemStack) { stack = (ItemStack) o; } else if(o instanceof List<?>) { @@ -602,7 +608,9 @@ public class DevInfoPane extends TextInfoPane { } if(stack != null) { if(stack.getItem() != stackToAdd.getItem() || - (stackToAdd.getItemDamage() < 32000 && stack.getItemDamage() != stackToAdd.getItemDamage())) addStack(stack, depth+1); + (stackToAdd.getItemDamage() < 32000 && stack.getItemDamage() != stackToAdd.getItemDamage())) { + addStack(stack, depth+1); + } Item stackItem = stack.getItem(); String regName = stackItem.getRegistryName().replace("minecraft:", ""); for(String bukkit2 : bukkitList) { @@ -829,7 +837,7 @@ public class DevInfoPane extends TextInfoPane { ItemStack stack = null; if(i < shapeless.getRecipeSize()) { - Object o = shapeless.getInput().get(i);; + Object o = shapeless.getInput().get(i); if(o instanceof ItemStack) { stack = (ItemStack) o; } else if(o instanceof List<?>) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java index 37ffc938..2da81b94 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/itemeditor/NEUItemEditor.java @@ -116,7 +116,7 @@ public class NEUItemEditor extends GuiScreen { }.b; rightOptions.add(button); - button = new Object() { //Used to make the compiler shut the fuck up + /*button = new Object() { //Used to make the compiler shut the fuck up GuiElementButton b = new GuiElementButton("Upload", Color.YELLOW.getRGB(), new Runnable() { public void run() { if(b.getText().equals("Upload")) { @@ -131,7 +131,7 @@ public class NEUItemEditor extends GuiScreen { } }); }.b; - rightOptions.add(button); + rightOptions.add(button);*/ rightOptions.add(new GuiElementText("", Color.WHITE.getRGB())); @@ -160,7 +160,7 @@ public class NEUItemEditor extends GuiScreen { crafttext.get(), infoType.get(), infoA, clickcommand.get(), damageI, nbttag); } - public boolean upload() { + /*public boolean upload() { int damageI = 0; try { damageI = Integer.valueOf(damage.get()); @@ -172,7 +172,7 @@ public class NEUItemEditor extends GuiScreen { } return manager.uploadItemJson(internalname.get(), itemid.get(), displayname.get(), lore.get().split("\n"), crafttext.get(), infoType.get(), infoA, clickcommand.get(), damageI, nbttag); - } + }*/ public void onGuiClosed() { Keyboard.enableRepeatEvents(false); 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 58deef74..22d5e32f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java @@ -284,6 +284,8 @@ public class NEUConfig extends Config { "Life Steal:\u003e:3:5:0", "Scavenger:\u003e:3:5:0", "Looting:\u003e:3:5:0"); + @Expose public String repoURL = "https://github.com/Moulberry/NotEnoughUpdates-REPO/archive/master.zip"; + @Expose public String repoCommitsURL = "https://api.github.com/repos/Moulberry/NotEnoughUpdates-REPO/commits/master"; } private static ArrayList<String> createDefaultQuickCommands() { 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 af4c354c..db0eac09 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -1524,13 +1524,23 @@ public class GuiProfileViewer extends GuiScreen { Utils.drawStringCentered(selectedCollectionCategory.getDisplayName() + " Minions", Minecraft.getMinecraft().fontRendererObj,
guiLeft+326, guiTop+14, true, 4210752);
- float MAX_MINION_TIER = 11f;
+
List<String> minions = ProfileViewer.getCollectionCatToMinionMap().get(selectedCollectionCategory);
if(minions != null) {
for(int i=0; i<minions.size(); i++) {
String minion = minions.get(i);
if(minion != null) {
- JsonObject minionJson = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(minion+"_GENERATOR_1");
+ JsonObject misc = Constants.MISC;
+ float MAX_MINION_TIER = Utils.getElementAsFloat(Utils.getElement(misc, "minions." + minion + "_GENERATOR"), 11);
+
+ int tier = (int) Utils.getElementAsFloat(minionTiers.get(minion), 0);
+ JsonObject minionJson;
+ if (tier == 0) {
+ minionJson = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(minion + "_GENERATOR_1");
+ } else {
+ minionJson = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(minion + "_GENERATOR_" + tier);
+ }
+
if(minionJson != null) {
int xIndex = i%COLLS_XCOUNT;
int yIndex = i/COLLS_XCOUNT;
@@ -1539,7 +1549,7 @@ public class GuiProfileViewer extends GuiScreen { float y = 7+COLLS_YPADDING+(COLLS_YPADDING+20)*yIndex;
String tierString;
- int tier = (int)Utils.getElementAsFloat(minionTiers.get(minion), 0);
+
if(tier-1 >= romans.length || tier-1 < 0) {
tierString = String.valueOf(tier);
} else {
@@ -2136,7 +2146,7 @@ public class GuiProfileViewer extends GuiScreen { float xStart = 22;
float xOffset = 103;
float yStartTop = 27;
- float yStartBottom = 109;
+ float yStartBottom = 105;
float yOffset = 10;
float bankBalance = Utils.getElementAsFloat(Utils.getElement(profileInfo, "banking.balance"), 0);
@@ -2162,6 +2172,7 @@ public class GuiProfileViewer extends GuiScreen { float totalSlayerLVL = 0;
float totalSkillCount = 0;
float totalSlayerCount = 0;
+ float totalSlayerXP = 0;
for(Map.Entry<String, JsonElement> entry : skillInfo.entrySet()) {
if(entry.getKey().startsWith("level_skill")) {
@@ -2175,6 +2186,8 @@ public class GuiProfileViewer extends GuiScreen { } else if(entry.getKey().startsWith("level_slayer")) {
totalSlayerLVL += entry.getValue().getAsFloat();
totalSlayerCount++;
+ } else if (entry.getKey().startsWith("experience_slayer")) {
+ totalSlayerXP += entry.getValue().getAsFloat();
}
}
@@ -2184,10 +2197,15 @@ public class GuiProfileViewer extends GuiScreen { Utils.renderAlignedString(EnumChatFormatting.RED+"AVG Skill Level", EnumChatFormatting.WHITE.toString()+Math.floor(avgSkillLVL*10)/10,
guiLeft+xStart, guiTop+yStartBottom+yOffset, 76);
- Utils.renderAlignedString(EnumChatFormatting.RED+"AVG Slayer Level", EnumChatFormatting.WHITE.toString()+Math.floor(avgSlayerLVL*10)/10,
- guiLeft+xStart, guiTop+yStartBottom+yOffset*2, 76);
+
Utils.renderAlignedString(EnumChatFormatting.RED+"True AVG Skill Level", EnumChatFormatting.WHITE.toString()+Math.floor(avgTrueSkillLVL*10)/10,
+ guiLeft+xStart, guiTop+yStartBottom+yOffset*2, 76);
+
+ Utils.renderAlignedString(EnumChatFormatting.RED+"AVG Slayer Level", EnumChatFormatting.WHITE.toString()+Math.floor(avgSlayerLVL*10)/10,
guiLeft+xStart, guiTop+yStartBottom+yOffset*3, 76);
+
+ Utils.renderAlignedString(EnumChatFormatting.RED + "Total Slayer XP", EnumChatFormatting.WHITE.toString() + Math.floor(totalSlayerXP * 10) / 10,
+ guiLeft + xStart, guiTop + yStartBottom + yOffset * 4, 76);
}
@@ -2396,7 +2414,7 @@ public class GuiProfileViewer extends GuiScreen { playerName = Utils.getElementAsString(profile.getHypixelProfile().get("prefix"), "") + " " + entityPlayer.getName();
} else {
String rank = Utils.getElementAsString(profile.getHypixelProfile().get("rank"),
- Utils.getElementAsString(profile.getHypixelProfile().get("newPackageRank"), "NONE"));;
+ Utils.getElementAsString(profile.getHypixelProfile().get("newPackageRank"), "NONE"));
String monthlyPackageRank = Utils.getElementAsString(profile.getHypixelProfile().get("monthlyPackageRank"), "NONE");
if(!rank.equals("YOUTUBER") && !monthlyPackageRank.equals("NONE")) {
rank = monthlyPackageRank;
@@ -2478,8 +2496,10 @@ public class GuiProfileViewer extends GuiScreen { } else {
tooltipToDisplay.add(EnumChatFormatting.GRAY+"[SHIFT for Info]");
}
- tooltipToDisplay.add("");
- tooltipToDisplay.add(EnumChatFormatting.RED+"THIS IS IN NO WAY ENDORSING IRL TRADING!");
+ if (!NotEnoughUpdates.INSTANCE.config.hidden.dev) {
+ tooltipToDisplay.add("");
+ tooltipToDisplay.add(EnumChatFormatting.RED + "THIS IS IN NO WAY ENDORSING IRL TRADING!");
+ }
}
}
@@ -2635,6 +2655,7 @@ public class GuiProfileViewer extends GuiScreen { Splitter splitter = Splitter.on(" ").omitEmptyStrings().limit(2);
for(int i=0; i<PlayerStats.defaultStatNames.length; i++) {
String statName = PlayerStats.defaultStatNames[i];
+ if(statName.equals("mining_fortune") || statName.equals("mining_speed")) continue;
String statNamePretty = PlayerStats.defaultStatNamesPretty[i];
int val = Math.round(stats.get(statName));
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java index b4fce512..7214e91a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java @@ -43,6 +43,7 @@ public class ProfileViewer { petRarityToNumMap.put("RARE", "2");
petRarityToNumMap.put("EPIC", "3");
petRarityToNumMap.put("LEGENDARY", "4");
+ petRarityToNumMap.put("MYTHIC", "5");
}
private static final LinkedHashMap<String, ItemStack> skillToSkillDisplayMap = new LinkedHashMap<>();
@@ -79,12 +80,12 @@ public class ProfileViewer { collectionCatToCollectionMap.put(CAT_MINING,
Utils.createList("COBBLESTONE", "COAL", "IRON_INGOT", "GOLD_INGOT", "DIAMOND", "INK_SACK:4",
"EMERALD", "REDSTONE", "QUARTZ", "OBSIDIAN", "GLOWSTONE_DUST", "GRAVEL", "ICE", "NETHERRACK",
- "SAND", "ENDER_STONE", "MITHRIL_ORE", "HARD_STONE", "GEMSTONE_COLLECTION"));
+ "SAND", "ENDER_STONE", null ,"MITHRIL_ORE", "HARD_STONE", "GEMSTONE_COLLECTION"));
collectionCatToCollectionMap.put(CAT_COMBAT,
Utils.createList("ROTTEN_FLESH", "BONE", "STRING", "SPIDER_EYE", "SULPHUR", "ENDER_PEARL",
- "GHAST_TEAR", "SLIME_BALL", "BLAZE_ROD", "MAGMA_CREAM"));
+ "GHAST_TEAR", "SLIME_BALL", "BLAZE_ROD", "MAGMA_CREAM", null, null, null));
collectionCatToCollectionMap.put(CAT_FORAGING,
- Utils.createList("LOG", "LOG:1", "LOG:2", "LOG_2:1", "LOG_2", "LOG:3"));
+ Utils.createList("LOG", "LOG:1", "LOG:2", "LOG_2:1", "LOG_2", "LOG:3", null));
collectionCatToCollectionMap.put(CAT_FISHING,
Utils.createList("RAW_FISH", "RAW_FISH:1", "RAW_FISH:2", "RAW_FISH:3", "PRISMARINE_SHARD",
"PRISMARINE_CRYSTALS", "CLAY_BALL", "WATER_LILY", "INK_SACK", "SPONGE"));
@@ -99,12 +100,12 @@ public class ProfileViewer { collectionCatToMinionMap.put(CAT_MINING,
Utils.createList("COBBLESTONE", "COAL", "IRON", "GOLD", "DIAMOND", "LAPIS",
"EMERALD", "REDSTONE", "QUARTZ", "OBSIDIAN", "GLOWSTONE", "GRAVEL", "ICE", null,
- "SAND", "ENDER_STONE", "MITHRIL", "HARD_STONE", null));
+ "SAND", "ENDER_STONE", "SNOW", "MITHRIL", "HARD_STONE", null));
collectionCatToMinionMap.put(CAT_COMBAT,
Utils.createList("ZOMBIE", "SKELETON", "SPIDER", "CAVESPIDER", "CREEPER", "ENDERMAN",
- "GHAST", "SLIME", "BLAZE", "MAGMA_CUBE"));
+ "GHAST", "SLIME", "BLAZE", "MAGMA_CUBE", "REVENANT", "TARANTULA", "VOIDLING"));
collectionCatToMinionMap.put(CAT_FORAGING,
- Utils.createList("OAK", "SPRUCE", "BIRCH", "DARK_OAK", "ACACIA", "JUNGLE"));
+ Utils.createList("OAK", "SPRUCE", "BIRCH", "DARK_OAK", "ACACIA", "JUNGLE", "FLOWER"));
collectionCatToMinionMap.put(CAT_FISHING,
Utils.createList("FISHING", null, null, null, null,
null, "CLAY", null, null, null));
|