diff options
| author | Moulberry <jjenour@student.unimelb.edu.au> | 2021-07-26 01:36:28 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-07-26 01:36:28 +0800 |
| commit | c9975b9c20161c929e2c29640eab767f97df4105 (patch) | |
| tree | a8e4a0c84dc559be1925b230dc719423dd2a5ff1 /src/main/java | |
| parent | 0f48092ef19488a43114478095f1d4a2040d369c (diff) | |
| parent | a7dde6d4582ad1b2474b0f59c1c74dd70b654a98 (diff) | |
| download | NotEnoughUpdates-c9975b9c20161c929e2c29640eab767f97df4105.tar.gz NotEnoughUpdates-c9975b9c20161c929e2c29640eab767f97df4105.tar.bz2 NotEnoughUpdates-c9975b9c20161c929e2c29640eab767f97df4105.zip | |
Merge pull request #213 from IRONM00N/pr
Misc. Improvements now without formatting or conflicts
Diffstat (limited to 'src/main/java')
18 files changed, 4422 insertions, 4360 deletions
diff --git a/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java b/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java index dcd8cfb2..c16cb7d0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/CustomItems.java @@ -3,6 +3,7 @@ package io.github.moulberry.notenoughupdates; import com.google.gson.JsonArray; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; +import io.github.moulberry.notenoughupdates.util.Constants; import net.minecraft.util.EnumChatFormatting; public class CustomItems { @@ -61,6 +62,14 @@ public class CustomItems { "39 legendary phoenix pets", "", "get flexed"); + public static JsonObject CREDITS = Constants.MISC.getAsJsonObject("credits"); + public static JsonObject IRONM00N = create( + "IRONM00N", + "end_stone", + "IRONM00N", + "Your life has been a lie,", + "the moon is made out of iron." + ); /** * SHAAAAAAAAAAAAAAAAAAME diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java index c3cb4a73..b849c890 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUEventListener.java @@ -19,7 +19,10 @@ import io.github.moulberry.notenoughupdates.gamemodes.SBGamemodes; import io.github.moulberry.notenoughupdates.miscfeatures.*; import io.github.moulberry.notenoughupdates.miscgui.*; import io.github.moulberry.notenoughupdates.options.NEUConfig; -import io.github.moulberry.notenoughupdates.overlays.*; +import io.github.moulberry.notenoughupdates.overlays.AuctionSearchOverlay; +import io.github.moulberry.notenoughupdates.overlays.OverlayManager; +import io.github.moulberry.notenoughupdates.overlays.RancherBootOverlay; +import io.github.moulberry.notenoughupdates.overlays.TextOverlay; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.util.*; import net.minecraft.client.Minecraft; @@ -31,10 +34,7 @@ import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiEditSign; import net.minecraft.client.gui.inventory.GuiInventory; -import net.minecraft.client.network.NetworkPlayerInfo; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.entity.Entity; -import net.minecraft.entity.item.EntityArmorStand; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.event.ClickEvent; import net.minecraft.init.Blocks; @@ -46,14 +46,11 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTUtil; -import net.minecraft.network.play.client.C12PacketUpdateSign; import net.minecraft.util.*; import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.client.event.*; -import net.minecraftforge.event.entity.player.EntityInteractEvent; import net.minecraftforge.event.entity.player.ItemTooltipEvent; import net.minecraftforge.event.world.WorldEvent; -import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; @@ -101,12 +98,19 @@ public class NEUEventListener { JsonObject o = neu.manager.getJsonFromFile(updateJson); String version = o.get("version").getAsString(); + String preVersion = o.get("pre_version").getAsString(); boolean shouldUpdate = !NotEnoughUpdates.VERSION.equalsIgnoreCase(version); + boolean shouldPreUpdate = !NotEnoughUpdates.PRE_VERSION.equalsIgnoreCase(preVersion); + if(o.has("version_id") && o.get("version_id").isJsonPrimitive()) { int version_id = o.get("version_id").getAsInt(); shouldUpdate = version_id > NotEnoughUpdates.VERSION_ID; } + if (o.has("pre_version_id") && o.get("pre_version_id").isJsonPrimitive()) { + int pre_version_id = o.get("pre_version_id").getAsInt(); + shouldPreUpdate = pre_version_id > NotEnoughUpdates.PRE_VERSION_ID; + } if(shouldUpdate) { String update_msg = o.get("update_msg").getAsString(); @@ -133,6 +137,31 @@ public class NEUEventListener { neu.displayLinks(o); Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("")); + } else if (shouldPreUpdate && NotEnoughUpdates.VERSION.equalsIgnoreCase("2.0.0-REL")) { + String pre_update_msg = o.get("pre_update_msg").getAsString(); + + int first_len = -1; + for (String line : pre_update_msg.split("\n")) { + FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; + int len = fr.getStringWidth(line); + if (first_len == -1) { + first_len = len; + } + int missing_len = first_len - len; + if (missing_len > 0) { + StringBuilder sb = new StringBuilder(line); + for (int i = 0; i < missing_len / 8; i++) { + sb.insert(0, " "); + } + line = sb.toString(); + } + line = line.replaceAll("\\{pre_version}", preVersion); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(line)); + } + + neu.displayLinks(o); + + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("")); } } catch(Exception ignored) {} } @@ -248,7 +277,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 +316,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 +342,12 @@ 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 +361,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 +601,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 +785,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 +812,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 +881,7 @@ public class NEUEventListener { } if(hoverInv) { renderDungeonChestOverlay(event.gui); - if(neu.config.accessoryBag.enableOverlay) { + if(NotEnoughUpdates.INSTANCE.config.accessoryBag.enableOverlay) { AccessoryBagOverlay.renderOverlay(); } } @@ -1030,7 +1060,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 +1117,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 +1166,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 +1258,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 +1380,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 +1503,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 +1559,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 +1673,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 +1863,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 +1906,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 +2048,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 +2062,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 +2104,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 +2229,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 +2241,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 +2298,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..967ef903 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -3,8 +3,6 @@ package io.github.moulberry.notenoughupdates; import com.google.common.collect.Lists; import com.google.gson.*; import io.github.moulberry.notenoughupdates.auction.APIManager; -import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager; -import io.github.moulberry.notenoughupdates.miscgui.GuiItemCustomize; import io.github.moulberry.notenoughupdates.miscgui.GuiItemRecipe; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.HypixelApi; @@ -66,7 +64,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 +78,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 +187,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(); @@ -1169,32 +1168,6 @@ public class NEUManager { return true; } - public boolean uploadItemJson(String internalname, String itemid, String displayname, String[] lore, String crafttext, String infoType, String[] info, - String clickcommand, int damage, NBTTagCompound nbttag) { - JsonObject json = createItemJson(internalname, itemid, displayname, lore, crafttext, infoType, info, clickcommand, damage, nbttag); - if(json == null) { - return false; - } - - String username = Minecraft.getMinecraft().thePlayer.getName(); - String newBranchName = UUID.randomUUID().toString().substring(0, 8) + "-" + internalname + "-" + username; - String prTitle = internalname + "-" + username; - String prBody = "Internal name: " + internalname + "\nSubmitted by: " + username; - String file = "items/"+internalname+".json"; - /*if(!neuio.createNewRequest(newBranchName, prTitle, prBody, file, gson.toJson(json))) { - return false; - }*/ - - try { - writeJsonDefaultDir(json, internalname+".json"); - } catch(IOException e) { - return false; - } - - loadItem(internalname); - return true; - } - public void writeJson(JsonObject json, File file) throws IOException { file.createNewFile(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index 2a6160f1..bf85a6a6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -71,7 +71,7 @@ public class NEUOverlay extends Gui { private NEUManager manager; private String mobRegex = ".*?((_MONSTER)|(_ANIMAL)|(_MINIBOSS)|(_BOSS)|(_SC))$"; - private String petRegex = ".*?;[0-4]$"; + private String petRegex = ".*?;[0-5]$"; private ResourceLocation[] sortIcons = new ResourceLocation[] { sort_all, sort_mob, sort_pet, sort_tool, sort_armor, sort_accessory @@ -1044,7 +1044,8 @@ 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()+"SPECIAL", + EnumChatFormatting.LIGHT_PURPLE+EnumChatFormatting.BOLD.toString()+"MYTHIC", + EnumChatFormatting.RED+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--) { @@ -1270,6 +1272,15 @@ public class NEUOverlay extends Gui { case "spinaxx": searchedItems.add(CustomItems.SPINAXX); break; + case "credits": + case "credit": + case "who made this mod": + searchedItems.add(CustomItems.CREDITS); + break; + case "ironmoon": + case "ironm00n": + searchedItems.add(CustomItems.IRONM00N); + break; } this.searchedItems = searchedItems; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index cfab28e0..c638eca6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -90,7 +90,9 @@ import java.util.concurrent.atomic.AtomicInteger; public class NotEnoughUpdates { public static final String MODID = "notenoughupdates"; public static final String VERSION = "2.0.0-REL"; + public static final String PRE_VERSION = "30.2"; public static final int VERSION_ID = 20000; + public static final int PRE_VERSION_ID = 3002; public static NotEnoughUpdates INSTANCE = null; @@ -311,6 +313,7 @@ public class NotEnoughUpdates { petRarityToColourMap.put("RARE", EnumChatFormatting.BLUE.toString()); petRarityToColourMap.put("EPIC", EnumChatFormatting.DARK_PURPLE.toString()); petRarityToColourMap.put("LEGENDARY", EnumChatFormatting.GOLD.toString()); + petRarityToColourMap.put("MYTHIC", EnumChatFormatting.LIGHT_PURPLE.toString()); } ScheduledExecutorService peekCommandExecutorService = null; SimpleCommand peekCommand = new SimpleCommand("peek", new SimpleCommand.ProcessCommandRunnable() { @@ -389,6 +392,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; @@ -398,17 +402,20 @@ public class NotEnoughUpdates { zombie = 2; spider = 1; wolf = 2; + enderman = 0; } EnumChatFormatting combatPrefix = combat>20?(combat>35?EnumChatFormatting.GREEN:EnumChatFormatting.YELLOW):EnumChatFormatting.RED; 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,9 +429,11 @@ 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) { + if (st |
