From 47af0b3eee70a5c8d7c86fff19155a97a9204708 Mon Sep 17 00:00:00 2001 From: efefury <69400149+efefury@users.noreply.github.com> Date: Sun, 11 Sep 2022 09:31:27 +0000 Subject: cleaned up neu overlay (#241) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * made equipment overlay own class lmk if there's any bugs * fix infer (i think) * fuck infer * First refactoringering * Fix more stuff * itemlisting * NEU 3.0 release notes * fixed nea bug https://imgur.com/a/Sg3iw74 * whitespace * fixed equipment overlay not working ? and caching * nopoing idk what im doing * FHJNX GHD trwsmokürtsew tze jiozterdgjjiüzetr jipztr * Revert "FHJNX GHD" This reverts commit 24eceba3db5e500be296f5a96412bd8b95647a22. * Revert "nopoing" This reverts commit bee07cb98f8b9672c2e1bc192c6c3e5ae8b02b95. * Revert "fixed equipment overlay" This reverts commit b15376f934a738900e2dd98efdb0d4a7ec131dfa. * idk i think this works maybe * ??? ????????? * no more black lines * equipment cache * Fix lag with optifine and removal of unused field. Removed onMouseClick as it was triggered more than once per tick when optifine is installed. Removed tooltipsToDisplay field (as it was replaced by a local variable). * this should be true by default to keep old behaviour * itemList now doesn't close when clicking the searchbar itemList will now only close when searchMode is triggered. * Infer moment hoping this doesn't trigger it. Co-authored-by: nea Co-authored-by: Lulonaut Co-authored-by: Ascynx <78341107+Ascynx@users.noreply.github.com> Co-authored-by: nopo Co-authored-by: Ascynx Co-authored-by: Roman / Linnea Gräf Co-authored-by: Lorenz --- Update Notes/2.1.md | 1 + .../moulberry/notenoughupdates/NEUOverlay.java | 440 +-------------------- .../notenoughupdates/NotEnoughUpdates.java | 10 +- .../events/GuiInventoryBackgroundDrawnEvent.java | 40 ++ .../notenoughupdates/listener/RenderListener.java | 13 +- .../miscfeatures/PetInfoOverlay.java | 36 +- .../notenoughupdates/mixins/MixinGuiInventory.java | 7 + .../options/seperateSections/Itemlist.java | 9 + .../overlays/EquipmentOverlay.java | 431 ++++++++++++++++++++ .../moulberry/notenoughupdates/util/ItemUtils.java | 7 + 10 files changed, 543 insertions(+), 451 deletions(-) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/events/GuiInventoryBackgroundDrawnEvent.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index 050eaa93..b820ee79 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -117,6 +117,7 @@ - Added profit per score/XP to RNG meter - hannibal2 - Added showing the amount of dungeon runs or slayer bosses needed for the rng meter to fill up - hannibal2 - Added bazaar prices to enchants in the enchantment table - hannibal2 / nea89 +- Added an option to not open the item list when searching containers - Lulonaut ### **Bug Fixes:** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index 18be69e6..308bd63e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -23,7 +23,6 @@ import com.google.common.collect.Lists; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonPrimitive; import io.github.moulberry.notenoughupdates.auction.CustomAHGui; import io.github.moulberry.notenoughupdates.core.BackgroundBlur; import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper; @@ -37,7 +36,6 @@ import io.github.moulberry.notenoughupdates.mbgui.MBGuiElement; import io.github.moulberry.notenoughupdates.mbgui.MBGuiGroupAligned; import io.github.moulberry.notenoughupdates.mbgui.MBGuiGroupFloating; import io.github.moulberry.notenoughupdates.miscfeatures.EnchantingSolvers; -import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; import io.github.moulberry.notenoughupdates.miscfeatures.SunTzu; import io.github.moulberry.notenoughupdates.miscgui.GuiPriceGraph; import io.github.moulberry.notenoughupdates.miscgui.NeuSearchCalculator; @@ -46,17 +44,13 @@ import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.GuiTextures; import io.github.moulberry.notenoughupdates.util.LerpingFloat; import io.github.moulberry.notenoughupdates.util.NotificationHandler; -import io.github.moulberry.notenoughupdates.util.SBInfo; import io.github.moulberry.notenoughupdates.util.SpecialColour; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; -import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.gui.GuiTextField; -import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.RenderHelper; @@ -72,8 +66,6 @@ import net.minecraft.entity.Entity; import net.minecraft.entity.EntityList; import net.minecraft.entity.EntityLivingBase; import net.minecraft.init.Items; -import net.minecraft.inventory.ContainerChest; -import net.minecraft.inventory.IInventory; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; @@ -101,7 +93,6 @@ import java.util.LinkedHashMap; import java.util.LinkedHashSet; import java.util.List; import java.util.Map; -import java.util.Objects; import java.util.Set; import java.util.TreeSet; import java.util.UUID; @@ -120,48 +111,6 @@ public class NEUOverlay extends Gui { private static final ResourceLocation SEARCH_BAR = new ResourceLocation("notenoughupdates:search_bar.png"); private static final ResourceLocation SEARCH_BAR_GOLD = new ResourceLocation("notenoughupdates:search_bar_gold.png"); - private static final ResourceLocation ARMOR_DISPLAY = new ResourceLocation( - "notenoughupdates:armordisplay/armordisplay.png"); - private static final ResourceLocation ARMOR_DISPLAY_GREY = new ResourceLocation( - "notenoughupdates:armordisplay/armordisplay_grey.png"); - private static final ResourceLocation ARMOR_DISPLAY_DARK = new ResourceLocation( - "notenoughupdates:armordisplay/armordisplay_phq_dark.png"); - private static final ResourceLocation ARMOR_DISPLAY_FSR = new ResourceLocation( - "notenoughupdates:armordisplay/armordisplay_fsr.png"); - private static final ResourceLocation ARMOR_DISPLAY_TRANSPARENT = new ResourceLocation( - "notenoughupdates:armordisplay/armordisplay_transparent.png"); - private static final ResourceLocation ARMOR_DISPLAY_TRANSPARENT_PET = new ResourceLocation( - "notenoughupdates:armordisplay/armordisplay_transparent_pet.png"); - - private static final ResourceLocation QUESTION_MARK = new ResourceLocation("notenoughupdates:pv_unknown.png"); - - private static final ResourceLocation PET_DISPLAY = new ResourceLocation( - "notenoughupdates:petdisplay/petdisplaysolo.png"); - private static final ResourceLocation PET_DISPLAY_GREY = new ResourceLocation( - "notenoughupdates:petdisplay/petdisplaysolo_dark.png"); - private static final ResourceLocation PET_DISPLAY_DARK = new ResourceLocation( - "notenoughupdates:petdisplay/petdisplaysolo_phqdark.png"); - private static final ResourceLocation PET_DISPLAY_FSR = new ResourceLocation( - "notenoughupdates:petdisplay/petdisplaysolo_fsr.png"); - private static final ResourceLocation PET_DISPLAY_TRANSPARENT = new ResourceLocation( - "notenoughupdates:petdisplay/petdisplaysolo_transparent.png"); - - private static final ResourceLocation PET_ARMOR_DISPLAY = new ResourceLocation( - "notenoughupdates:petdisplay/petdisplayarmor.png"); - private static final ResourceLocation PET_ARMOR_DISPLAY_GREY = new ResourceLocation( - "notenoughupdates:petdisplay/petdisplayarmor_dark.png"); - private static final ResourceLocation PET_ARMOR_DISPLAY_DARK = new ResourceLocation( - "notenoughupdates:petdisplay/petdisplayarmor_phqdark.png"); - private static final ResourceLocation PET_ARMOR_DISPLAY_FSR = new ResourceLocation( - "notenoughupdates:petdisplay/petdisplayarmor_fsr.png"); - private static final ResourceLocation PET_ARMOR_DISPLAY_TRANSPARENT = new ResourceLocation( - "notenoughupdates:petdisplay/petdisplayarmor_transparent.png"); - - private static boolean renderingArmorHud; - private static boolean renderingPetHud; - public static boolean shouldUseCachedPet; - public static long cachedPetTimer; - private final NEUManager manager; private final String mobRegex = ".*?((_MONSTER)|(_NPC)|(_ANIMAL)|(_MINIBOSS)|(_BOSS)|(_SC))$"; @@ -217,6 +166,7 @@ public class NEUOverlay extends Gui { private List selectedItemGroup = null; private boolean itemPaneOpen = false; + private long itemPaneShouldOpen = -1; private int page = 0; @@ -292,12 +242,14 @@ public class NEUOverlay extends Gui { } if (Mouse.getEventButtonState()) { setSearchBarFocus(true); + if (Mouse.getEventButton() == 1) { //Right mouse button down textField.setText(""); updateSearch(); } else { if (System.currentTimeMillis() - millisLastLeftClick < 300) { searchMode = !searchMode; + itemPaneShouldOpen = -1; lastSearchMode = System.currentTimeMillis(); if (searchMode && NotEnoughUpdates.INSTANCE.config.hidden.firstTimeSearchFocus) { NotificationHandler.displayNotification(Lists.newArrayList( @@ -1836,85 +1788,6 @@ public class NEUOverlay extends Gui { int guiScaleLast = 0; private boolean showVanillaLast = false; - - private boolean wardrobeOpen = false; - - private boolean isInNamedGui(String guiName) { - GuiScreen guiScreen = Minecraft.getMinecraft().currentScreen; - if (guiScreen instanceof GuiChest) { - GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; - ContainerChest container = (ContainerChest) chest.inventorySlots; - IInventory lower = container.getLowerChestInventory(); - String containerName = lower.getDisplayName().getUnformattedText(); - wardrobeOpen = containerName.contains(guiName); - } - if (guiScreen instanceof GuiInventory) { - wardrobeOpen = false; - } - return wardrobeOpen; - } - - private ItemStack getChestSlotsAsItemStack(int slot) { - GuiScreen guiScreen = Minecraft.getMinecraft().currentScreen; - if (guiScreen instanceof GuiChest) { - GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; - return chest.inventorySlots.getSlot(slot).getStack(); - } else { - return null; - } - } - - public ItemStack slot1 = null; - public ItemStack slot2 = null; - public ItemStack slot3 = null; - public ItemStack slot4 = null; - public ItemStack petSlot = null; - private String lastProfile; - - private ItemStack getWardrobeSlot(int armourSlot) { - if (SBInfo.getInstance().currentProfile == null) { - return null; - } - - if (!Objects.equals(SBInfo.getInstance().currentProfile, lastProfile)) { - lastProfile = SBInfo.getInstance().currentProfile; - slot1 = null; - slot2 = null; - slot3 = null; - slot4 = null; - petSlot = null; - } - - if (isInNamedGui("Your Equipment")) { - ItemStack itemStack = getChestSlotsAsItemStack(armourSlot); - if (itemStack != null) { - JsonObject itemToSave = NotEnoughUpdates.INSTANCE.manager.getJsonForItem(itemStack); - if (!itemToSave.has("internalname")) { - //would crash without internalName when trying to construct the ItemStack again - itemToSave.add("internalname", new JsonPrimitive("_")); - } - NotEnoughUpdates.INSTANCE.config.getProfileSpecific().savedEquipment.put(armourSlot, itemToSave); - return itemStack; - } - } else { - if (NotEnoughUpdates.INSTANCE.config.getProfileSpecific().savedEquipment.containsKey(armourSlot)) { - //don't use cache since the internalName is identical in most cases - return NotEnoughUpdates.INSTANCE.manager.jsonToStack(NotEnoughUpdates.INSTANCE.config.getProfileSpecific().savedEquipment - .get(armourSlot) - .getAsJsonObject(), false); - } - } - return null; - } - - public static boolean isRenderingArmorHud() { - return renderingArmorHud; - } - - public static boolean isRenderingPetHud() { - return renderingPetHud; - } - /** * Renders the search bar, quick commands, item selection (right), item info (left) and armor hud gui elements. */ @@ -1922,8 +1795,6 @@ public class NEUOverlay extends Gui { if (disabled) { return; } - renderingArmorHud = false; - renderingPetHud = false; GlStateManager.enableDepth(); FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; @@ -1984,6 +1855,13 @@ public class NEUOverlay extends Gui { (int) (fgFavourite2.getBlue() * 0.8f), fgFavourite2.getAlpha() ); + if (!NotEnoughUpdates.INSTANCE.config.itemlist.openWhenSearching && searchMode) { + itemPaneOpen = false; + } + if (itemPaneShouldOpen != -1 && System.currentTimeMillis() > itemPaneShouldOpen) { + itemPaneOpen = true; + itemPaneShouldOpen = -1; + } if (itemPaneOpen) { if (itemPaneTabOffset.getValue() == 0) { if (itemPaneOffsetFactor.getTarget() != 2 / 3f) { @@ -2321,7 +2199,6 @@ public class NEUOverlay extends Gui { GlStateManager.enableAlpha(); GlStateManager.alphaFunc(516, 0.1F); GlStateManager.disableLighting(); - renderInfoHuds(); Utils.pushGuiScale(-1); if (System.currentTimeMillis() - lastSearchMode > 120000 && @@ -2331,303 +2208,6 @@ public class NEUOverlay extends Gui { } } - void renderInfoHuds() { - FontRenderer fr = Minecraft.getMinecraft().fontRendererObj; - - Utils.resetGuiScale(); - Utils.pushGuiScale(Minecraft.getMinecraft().gameSettings.guiScale); - - int width = Utils.peekGuiScale().getScaledWidth(); - int height = Utils.peekGuiScale().getScaledHeight(); - int mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth; - int mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1; - GuiScreen guiScreen = Minecraft.getMinecraft().currentScreen; - - if (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud && - NotEnoughUpdates.INSTANCE.config.misc.hidePotionEffect - && NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) { - if (getWardrobeSlot(10) != null) { - slot1 = getWardrobeSlot(10); - slot2 = getWardrobeSlot(19); - slot3 = getWardrobeSlot(28); - slot4 = getWardrobeSlot(37); - } - if (guiScreen instanceof GuiInventory) { - renderingArmorHud = true; - - List tooltipToDisplay = null; - if (NotEnoughUpdates.INSTANCE.config.customArmour.colourStyle == 0) { - Minecraft.getMinecraft().getTextureManager().bindTexture(ARMOR_DISPLAY); - } - if (NotEnoughUpdates.INSTANCE.config.customArmour.colourStyle == 1) { - Minecraft.getMinecraft().getTextureManager().bindTexture(ARMOR_DISPLAY_GREY); - } - if (NotEnoughUpdates.INSTANCE.config.customArmour.colourStyle == 2) { - Minecraft.getMinecraft().getTextureManager().bindTexture(ARMOR_DISPLAY_DARK); - } - if (NotEnoughUpdates.INSTANCE.config.customArmour.colourStyle == 3) { - if (NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle == 3 && - NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay && petSlot != null) { - Minecraft.getMinecraft().getTextureManager().bindTexture(ARMOR_DISPLAY_TRANSPARENT_PET); - } else { - Minecraft.getMinecraft().getTextureManager().bindTexture(ARMOR_DISPLAY_TRANSPARENT); - } - } - if (NotEnoughUpdates.INSTANCE.config.customArmour.colourStyle == 4) { - Minecraft.getMinecraft().getTextureManager().bindTexture(ARMOR_DISPLAY_FSR); - } - - GlStateManager.color(1, 1, 1, 1); - GL11.glTranslatef(0, 0, 401); - float yNumber = (float) (height - 167) / 2f; - Utils.drawTexturedRect((float) ((width - 224.1) / 2f), yNumber, 31, 86, GL11.GL_NEAREST); - GlStateManager.bindTexture(0); - - Utils.drawItemStack(slot1, (int) ((width - 208) / 2f), (int) ((height + 60) / 2f - 105), true); - Utils.drawItemStack(slot2, (int) ((width - 208) / 2f), (int) ((height + 60) / 2f - 105) + 18, true); - Utils.drawItemStack(slot3, (int) ((width - 208) / 2f), (int) ((height + 60) / 2f - 105) + 36, true); - Utils.drawItemStack(slot4, (int) ((width - 208) / 2f), (int) ((height + 60) / 2f - 105) + 54, true); - if (slot1 == null) { - Minecraft.getMinecraft().getTextureManager().bindTexture(QUESTION_MARK); - GlStateManager.color(1, 1, 1, 1); - Utils.drawTexturedRect(((width - 208) / 2f), ((height + 60) / 2f - 105), 16, 16, GL11.GL_NEAREST); - GlStateManager.bindTexture(0); - - tooltipToDisplay = Lists.newArrayList( - EnumChatFormatting.RED + "Warning", - EnumChatFormatting.GREEN + "You need to open /equipment", - EnumChatFormatting.GREEN + "To cache your armour" - ); - if (mouseX >= ((width - 208) / 2f) && mouseX < ((width - 208) / 2f) + 16) { - if (mouseY >= ((height + 60) / 2f - 105) && mouseY <= ((height + 60) / 2f - 105) + 70 && - NotEnoughUpdates.INSTANCE.config.customArmour.sendWardrobeCommand) { - if (Minecraft.getMinecraft().thePlayer.inventory.getItemStack() == null) { - if (Mouse.getEventButtonState()) { - if (ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/equipment") == - 0) { - NotEnoughUpdates.INSTANCE.sendChatMessage("/equipment"); - } - } - } - } - if (mouseY >= ((height + 60) / 2f - 105) && mouseY <= ((height + 60) / 2f - 105) + 16) { - Utils.drawHoveringText(tooltipToDisplay, mouseX, mouseY, width, height, -1, fr); - } - } - GL11.glTranslatef(0, 0, -401); - } - if (slot1 != null && slot2 != null && slot3 != null && slot4 != null) { - if (mouseX >= ((width - 208) / 2f) && mouseX < ((width - 208) / 2f) + 16) { - if (mouseY >= ((height + 60) / 2f - 105) && mouseY <= ((height + 60) / 2f - 105) + 70 && - NotEnoughUpdates.INSTANCE.config.customArmour.sendWardrobeCommand) { - if (Minecraft.getMinecraft().thePlayer.inventory.getItemStack() == null) { - if (Mouse.getEventButtonState()) { - if (ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/equipment") == - 0) { - NotEnoughUpdates.INSTANCE.sendChatMessage("/equipment"); - } - } - } - } - - if (mouseY >= ((height + 60) / 2f - 105) && mouseY <= ((height + 60) / 2f - 105) + 16) { - tooltipToDisplay = slot1.getTooltip(Minecraft.getMinecraft().thePlayer, false); - if (shouldShowEquipmentTooltip(tooltipToDisplay)) { - Utils.drawHoveringText( - tooltipToDisplay, - mouseX - calculateTooltipXOffset(tooltipToDisplay, fr), - mouseY, - width, - height, - -1, - fr - ); - } - } - if (mouseY >= ((height + 60) / 2f - 105) + 18 && mouseY <= ((height + 60) / 2f - 105) + 34) { - tooltipToDisplay = slot2.getTooltip(Minecraft.getMinecraft().thePlayer, false); - if (shouldShowEquipmentTooltip(tooltipToDisplay)) { - Utils.drawHoveringText( - tooltipToDisplay, - mouseX - calculateTooltipXOffset(tooltipToDisplay, fr), - mouseY, - width, - height, - -1, - fr - ); - } - } - if (mouseY >= ((height + 60) / 2f - 105) + 36 && mouseY <= ((height + 60) / 2f - 105) + 52) { - tooltipToDisplay = slot3.getTooltip(Minecraft.getMinecraft().thePlayer, false); - if (shouldShowEquipmentTooltip(tooltipToDisplay)) { - Utils.drawHoveringText( - tooltipToDisplay, - mouseX - calculateTooltipXOffset(tooltipToDisplay, fr), - mouseY, - width, - height, - -1, - fr - ); - } - } - if (mouseY >= ((height + 60) / 2f - 105) + 54 && mouseY <= ((height + 60) / 2f - 105) + 70) { - tooltipToDisplay = slot4.getTooltip(Minecraft.getMinecraft().thePlayer, false); - if (shouldShowEquipmentTooltip(tooltipToDisplay)) { - Utils.drawHoveringText( - tooltipToDisplay, - mouseX - calculateTooltipXOffset(tooltipToDisplay, fr), - mouseY, - width, - height, - -1, - fr - ); - } - } - } - GL11.glTranslatef(0, 0, -401); - } - } - } - if (PetInfoOverlay.getCurrentPet() != null) { - if (NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay - && (NotEnoughUpdates.INSTANCE.manager - .jsonToStack(NotEnoughUpdates.INSTANCE.manager - .getItemInformation() - .get(PetInfoOverlay.getCurrentPet().petType + ";" + PetInfoOverlay.getCurrentPet().rarity.petId)) - .hasDisplayName() - || NotEnoughUpdates.INSTANCE.manager - .jsonToStack(NotEnoughUpdates.INSTANCE.manager - .getItemInformation() - .get(PetInfoOverlay.getCurrentPet().petType + ";" + (PetInfoOverlay.getCurrentPet().rarity.petId - 1))) - .hasDisplayName()) - && NotEnoughUpdates.INSTANCE.config.misc.hidePotionEffect && - NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) { - if (!NotEnoughUpdates.INSTANCE.manager - .jsonToStack( - NotEnoughUpdates.INSTANCE.manager - .getItemInformation() - .get(PetInfoOverlay.getCurrentPet().petType + ";" + PetInfoOverlay.getCurrentPet().rarity.petId)) - .hasDisplayName()) { - petSlot = NotEnoughUpdates.INSTANCE.manager.jsonToStack( - NotEnoughUpdates.INSTANCE.manager.getItemInformation().get( - PetInfoOverlay.getCurrentPet().petType + ";" + (PetInfoOverlay.getCurrentPet().rarity.petId - 1))); - } else { - petSlot = NotEnoughUpdates.INSTANCE.manager.jsonToStack( - NotEnoughUpdates.INSTANCE.manager.getItemInformation().get( - PetInfoOverlay.getCurrentPet().petType + ";" + PetInfoOverlay.getCurrentPet().rarity.petId)); - } - if (petSlot == null) { - return; - } - petSlot.getTagCompound().setBoolean( - "NEUHIDEPETTOOLTIP", - NotEnoughUpdates.INSTANCE.config.petOverlay.hidePetTooltip - ); - ItemStack petInfo = petSlot; - - if (guiScreen instanceof GuiInventory) { - GL11.glTranslatef(0, 0, 401); - if (!NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud) { - if (NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle == 0) { - Minecraft.getMinecraft().getTextureManager().bindTexture(PET_DISPLAY); - } - if (NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle == 1) { - Minecraft.getMinecraft().getTextureManager().bindTexture(PET_DISPLAY_GREY); - } - if (NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle == 2) { - Minecraft.getMinecraft().getTextureManager().bindTexture(PET_DISPLAY_DARK); - } - if (NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle == 3) { - Minecraft.getMinecraft().getTextureManager().bindTexture(PET_DISPLAY_TRANSPARENT); - } - if (NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle == 4) { - Minecraft.getMinecraft().getTextureManager().bindTexture(PET_DISPLAY_FSR); - } - } else { - if (NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle == 0) { - Minecraft.getMinecraft().getTextureManager().bindTexture(PET_ARMOR_DISPLAY); - } - if (NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle == 1) { - Minecraft.getMinecraft().getTextureManager().bindTexture(PET_ARMOR_DISPLAY_GREY); - } - if (NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle == 2) { - Minecraft.getMinecraft().getTextureManager().bindTexture(PET_ARMOR_DISPLAY_DARK); - } - if (NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle == 3) { - Minecraft.getMinecraft().getTextureManager().bindTexture(PET_ARMOR_DISPLAY_TRANSPARENT); - } - if (NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle == 4) { - Minecraft.getMinecraft().getTextureManager().bindTexture(PET_ARMOR_DISPLAY_FSR); - } - } - - GlStateManager.color(1, 1, 1, 1); - float yNumber = (float) (height - 23) / 2f; - Utils.drawTexturedRect((float) ((width - 224.1) / 2f), yNumber, 31, 32, GL11.GL_NEAREST); - GlStateManager.bindTexture(0); - - Utils.drawItemStack(petInfo, (int) ((width - 208) / 2f), (int) ((height + 60) / 2f - 105) + 72, true); - renderingPetHud = true; - - List tooltipToDisplay = null; - if (petInfo != null) { - if (mouseX >= ((width - 208) / 2f) && mouseX < ((width - 208) / 2f) + 16) { - if (mouseY >= ((height + 60) / 2f - 105) + 72 && mouseY <= ((height + 60) / 2f - 105) + 88 && - NotEnoughUpdates.INSTANCE.config.petOverlay.sendPetsCommand) { - if (Minecraft.getMinecraft().thePlayer.inventory.getItemStack() == null) { - if (Mouse.getEventButtonState()) { - if (ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/pets") == - 0) { - NotEnoughUpdates.INSTANCE.sendChatMessage("/pets"); - } - } - } - tooltipToDisplay = petInfo.getTooltip(Minecraft.getMinecraft().thePlayer, false); - Utils.drawHoveringText( - tooltipToDisplay, - mouseX - calculateTooltipXOffset(tooltipToDisplay, fr), - mouseY, - width, - height, - -1, - fr - ); - GL11.glTranslatef(0, 0, -80); - } - } - - } - } - } - } - } - - /** - * Calculates the width of the longest String in the tooltip, which can be used to offset the entire tooltip to the left more precisely - * - * @param tooltipToDisplay tooltip - * @param fr FontRenderer object - * @return offset to apply - */ - private int calculateTooltipXOffset(List tooltipToDisplay, FontRenderer fr) { - int offset = 0; - if (tooltipToDisplay != null) { - for (String line : tooltipToDisplay) { - int lineWidth = fr.getStringWidth(line); - if (lineWidth > offset) { - offset = lineWidth; - } - } - } - return offset + 20; - } - - private boolean shouldShowEquipmentTooltip(List toolTip) { - return !toolTip.get(0).equals("§o§7Empty Equipment Slot§r"); - } /** * Used in SettingsInfoPane to redraw the items when a setting changes. diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 6732336c..c4b1bd77 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -66,6 +66,7 @@ import io.github.moulberry.notenoughupdates.miscgui.SignCalculator; import io.github.moulberry.notenoughupdates.miscgui.TrophyRewardOverlay; import io.github.moulberry.notenoughupdates.mixins.AccessorMinecraft; import io.github.moulberry.notenoughupdates.options.NEUConfig; +import io.github.moulberry.notenoughupdates.overlays.EquipmentOverlay; import io.github.moulberry.notenoughupdates.overlays.FuelBar; import io.github.moulberry.notenoughupdates.overlays.OverlayManager; import io.github.moulberry.notenoughupdates.profileviewer.ProfileViewer; @@ -89,6 +90,7 @@ import net.minecraft.world.biome.BiomeGenHell; import net.minecraft.world.biome.BiomeGenJungle; import net.minecraft.world.biome.BiomeGenMesa; import net.minecraft.world.biome.BiomeGenSnow; +import net.minecraftforge.client.ClientCommandHandler; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.client.registry.ClientRegistry; @@ -243,7 +245,6 @@ public class NotEnoughUpdates { config.apiKey = null; } - //add the trophy fishing tab to the config if (config.profileViewer.pageLayout.size() == 8) { config.profileViewer.pageLayout.add(8); @@ -282,6 +283,7 @@ public class NotEnoughUpdates { MinecraftForge.EVENT_BUS.register(FishingHelper.getInstance()); MinecraftForge.EVENT_BUS.register(CrystalWishingCompassSolver.getInstance()); MinecraftForge.EVENT_BUS.register(new DwarvenMinesTextures()); + MinecraftForge.EVENT_BUS.register(EquipmentOverlay.INSTANCE); MinecraftForge.EVENT_BUS.register(CustomBiomes.INSTANCE); MinecraftForge.EVENT_BUS.register(new ChatListener(this)); MinecraftForge.EVENT_BUS.register(new ItemTooltipListener(this)); @@ -380,6 +382,12 @@ public class NotEnoughUpdates { } } + public void trySendCommand(String message) { + if (ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, message) == 0) { + sendChatMessage(message); + } + } + public void displayLinks(JsonObject update, int totalWidth) { String discord_link = update.get("discord_link").getAsString(); String youtube_link = update.get("youtube_link").getAsString(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/events/GuiInventoryBackgroundDrawnEvent.java b/src/main/java/io/github/moulberry/notenoughupdates/events/GuiInventoryBackgroundDrawnEvent.java new file mode 100644 index 00000000..0b8bf126 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/events/GuiInventoryBackgroundDrawnEvent.java @@ -0,0 +1,40 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.events; + +import net.minecraft.client.gui.inventory.GuiContainer; + +public class GuiInventoryBackgroundDrawnEvent extends NEUEvent { + private final GuiContainer container; + private final float partialTicks; + + public GuiInventoryBackgroundDrawnEvent(GuiContainer container, float partialTicks) { + this.container = container; + this.partialTicks = partialTicks; + } + + public GuiContainer getContainer() { + return container; + } + + public float getPartialTicks() { + return partialTicks; + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java index 166e46d0..d4df7bfd 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -53,6 +53,7 @@ import io.github.moulberry.notenoughupdates.miscgui.TrophyRewardOverlay; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; import io.github.moulberry.notenoughupdates.options.NEUConfig; import io.github.moulberry.notenoughupdates.overlays.AuctionSearchOverlay; +import io.github.moulberry.notenoughupdates.overlays.EquipmentOverlay; import io.github.moulberry.notenoughupdates.overlays.BazaarSearchOverlay; import io.github.moulberry.notenoughupdates.overlays.OverlayManager; import io.github.moulberry.notenoughupdates.overlays.RancherBootOverlay; @@ -534,12 +535,12 @@ public class RenderListener { x -= 68 - 200; } } - if (NEUOverlay.isRenderingArmorHud()) { + if (EquipmentOverlay.isRenderingArmorHud()) { if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop && y < guiTop + 84) { x -= 25; } } - if (NEUOverlay.isRenderingPetHud()) { + if (EquipmentOverlay.isRenderingPetHud()) { if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop + 60 && y < guiTop + 120) { x -= 25; } @@ -661,12 +662,12 @@ public class RenderListener { x -= 68 - 200; } } - if (NEUOverlay.isRenderingArmorHud()) { + if (EquipmentOverlay.isRenderingArmorHud()) { if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop && y < guiTop + 84) { x -= 25; } } - if (NEUOverlay.isRenderingPetHud()) { + if (EquipmentOverlay.isRenderingPetHud()) { if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop + 60 && y < guiTop + 120) { x -= 25; } @@ -1126,12 +1127,12 @@ public class RenderListener { x -= 68 - 200; } } - if (NEUOverlay.isRenderingArmorHud()) { + if (EquipmentOverlay.isRenderingArmorHud()) { if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop && y < guiTop + 84) { x -= 25; } } - if (NEUOverlay.isRenderingPetHud()) { + if (EquipmentOverlay.isRenderingPetHud()) { if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop + 60 && y < guiTop + 120) { x -= 25; } 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 90300bbc..f58ced51 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java @@ -26,13 +26,13 @@ import com.google.gson.JsonElement; import com.google.gson.JsonNull; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import io.github.moulberry.notenoughupdates.NEUOverlay; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.config.Position; import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpUtils; import io.github.moulberry.notenoughupdates.listener.RenderListener; import io.github.moulberry.notenoughupdates.options.NEUConfig; +import io.github.moulberry.notenoughupdates.overlays.EquipmentOverlay; import io.github.moulberry.notenoughupdates.overlays.TextOverlay; import io.github.moulberry.notenoughupdates.overlays.TextOverlayStyle; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; @@ -134,6 +134,12 @@ public class PetInfoOverlay extends TextOverlay { public String petXpType; public String petItem; public String skin; + + public String getPetId(boolean withoutBoost) { + return petType + ";" + (withoutBoost ? rarity.petId - 1 : rarity.petId); + + } + } public static class PetConfig { @@ -243,7 +249,8 @@ public class PetInfoOverlay extends TextOverlay { } private static Pet getClosestPet(String petType, int petId, String petItem, float petLevel) { - Set pets = config.petMap.values().stream().filter(pet -> pet.petType.equals(petType) && pet.rarity.petId == petId).collect( + Set pets = config.petMap.values().stream().filter(pet -> pet.petType.equals(petType) && + pet.rarity.petId == petId).collect( Collectors.toSet()); if (pets.isEmpty()) { @@ -254,7 +261,10 @@ public class PetInfoOverlay extends TextOverlay { return pets.iterator().next(); } - Set itemMatches = pets.stream().filter(pet -> Objects.equals(petItem, pet.petItem)).collect(Collectors.toSet()); + Set itemMatches = pets + .stream() + .filter(pet -> Objects.equals(petItem, pet.petItem)) + .collect(Collectors.toSet()); if (itemMatches.size() == 1) { return itemMatches.iterator().next(); @@ -452,11 +462,12 @@ public class PetInfoOverlay extends TextOverlay { } } - if (currentPet.petLevel.level < (currentPet.petLevel.maxLevel - 1) || !NotEnoughUpdates.INSTANCE.config.petOverlay.petOverlayText.contains(6)) { + if (currentPet.petLevel.level < (currentPet.petLevel.maxLevel - 1) || + !NotEnoughUpdates.INSTANCE.config.petOverlay.petOverlayText.contains(6)) { float remainingMax = currentPet.petLevel.maxXP - currentPet.petLevel.totalXp; if (remaining > 0) { if (xpGain < 1000) { - etaMaxStr = EnumChatFormatting.AQUA + "Until L" + currentPet.petLevel.maxLevel + ": " + + etaMaxStr = EnumChatFormatting.AQUA + "Until L" + currentPet.petLevel.maxLevel + ": " + EnumChatFormatting.YELLOW + "N/A"; } else { etaMaxStr = EnumChatFormatting.AQUA + "Until L" + currentPet.petLevel.maxLevel + ": " + @@ -563,7 +574,7 @@ public class PetInfoOverlay extends TextOverlay { JsonObject petInfo = new JsonParser().parse(ea.getString("petInfo")).getAsJsonObject(); petType = petInfo.get("type").getAsString(); rarity = Rarity.valueOf(petInfo.get("tier").getAsString()); - level = GuiProfileViewer. getPetLevel( + level = GuiProfileViewer.getPetLevel( petType, rarity.name(), Utils.getElementAsFloat(petInfo.get("exp"), 0) // Should only default if from item list and repo missing exp:0 @@ -782,7 +793,8 @@ public class PetInfoOverlay extends TextOverlay { if (currentPet.rarity.petId == 5) { mythicRarity = 4; } - JsonObject petItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(currentPet.skin != null ? currentPet.skin : (currentPet.petType + ";" + mythicRarity)); + JsonObject petItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get( + currentPet.skin != null ? currentPet.skin : (currentPet.petType + ";" + mythicRarity)); if (petItem != null) { Vector2f position = getPosition(overlayWidth, overlayHeight); int x = (int) position.x; @@ -799,7 +811,8 @@ public class PetInfoOverlay extends TextOverlay { Pet currentPet2 = getCurrentPet2(); if (currentPet2 != null) { - JsonObject petItem2 = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(currentPet2.skin != null ? currentPet2.skin : (currentPet2.petType + ";" + currentPet2.rarity.petId)); + JsonObject petItem2 = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get( + currentPet2.skin != null ? currentPet2.skin : (currentPet2.petType + ";" + currentPet2.rarity.petId)); if (petItem2 != null) { Vector2f position = getPosition(overlayWidth, overlayHeight); int x = (int) position.x; @@ -1037,12 +1050,7 @@ public class PetInfoOverlay extends TextOverlay { String chatMessage = Utils.cleanColour(event.message.getUnformattedText()); Matcher autopetMatcher = AUTOPET_EQUIP.matcher(event.message.getFormattedText()); - if (event.message.getUnformattedText().startsWith("You summoned your") || - System.currentTimeMillis() - NEUOverlay.cachedPetTimer < 500) { - NEUOverlay.cachedPetTimer = System.currentTimeMillis(); - NEUOverlay.shouldUseCachedPet = false; - } else if (autopetMatcher.matches()) { - NEUOverlay.shouldUseCachedPet = false; + if (autopetMatcher.matches()) { try { lastLevelHovered = Integer.parseInt(autopetMatcher.group(1)); } catch (NumberFormatException ignored) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiInventory.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiInventory.java index bd712ec7..86ed9b8f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiInventory.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiInventory.java @@ -20,7 +20,9 @@ package io.github.moulberry.notenoughupdates.mixins; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.events.GuiInventoryBackgroundDrawnEvent; import io.github.moulberry.notenoughupdates.listener.RenderListener; +import net.minecraft.client.gui.inventory.GuiContainer; import net.minecraft.client.gui.inventory.GuiInventory; import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.injection.At; @@ -36,4 +38,9 @@ public class MixinGuiInventory { ci.cancel(); } } + + @Inject(method = "drawGuiContainerBackgroundLayer", at = @At("TAIL")) + public void onDrawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY, CallbackInfo ci) { + new GuiInventoryBackgroundDrawnEvent((GuiContainer) (Object) this, partialTicks).post(); + } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Itemlist.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Itemlist.java index c83f370f..72a45930 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Itemlist.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Itemlist.java @@ -51,6 +51,15 @@ public class Itemlist { @ConfigEditorBoolean public boolean keepopen = false; + @Expose + @ConfigOption( + name = "Open when searching", + desc = "Open the Itemlist when in container search mode by double clicking the search bar" + ) + @ConfigEditorBoolean + public boolean openWhenSearching = true; + + @Expose @ConfigOption( name = "Item Style", diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java new file mode 100644 index 00000000..1bf61ad8 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java @@ -0,0 +1,431 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.overlays; + +import com.google.common.collect.Lists; +import com.google.gson.JsonObject; +import com.google.gson.JsonPrimitive; +import io.github.moulberry.notenoughupdates.NEUManager; +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.events.GuiInventoryBackgroundDrawnEvent; +import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; +import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; +import io.github.moulberry.notenoughupdates.options.NEUConfig; +import io.github.moulberry.notenoughupdates.util.ItemUtils; +import io.github.moulberry.notenoughupdates.util.SBInfo; +import io.github.moulberry.notenoughupdates.util.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.FontRenderer; +import net.minecraft.client.gui.GuiScreen; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.client.gui.inventory.GuiInventory; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.IInventory; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.ResourceLocation; +import net.minecraftforge.client.event.GuiScreenEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; +import net.minecraftforge.fml.common.gameevent.TickEvent; +import net.minecraftforge.fml.relauncher.Side; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; + +import java.util.ArrayList; +import java.util.List; +import java.util.Objects; + +public class EquipmentOverlay { + public static EquipmentOverlay INSTANCE = new EquipmentOverlay(); + + // + private static final ResourceLocation ARMOR_DISPLAY = new ResourceLocation( + "notenoughupdates:armordisplay/armordisplay.png"); + private static final ResourceLocation ARMOR_DISPLAY_GREY = new ResourceLocation( + "notenoughupdates:armordisplay/armordisplay_grey.png"); + private static final ResourceLocation ARMOR_DISPLAY_DARK = new ResourceLocation( + "notenoughupdates:armordisplay/armordisplay_phq_dark.png"); + private static final ResourceLocation ARMOR_DISPLAY_FSR = new ResourceLocation( + "notenoughupdates:armordisplay/armordisplay_fsr.png"); + private static final ResourceLocation ARMOR_DISPLAY_TRANSPARENT = new ResourceLocation( + "notenoughupdates:armordisplay/armordisplay_transparent.png"); + private static final ResourceLocation ARMOR_DISPLAY_TRANSPARENT_PET = new ResourceLocation( + "notenoughupdates:armordisplay/armordisplay_transparent_pet.png"); + + private static final ResourceLocation QUESTION_MARK = new ResourceLocation("notenoughupdates:pv_unknown.png"); + + private static final ResourceLocation PET_DISPLAY = new ResourceLocation( + "notenoughupdates:petdisplay/petdisplaysolo.png"); + private static final ResourceLocation PET_DISPLAY_GREY = new ResourceLocation( + "notenoughupdates:petdisplay/petdisplaysolo_dark.png"); + private static final ResourceLocation PET_DISPLAY_DARK = new ResourceLocation( + "notenoughupdates:petdisplay/petdisplaysolo_phqdark.png"); + private static final ResourceLocation PET_DISPLAY_FSR = new ResourceLocation( + "notenoughupdates:petdisplay/petdisplaysolo_fsr.png"); + private static final ResourceLocation PET_DISPLAY_TRANSPARENT = new ResourceLocation( + "notenoughupdates:petdisplay/petdisplaysolo_transparent.png"); + + private static final ResourceLocation PET_ARMOR_DISPLAY = new ResourceLocation( + "notenoughupdates:petdisplay/petdisplayarmor.png"); + private static final ResourceLocation PET_ARMOR_DISPLAY_GREY = new ResourceLocation( + "notenoughupdates:petdisplay/petdisplayarmor_dark.png"); + private static final ResourceLocation PET_ARMOR_DISPLAY_DARK = new ResourceLocation( + "notenoughupdates:petdisplay/petdisplayarmor_phqdark.png"); + private static final ResourceLocation PET_ARMOR_DISPLAY_FSR = new ResourceLocation( + "notenoughupdates:petdisplay/petdisplayarmor_fsr.png"); + private static final ResourceLocation PET_ARMOR_DISPLAY_TRANSPARENT = new ResourceLocation( + "notenoughupdates:petdisplay/petdisplayarmor_transparent.png"); + // + + // + public ResourceLocation getCustomEquipmentTexture(boolean isPetRendering) { + switch (NotEnoughUpdates.INSTANCE.config.customArmour.colourStyle) { + case 0: + return ARMOR_DISPLAY; + case 1: + return ARMOR_DISPLAY_GREY; + case 2: + return ARMOR_DISPLAY_DARK; + case 3: + return isPetRendering ? ARMOR_DISPLAY_TRANSPARENT_PET : ARMOR_DISPLAY_TRANSPARENT; + case 4: + return ARMOR_DISPLAY_FSR; + } + return null; + } + + public ResourceLocation getCustomPetTexture(boolean isArmorRendering) { + switch (NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle) { + case 0: + return isArmorRendering ? PET_ARMOR_DISPLAY : PET_DISPLAY; + case 1: + return isArmorRendering ? PET_ARMOR_DISPLAY_GREY : PET_DISPLAY_GREY; + case 2: + return isArmorRendering ? PET_ARMOR_DISPLAY_DARK : PET_DISPLAY_DARK; + case 3: + return isArmorRendering ? PET_ARMOR_DISPLAY_TRANSPARENT : PET_DISPLAY_TRANSPARENT; + case 4: + return isArmorRendering ? PET_ARMOR_DISPLAY_FSR : PET_DISPLAY_FSR; + } + return null; + } + // + + // + public static final int EQUIPMENT_SLOT_OFFSET_Y = 8; + public static final int ARMOR_OVERLAY_OVERHAND_WIDTH = 24; + public static final int ARMOR_OVERLAY_HEIGHT = 86; + public static final int ARMOR_OVERLAY_WIDTH = 31; + public static final int PET_OVERLAY_OFFSET_Y = ARMOR_OVERLAY_HEIGHT - 14 /* overlaying pixels */; + // + + public boolean isRenderingPet; + + public boolean shouldRenderPets; + public boolean shouldRenderArmorHud; + + public ItemStack petStack; + + // + + @SubscribeEvent + public void onGuiTick(TickEvent.ClientTickEvent event) { + if (event.phase != TickEvent.Phase.START || event.side != Side.CLIENT) return; + updateGuiInfo(Minecraft.getMinecraft().currentScreen); + } + + @SubscribeEvent + public void onGuiInit(GuiScreenEvent.InitGuiEvent event) { + updateGuiInfo(event.gui); + } + + @SubscribeEvent + public void onRenderGuiPost(GuiInventoryBackgroundDrawnEvent event) { + if (!(event.getContainer() instanceof GuiInventory)) return; + GuiInventory inventory = ((GuiInventory) event.getContainer()); + renderGuis(inventory); + } + + // + + public void renderGuis(GuiInventory inventory) { + int width = Utils.peekGuiScale().getScaledWidth(); + int height = Utils.peekGuiScale().getScaledHeight(); + int mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth; + int mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1; + + GL11.glColor4f(1F, 1F, 1F, 1F); + if (shouldRenderArmorHud) { + renderEquipmentGui(inventory, mouseX, mouseY, width, height); + } + + if (shouldRenderPets) { + renderPets(inventory, mouseX, mouseY, width, height); + } + } + + public void renderEquipmentGui(GuiInventory guiScreen, int mouseX, int mouseY, int width, int height) { + AccessorGuiContainer container = ((AccessorGuiContainer) guiScreen); + + int overlayLeft = container.getGuiLeft() - ARMOR_OVERLAY_OVERHAND_WIDTH; + int overlayTop = container.getGuiTop(); + + ResourceLocation equipmentTexture = getCustomEquipmentTexture(isRenderingPet); + Minecraft.getMinecraft().getTextureManager().bindTexture(equipmentTexture); + + Utils.drawTexturedRect(overlayLeft, overlayTop, ARMOR_OVERLAY_WIDTH, ARMOR_OVERLAY_HEIGHT, GL11.GL_NEAREST); + + List tooltipToDisplay = new ArrayList<>(); + drawSlot(slot1, overlayLeft + 8, overlayTop + EQUIPMENT_SLOT_OFFSET_Y, mouseX, mouseY, tooltipToDisplay); + drawSlot(slot2, overlayLeft + 8, overlayTop + EQUIPMENT_SLOT_OFFSET_Y + 18, mouseX, mouseY, tooltipToDisplay); + drawSlot(slot3, overlayLeft + 8, overlayTop + EQUIPMENT_SLOT_OFFSET_Y + 36, mouseX, mouseY, tooltipToDisplay); + drawSlot(slot4, overlayLeft + 8, overlayTop + EQUIPMENT_SLOT_OFFSET_Y + 54, mouseX, mouseY, tooltipToDisplay); + + if (slot1 == null) { + Minecraft.getMinecraft().getTextureManager().bindTexture(QUESTION_MARK); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(overlayLeft + 8, overlayTop + EQUIPMENT_SLOT_OFFSET_Y, 16, 16, GL11.GL_NEAREST); + + tooltipToDisplay = Lists.newArrayList( + EnumChatFormatting.RED + "Warning", + EnumChatFormatting.GREEN + "You need to open /equipment", + EnumChatFormatting.GREEN + "to cache your armour" + ); + if (Utils.isWithinRect(mouseX, mouseY, overlayLeft + 8, overlayTop + 8, 16, 16) + && NotEnoughUpdates.INSTANCE.config.customArmour.sendWardrobeCommand + && Mouse.getEventButtonState() + && Minecraft.getMinecraft().thePlayer.inventory.getItemStack() == null) { + NotEnoughUpdates.INSTANCE.trySendCommand("/equipment"); + } + + } + if (tooltipToDisplay.size() > 0 && + Utils.isWithinRect( + mouseX, mouseY, + overlayLeft, overlayTop, + ARMOR_OVERLAY_OVERHAND_WIDTH, ARMOR_OVERLAY_HEIGHT + )) { + Utils.drawHoveringText( + tooltipToDisplay, + mouseX - calculateTooltipXOffset(tooltipToDisplay, Minecraft.getMinecraft().fontRendererObj), + mouseY, + width, + height, + -1, + Minecraft.getMinecraft().fontRendererObj + ); + } + + } + + private ItemStack getRepoPetStack() { + NEUManager manager = NotEnoughUpdates.INSTANCE.manager; + PetInfoOverlay.Pet currentPet = PetInfoOverlay.getCurrentPet(); + if (currentPet == null) return null; + ItemStack item = manager.createItem(currentPet.getPetId(false)); + if (item != null) { + return item; + } + item = manager.createItem(currentPet.getPetId(true)); + return item; + } + + private void updateGuiInfo(GuiScreen screen) { + if (getWardrobeSlot(10) != null) { + slot1 = getWardrobeSlot(10); + slot2 = getWardrobeSlot(19); + slot3 = getWardrobeSlot(28); + slot4 = getWardrobeSlot(37); + } + + if (screen instanceof GuiChest) { + petStack = getRepoPetStack(); + } + if (!(screen instanceof GuiInventory) + || !NotEnoughUpdates.INSTANCE.config.misc.hidePotionEffect + || !NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) { + shouldRenderPets = shouldRenderArmorHud = false; + return; + } + shouldRenderPets = NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay && petStack != null; + shouldRenderArmorHud = NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud; + } + + private void drawSlot(ItemStack stack, int x, int y, int mouseX, int mouseY, List tooltip) { + if (stack == null) return; + Utils.drawItemStack(stack, x, y, true); + if (Utils.isWithinRect(mouseX, mouseY, x, y, 16, 16)) { + List tt = stack.getTooltip(Minecraft.getMinecraft().thePlayer, false); + if (shouldShowEquipmentTooltip(tt)) + tooltip.addAll(tt); + if (NotEnoughUpdates.INSTANCE.config.customArmour.sendWardrobeCommand + && Mouse.getEventButtonState()) { + NotEnoughUpdates.INSTANCE.trySendCommand("/equipment"); + } + } + } + + public void renderPets(GuiInventory inventory, int mouseX, int mouseY, int width, int height) { + ItemUtils.getOrCreateTag(petStack).setBoolean( + "NEUHIDEPETTOOLTIP", + NotEnoughUpdates.INSTANCE.config.petOverlay.hidePetTooltip + ); + ItemStack petInfo = petStack; + + ResourceLocation customPetTexture = getCustomPetTexture(isRenderingArmorHud()); + Minecraft.getMinecraft().getTextureManager().bindTexture(customPetTexture); + GlStateManager.color(1, 1, 1, 1); + + AccessorGuiContainer container = ((AccessorGuiContainer) inventory); + + int overlayLeft = container.getGuiLeft() - ARMOR_OVERLAY_OVERHAND_WIDTH; + int overlayTop = container.getGuiTop() + PET_OVERLAY_OFFSET_Y; + + Utils.drawTexturedRect(overlayLeft, overlayTop, 31, 32, GL11.GL_NEAREST); + GlStateManager.bindTexture(0); + + Utils.drawItemStack(petInfo, overlayLeft + 8, overlayTop + 8, true); + + List tooltipToDisplay; + if (Utils.isWithinRect(mouseX, mouseY, overlayLeft + 8, overlayTop + 8, 16, 16)) { + if (NotEnoughUpdates.INSTANCE.config.petOverlay.sendPetsCommand + && Minecraft.getMinecraft().thePlayer.inventory.getItemStack() == null + && Mouse.getEventButtonState()) { + NotEnoughUpdates.INSTANCE.trySendCommand("/pets"); + } + tooltipToDisplay = petInfo.getTooltip(Minecraft.getMinecraft().thePlayer, false); + Utils.drawHoveringText( + tooltipToDisplay, + mouseX - calculateTooltipXOffset(tooltipToDisplay, Minecraft.getMinecraft().fontRendererObj), + mouseY, + width, + height, + -1, + Minecraft.getMinecraft().fontRendererObj + ); + } + } + + private ItemStack getWardrobeSlot(int armourSlot) { + if (SBInfo.getInstance().currentProfile == null) { + return null; + } + + if (!Objects.equals(SBInfo.getInstance().currentProfile, lastProfile)) { + lastProfile = SBInfo.getInstance().currentProfile; + slot1 = null; + slot2 = null; + slot3 = null; + slot4 = null; + } + + NEUConfig.HiddenProfileSpecific profileSpecific = NotEnoughUpdates.INSTANCE.config.getProfileSpecific(); + if (profileSpecific == null) return null; + + if (isInNamedGui("Your Equipment")) { + ItemStack itemStack = getChestSlotsAsItemStack(armourSlot); + if (itemStack != null) { + JsonObject itemToSave = NotEnoughUpdates.INSTANCE.manager.getJsonForItem(itemStack); + if (!itemToSave.has("internalname")) { + //would crash without internalName when trying to construct the ItemStack again + itemToSave.add("internalname", new JsonPrimitive("_")); + } + profileSpecific.savedEquipment.put(armourSlot, itemToSave); + return itemStack; + } + } else { + if (profileSpecific.savedEquipment.containsKey(armourSlot)) { + //don't use cache since the internalName is identical in most cases + JsonObject jsonObject = profileSpecific.savedEquipment + .get(armourSlot); + if (jsonObject != null) return NotEnoughUpdates.INSTANCE.manager.jsonToStack(jsonObject + .getAsJsonObject(), false); + } + } + return null; + } + + private boolean wardrobeOpen = false; + + private boolean isInNamedGui(String guiName) { + GuiScreen guiScreen = Minecraft.getMinecraft().currentScreen; + if (guiScreen instanceof GuiChest) { + GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; + ContainerChest container = (ContainerChest) chest.inventorySlots; + IInventory lower = container.getLowerChestInventory(); + String containerName = lower.getDisplayName().getUnformattedText(); + wardrobeOpen = containerName.contains(guiName); + } + if (guiScreen instanceof GuiInventory) { + wardrobeOpen = false; + } + return wardrobeOpen; + } + + private ItemStack getChestSlotsAsItemStack(int slot) { + GuiScreen guiScreen = Minecraft.getMinecraft().currentScreen; + if (guiScreen instanceof GuiChest) { + GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; + return chest.inventorySlots.getSlot(slot).getStack(); + } else { + return null; + } + } + + public static boolean isRenderingArmorHud() { + return INSTANCE.shouldRenderArmorHud; + } + + public static boolean isRenderingPetHud() { + return INSTANCE.shouldRenderPets; + } + + private boolean shouldShowEquipmentTooltip(List toolTip) { + return !toolTip.get(0).equals("§o§7Empty Equipment Slot§r"); + } + + /** + * Calculates the width of the longest String in the tooltip, which can be used to offset the entire tooltip to the left more precisely + * + * @param tooltipToDisplay tooltip + * @param fr FontRenderer object + * @return offset to apply + */ + private int calculateTooltipXOffset(List tooltipToDisplay, FontRenderer fr) { + int offset = 0; + if (tooltipToDisplay != null) { + for (String line : tooltipToDisplay) { + int lineWidth = fr.getStringWidth(line); + if (lineWidth > offset) { + offset = lineWidth; + } + } + } + return offset + 20; + } + + public ItemStack slot1 = null; + public ItemStack slot2 = null; + public ItemStack slot3 = null; + public ItemStack slot4 = null; + private String lastProfile; + +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java index cffdd164..ad8a6c98 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java @@ -57,6 +57,13 @@ public class ItemUtils { return skull; } + public static NBTTagCompound getOrCreateTag(ItemStack is) { + if (is.hasTagCompound()) return is.getTagCompound(); + NBTTagCompound nbtTagCompound = new NBTTagCompound(); + is.setTagCompound(nbtTagCompound); + return nbtTagCompound; + } + public static void appendLore(ItemStack is, List moreLore) { NBTTagCompound tagCompound = is.getTagCompound(); if (tagCompound == null) { -- cgit From ef557a6f4dff5ed9ce13f26f41b55c60008e8eae Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sun, 11 Sep 2022 22:11:26 +1000 Subject: fixed backpacks when dont have fairy soul req (#264) --- Update Notes/2.1.md | 1 + .../miscfeatures/StorageManager.java | 8 ++-- .../notenoughupdates/miscgui/StorageOverlay.java | 2 +- .../notenoughupdates/overlays/MiningOverlay.java | 1 + .../profileviewer/GuiProfileViewer.java | 45 +++++++++++++++++----- .../profileviewer/bestiary/BestiaryPage.java | 17 +++++--- 6 files changed, 54 insertions(+), 20 deletions(-) diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index b820ee79..9c73e649 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -148,6 +148,7 @@ - Fixed shortened damage - nopo - Fixed bazaar prices sorting order in neu item list - hannibal2 - Fixed priceless items showing first in the missing tab of the accessory bag overlay - nopo +- Fixed storage gui when having locked backpack slots - nopo ### **Other:** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java index 680637f2..cc463308 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java @@ -38,6 +38,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.IInventory; import net.minecraft.item.Item; @@ -555,8 +556,8 @@ public class StorageManager { int index = slot - 9; boolean changed = false; - if (stack.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane) && - stack.getMetadata() == 14) { + if ((stack.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane) && + stack.getMetadata() == 14) || (stack.getItem() == Items.dye && stack.getMetadata() == 8)) { if (storagePresent[index]) changed = true; storagePresent[index] = false; removePage(index); @@ -596,7 +597,8 @@ public class StorageManager { boolean changed = false; - if (stack.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane)) { + if (stack.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane) + || (stack.getItem() == Items.dye && stack.getMetadata() == 8)) { if (storagePresent[index]) changed = true; storagePresent[index] = false; removePage(index); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index 7e6b991c..27fea377 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -414,7 +414,7 @@ public class StorageOverlay extends GuiElement { if (stackOnMouse != null) { String stackDisplay = Utils.cleanColour(stackOnMouse.getDisplayName()); if (stackDisplay.startsWith("Backpack Slot ") || stackDisplay.startsWith("Empty Backpack Slot ") || - stackDisplay.startsWith("Ender Chest Page ")) { + stackDisplay.startsWith("Ender Chest Page ") || stackDisplay.startsWith("Locked Backpack Slot ")) { stackOnMouse = null; } } 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 d24f005d..03fe9eff 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java @@ -806,6 +806,7 @@ public class MiningOverlay extends TextTabOverlay { .getItemInformation() .get("ANVIL")) ); + put("First Event", new ItemStack(Items.fireworks, 1, 0)); }}; } } 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 0f9d1b4a..8576f141 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -61,6 +61,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.text.NumberFormat; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Locale; @@ -749,6 +750,30 @@ public class GuiProfileViewer extends GuiScreen { lastTime = currentTime; + if (currentPage != ProfileViewerPage.LOADING && currentPage != ProfileViewerPage.INVALID_NAME) { + int ignoredTabs = 0; + List configList = NotEnoughUpdates.INSTANCE.config.profileViewer.pageLayout; + for (int i = 0; i < configList.size(); i++) { + ProfileViewerPage iPage = ProfileViewerPage.getById(configList.get(i)); + if (iPage == null) continue; + if (iPage.stack == null || (iPage == ProfileViewerPage.BINGO && !showBingoPage)) { + ignoredTabs++; + continue; + } + int i2 = i - ignoredTabs; + int x = guiLeft + i2 * 28; + int y = guiTop - 28; + + if (mouseX > x && mouseX < x + 28) { + if (mouseY > y && mouseY < y + 32) { + tooltipToDisplay = Collections.singletonList(iPage.stack + .getTooltip(Minecraft.getMinecraft().thePlayer, false) + .get(0)); + } + } + } + } + if (tooltipToDisplay != null) { List grayTooltip = new ArrayList<>(tooltipToDisplay.size()); for (String line : tooltipToDisplay) { @@ -1232,16 +1257,16 @@ public class GuiProfileViewer extends GuiScreen { LOADING(), INVALID_NAME(), NO_SKYBLOCK(), - BASIC(0, Items.paper, "Your Skills"), - DUNGEON(1, Item.getItemFromBlock(Blocks.deadbush), "Dungeoneering"), - EXTRA(2, Items.book, "Profile Stats"), - INVENTORIES(3, Item.getItemFromBlock(Blocks.ender_chest), "Storage"), - COLLECTIONS(4, Items.painting, "Collections"), - PETS(5, Items.bone, "Pets"), - MINING(6, Items.iron_pickaxe, "Heart of the Mountain"), - BINGO(7, Items.filled_map, "Bingo"), - TROPHY_FISH(8, Items.fishing_rod, "Trophy Fish"), - BESTIARY(9, Items.iron_sword, "Bestiary"); + BASIC(0, Items.paper, "§9Your Skills"), + DUNGEON(1, Item.getItemFromBlock(Blocks.deadbush), "§eDungeoneering"), + EXTRA(2, Items.book, "§7Profile Stats"), + INVENTORIES(3, Item.getItemFromBlock(Blocks.ender_chest), "§bStorage"), + COLLECTIONS(4, Items.painting, "§6Collections"), + PETS(5, Items.bone, "§aPets"), + MINING(6, Items.iron_pickaxe, "§5Heart of the Mountain"), + BINGO(7, Items.filled_map, "§zBingo"), + TROPHY_FISH(8, Items.fishing_rod, "§3Trophy Fish"), + BESTIARY(9, Items.iron_sword, "§cBestiary"); public final ItemStack stack; public final int id; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/bestiary/BestiaryPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/bestiary/BestiaryPage.java index efa94ee5..70ea051a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/bestiary/BestiaryPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/bestiary/BestiaryPage.java @@ -71,6 +71,11 @@ public class BestiaryPage extends GuiProfileViewerPage { int yIndex = 0; for (ItemStack stack : BestiaryData.getBestiaryLocations().keySet()) { Minecraft.getMinecraft().getTextureManager().bindTexture(pv_elements); + if (mouseX > guiLeft + 30 + bestiaryXSize * yIndex && mouseX < guiLeft + 30 + bestiaryXSize * yIndex + 20) { + if (mouseY > guiTop + 10 && mouseY < guiTop + 10 + 20) { + tooltipToDisplay = stack.getTooltip(Minecraft.getMinecraft().thePlayer, false); + } + } if (stack == selectedBestiaryLocation) { Utils.drawTexturedRect( guiLeft + 30 + bestiaryXSize * yIndex, @@ -109,10 +114,6 @@ public class BestiaryPage extends GuiProfileViewerPage { Utils.drawTexturedRect(guiLeft, guiTop, 431, 202, GL11.GL_NEAREST); GlStateManager.color(1, 1, 1, 1); - GlStateManager.disableLighting(); - RenderHelper.enableGUIStandardItemLighting(); - - List mobs = BestiaryData.getBestiaryLocations().get(selectedBestiaryLocation); Color color = new Color(128, 128, 128, 255); Utils.renderAlignedString( EnumChatFormatting.RED + "Bestiary Level: ", @@ -121,6 +122,10 @@ public class BestiaryPage extends GuiProfileViewerPage { guiTop + 50, 110 ); + + GlStateManager.disableLighting(); + RenderHelper.enableGUIStandardItemLighting(); + List mobs = BestiaryData.getBestiaryLocations().get(selectedBestiaryLocation); if (mobs != null) { for (int i = 0; i < mobs.size(); i++) { String mob = mobs.get(i); @@ -148,7 +153,7 @@ public class BestiaryPage extends GuiProfileViewerPage { 20 * (1 - completedness) / 256f, GL11.GL_NEAREST ); - GlStateManager.color(1, 185 / 255f, 0, 1); + //GlStateManager.color(1, 185 / 255f, 0, 1); Minecraft.getMinecraft().getTextureManager().bindTexture(pv_elements); Utils.drawTexturedRect( guiLeft + x, @@ -202,7 +207,7 @@ public class BestiaryPage extends GuiProfileViewerPage { if (level.maxed) { progressStr = EnumChatFormatting.GOLD + "MAXED!"; } else { - progressStr =EnumChatFormatting.AQUA + + progressStr = EnumChatFormatting.AQUA + StringUtils.shortNumberFormat(Math.round((levelNum % 1) * level.maxXpForLevel)) + "/" + StringUtils.shortNumberFormat(level.maxXpForLevel); -- cgit From 765b569dd667d6a7e86b26d5ef1e7c5a5bade8f7 Mon Sep 17 00:00:00 2001 From: Ascynx <78341107+Ascynx@users.noreply.github.com> Date: Mon, 12 Sep 2022 10:41:12 +0200 Subject: Bug fixes (aka #249 but less of a mess) (#251) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * made equipment overlay own class lmk if there's any bugs * fix infer (i think) * fuck infer * First refactoringering * Fix more stuff * itemlisting * NEU 3.0 release notes * The changes of #249 (https://github.com/NotEnoughUpdates/NotEnoughUpdates/pull/249) * fixed nea bug https://imgur.com/a/Sg3iw74 * whitespace * fixed equipment overlay not working ? and caching * nopoing idk what im doing * FHJNX GHD trwsmokürtsew tze jiozterdgjjiüzetr jipztr * reverted "janky pet expended bugfix" * Revert "FHJNX GHD" This reverts commit 24eceba3db5e500be296f5a96412bd8b95647a22. * Revert "nopoing" This reverts commit bee07cb98f8b9672c2e1bc192c6c3e5ae8b02b95. * Revert "fixed equipment overlay" This reverts commit b15376f934a738900e2dd98efdb0d4a7ec131dfa. * idk i think this works maybe * ??? ????????? * Update to the catacombs base floor exp. Based on the hypixel wiki's calculator (see: https://canary.discord.com/channels/516977525906341928/1016050994557222912) * no more black lines * equipment cache * Fix lag with optifine and removal of unused field. Removed onMouseClick as it was triggered more than once per tick when optifine is installed. Removed tooltipsToDisplay field (as it was replaced by a local variable). * this should be true by default to keep old behaviour * itemList now doesn't close when clicking the searchbar itemList will now only close when searchMode is triggered. * Infer moment hoping this doesn't trigger it. * I forgot to push that change when I created the pr. * Fixed json resetting if an item has no nbt Co-authored-by: efefury <69400149+efefury@users.noreply.github.com> Co-authored-by: nea Co-authored-by: Lulonaut Co-authored-by: nopo Co-authored-by: Roman / Linnea Gräf Co-authored-by: Lorenz --- .../moulberry/notenoughupdates/NEUManager.java | 16 +++--- .../miscfeatures/StorageManager.java | 63 +++++++++++++++++++++- .../notenoughupdates/miscgui/GuiEnchantColour.java | 8 ++- .../miscgui/GuiInvButtonEditor.java | 56 ++++++++++++++++--- .../notenoughupdates/mixins/MixinRenderItem.java | 7 +-- .../overlays/EquipmentOverlay.java | 30 +++++++++++ .../profileviewer/DungeonPage.java | 33 ++++++++++-- 7 files changed, 187 insertions(+), 26 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java index 35385f38..5d65d07e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -399,17 +399,19 @@ public class NEUManager { * function. This method is used for the chest-item-search feature. */ public boolean searchString(String toSearch, String query) { - int lastMatch = -1; + int lastQueryMatched = -1; toSearch = clean(toSearch).toLowerCase(); query = clean(query).toLowerCase(); - String[] splitToSeach = toSearch.split(" "); + String[] splitToSearch = toSearch.split(" "); + String[] queryArray = query.split(" "); + out: - for (String s : query.split(" ")) { - for (int i = 0; i < splitToSeach.length; i++) { - if (!(lastMatch == -1 || lastMatch == i - 1)) continue; - if (splitToSeach[i].startsWith(s)) { - lastMatch = i; + for (int j = 0; j < queryArray.length; j++) { + for (int i = 0; i < splitToSearch.length; i++) { + if ((queryArray.length - (lastQueryMatched != -1 ? lastQueryMatched : 0)) > (splitToSearch.length - i)) continue; + if (splitToSearch[i].startsWith(queryArray[j])) { + lastQueryMatched = j; continue out; } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java index cc463308..93e9f516 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java @@ -45,6 +45,7 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.nbt.JsonToNBT; import net.minecraft.nbt.NBTBase; +import net.minecraft.nbt.NBTException; import net.minecraft.nbt.NBTTagByte; import net.minecraft.nbt.NBTTagByteArray; import net.minecraft.nbt.NBTTagCompound; @@ -83,11 +84,12 @@ public class StorageManager { private static final StorageManager INSTANCE = new StorageManager(); private static final Gson GSON = new GsonBuilder() .registerTypeAdapter(ItemStack.class, new ItemStackSerializer()) - .registerTypeAdapter(ItemStack.class, new ItemStackDeserilizer()).create(); + .registerTypeAdapter(ItemStack.class, new ItemStackDeserializer()).create(); public static class ItemStackSerializer implements JsonSerializer { @Override public JsonElement serialize(ItemStack src, Type typeOfSrc, JsonSerializationContext context) { + fixPetInfo(src); NBTTagCompound tag = src.serializeNBT(); return nbtToJson(tag); } @@ -95,7 +97,7 @@ public class StorageManager { private static final Pattern JSON_FIX_REGEX = Pattern.compile("\"([^,:]+)\":"); - public static class ItemStackDeserilizer implements JsonDeserializer { + public static class ItemStackDeserializer implements JsonDeserializer { @Override public ItemStack deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { @@ -135,6 +137,63 @@ public class StorageManager { return (JsonObject) loadJson(NBTTagCompound); } + private static class PetInfo { + String type; + Boolean active; + Double exp; + String tier; + Boolean hideInfo; + Integer candyUsed; + String uuid; + Boolean hideRightClick; + String heldItem; + String skin; + + private void appendIfNotNull(StringBuilder builder, String key, T value) { + if (value != null) { + if (builder.indexOf("{") != builder.length()-1) { + builder.append(","); + } + builder.append(key).append(":"); + if (value instanceof String) { + builder.append("\"").append(value).append("\""); + } else { + builder.append(value); + } + } + } + + @Override + public String toString() { + StringBuilder object = new StringBuilder(); + object.append("{"); + appendIfNotNull(object, "type", type); + appendIfNotNull(object, "active", active); + appendIfNotNull(object, "exp", exp); + appendIfNotNull(object, "tier", tier); + appendIfNotNull(object, "hideInfo", hideInfo); + appendIfNotNull(object, "candyUsed", candyUsed); + appendIfNotNull(object, "uuid", uuid); + appendIfNotNull(object, "hideRightClick", hideRightClick); + appendIfNotNull(object, "heldItem", heldItem); + appendIfNotNull(object, "skin", skin); + object.append("}"); + return object.toString(); + } + } + + private static void fixPetInfo(ItemStack src) { + if (src.getTagCompound() == null || !src.getTagCompound().hasKey("ExtraAttributes") || !src.getTagCompound().getCompoundTag("ExtraAttributes").hasKey("petInfo")) return; + PetInfo oldPetInfo = GSON.fromJson(src.getTagCompound().getCompoundTag("ExtraAttributes").getString("petInfo"), PetInfo.class); + src.getTagCompound().getCompoundTag("ExtraAttributes").removeTag("petInfo"); + try { + src.getTagCompound().getCompoundTag("ExtraAttributes").setTag( + "petInfo", + JsonToNBT.getTagFromJson(oldPetInfo.toString()) + ); + } catch (NBTException | NullPointerException ignored) {} + } + private static JsonElement loadJson(NBTBase tag) { if (tag instanceof NBTTagCompound) { NBTTagCompound compoundTag = (NBTTagCompound) tag; 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 31713189..b90b1356 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java @@ -271,17 +271,21 @@ public class GuiEnchantColour extends GuiScreen { } if (mouseX >= guiLeft + xSize + 3 && mouseX < guiLeft + xSize + 39) { + boolean renderingTooltip = false; + 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; + renderingTooltip = true; } - if (mouseY >= guiTopSidebar - 52 && mouseY <= guiTopSidebar - 34 && maxedAttBookFound == 1) { + if (mouseY >= guiTopSidebar - 52 && mouseY <= guiTopSidebar - 34 && maxedAttBookFound == 1 && !renderingTooltip) { tooltipToDisplay = maxedAttBook.getTooltip(Minecraft.getMinecraft().thePlayer, false); Utils.drawHoveringText(tooltipToDisplay, mouseX, mouseY, width, height, -1, fr); tooltipToDisplay = null; + renderingTooltip = true; } - if (mouseY >= guiTopSidebar - 18 && mouseY <= guiTopSidebar - 2) { + if (mouseY >= guiTopSidebar - 18 && mouseY <= guiTopSidebar - 2 && !renderingTooltip) { tooltipToDisplay = Lists.newArrayList( EnumChatFormatting.AQUA + "NEUEC Colouring Guide", EnumChatFormatting.GREEN + "", diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java index 40e12e35..4d18ea18 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java @@ -25,11 +25,13 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import com.google.gson.JsonParser; import com.google.gson.JsonPrimitive; +import io.github.moulberry.notenoughupdates.NEUOverlay; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.GlScissorStack; import io.github.moulberry.notenoughupdates.core.GuiElementTextField; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger; import io.github.moulberry.notenoughupdates.options.NEUConfig; +import io.github.moulberry.notenoughupdates.overlays.EquipmentOverlay; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; @@ -316,6 +318,13 @@ public class GuiInvButtonEditor extends GuiScreen { GlStateManager.color(1, 1, 1, 1); Utils.drawTexturedRect(guiLeft, guiTop, xSize, ySize, 0, xSize / 256f, 0, ySize / 256f, GL11.GL_NEAREST); + if (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud) { + EquipmentOverlay.INSTANCE.renderPreviewArmorHud(); + } + if (NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay) { + EquipmentOverlay.INSTANCE.renderPreviewPetInvHud(); + } + for (NEUConfig.InventoryButton button : NotEnoughUpdates.INSTANCE.config.hidden.inventoryButtons) { int x = guiLeft + button.x; int y = guiTop + button.y; @@ -326,6 +335,17 @@ public class GuiInvButtonEditor extends GuiScreen { y += ySize; } + if (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud) { + if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop && y < guiTop + 84) { + x -= 25; + } + } + if (NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay) { + if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop + 60 && y < guiTop + 120) { + x -= 25; + } + } + if (button.isActive()) { GlStateManager.color(1, 1, 1, 1f); } else { @@ -358,7 +378,7 @@ public class GuiInvButtonEditor extends GuiScreen { Minecraft.getMinecraft().getTextureManager().bindTexture(custom_ench_colour); GlStateManager.color(1, 1, 1, 1); Utils.drawTexturedRect( - guiLeft - 88 - 2 - 22, + guiLeft - 88 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 2, 88, 20, @@ -369,7 +389,7 @@ public class GuiInvButtonEditor extends GuiScreen { GL11.GL_NEAREST ); Utils.drawTexturedRect( - guiLeft - 88 - 2 - 22, + guiLeft - 88 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 2 + 24, 88, 20, @@ -382,7 +402,7 @@ public class GuiInvButtonEditor extends GuiScreen { Utils.drawStringCenteredScaledMaxWidth( "Load preset", fontRendererObj, - guiLeft - 44 - 2 - 22, + guiLeft - 44 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 8, false, 86, @@ -391,7 +411,7 @@ public class GuiInvButtonEditor extends GuiScreen { Utils.drawStringCenteredScaledMaxWidth( "from Clipboard", fontRendererObj, - guiLeft - 44 - 2 - 22, + guiLeft - 44 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 16, false, 86, @@ -400,7 +420,7 @@ public class GuiInvButtonEditor extends GuiScreen { Utils.drawStringCenteredScaledMaxWidth( "Save preset", fontRendererObj, - guiLeft - 44 - 2 - 22, + guiLeft - 44 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 8 + 24, false, 86, @@ -409,7 +429,7 @@ public class GuiInvButtonEditor extends GuiScreen { Utils.drawStringCenteredScaledMaxWidth( "to Clipboard", fontRendererObj, - guiLeft - 44 - 2 - 22, + guiLeft - 44 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 16 + 24, false, 86, @@ -417,7 +437,7 @@ public class GuiInvButtonEditor extends GuiScreen { ); if (!validShareContents()) { - Gui.drawRect(guiLeft - 88 - 2 - 22, guiTop + 2, guiLeft - 2 - 22, guiTop + 2 + 20, 0x80000000); + Gui.drawRect(guiLeft - 88 - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 2, guiLeft - 2 - 22 - (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud ? 25 : 0), guiTop + 2 + 20, 0x80000000); } GlStateManager.color(1, 1, 1, 1); @@ -461,6 +481,17 @@ public class GuiInvButtonEditor extends GuiScreen { y += ySize; } + if (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud) { + if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop && y < guiTop + 84) { + x -= 25; + } + } + if (NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay) { + if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop + 60 && y < guiTop + 120) { + x -= 25; + } + } + GlStateManager.translate(0, 0, 300); editorLeft = x + 8 - editorXSize / 2; editorTop = y + 18 + 2; @@ -741,6 +772,17 @@ public class GuiInvButtonEditor extends GuiScreen { y += ySize; } + if (NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud) { + if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop && y < guiTop + 84) { + x -= 25; + } + } + if (NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay) { + if (x < guiLeft + xSize - 150 && x > guiLeft + xSize - 200 && y > guiTop + 60 && y < guiTop + 120) { + x -= 25; + } + } + if (mouseX >= x && mouseY >= y && mouseX <= x + 18 && mouseY <= y + 18) { if (editingButton == button) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinRenderItem.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinRenderItem.java index dc59c0bb..7c2cfcbf 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinRenderItem.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinRenderItem.java @@ -25,6 +25,7 @@ import io.github.moulberry.notenoughupdates.core.ChromaColour; import io.github.moulberry.notenoughupdates.listener.RenderListener; import io.github.moulberry.notenoughupdates.miscfeatures.ItemCooldowns; import io.github.moulberry.notenoughupdates.miscfeatures.ItemCustomizeManager; +import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.Gui; @@ -195,7 +196,7 @@ public abstract class MixinRenderItem { @Inject(method = "renderItemIntoGUI", at = @At("HEAD")) public void renderItemHead(ItemStack stack, int x, int y, CallbackInfo ci) { - if (NotEnoughUpdates.INSTANCE.overlay.searchMode && RenderListener.drawingGuiScreen && NotEnoughUpdates.INSTANCE.isOnSkyblock()) { + if (NotEnoughUpdates.INSTANCE.overlay.searchMode && RenderListener.drawingGuiScreen && NotEnoughUpdates.INSTANCE.isOnSkyblock() && !(Minecraft.getMinecraft().currentScreen instanceof GuiProfileViewer)) { boolean matches = false; GuiTextField textField = NotEnoughUpdates.INSTANCE.overlay.getTextField(); @@ -221,7 +222,7 @@ public abstract class MixinRenderItem { @Inject(method = "renderItemIntoGUI", at = @At("RETURN")) public void renderItemReturn(ItemStack stack, int x, int y, CallbackInfo ci) { if (stack != null && stack.stackSize != 1) return; - if (NotEnoughUpdates.INSTANCE.overlay.searchMode && RenderListener.drawingGuiScreen && NotEnoughUpdates.INSTANCE.isOnSkyblock()) { + if (NotEnoughUpdates.INSTANCE.overlay.searchMode && RenderListener.drawingGuiScreen && NotEnoughUpdates.INSTANCE.isOnSkyblock() && !(Minecraft.getMinecraft().currentScreen instanceof GuiProfileViewer)) { boolean matches = false; GuiTextField textField = NotEnoughUpdates.INSTANCE.overlay.getTextField(); @@ -252,7 +253,7 @@ public abstract class MixinRenderItem { CallbackInfo ci ) { if (stack != null && stack.stackSize != 1) { - if (NotEnoughUpdates.INSTANCE.overlay.searchMode && RenderListener.drawingGuiScreen && NotEnoughUpdates.INSTANCE.isOnSkyblock()) { + if (NotEnoughUpdates.INSTANCE.overlay.searchMode && RenderListener.drawingGuiScreen && NotEnoughUpdates.INSTANCE.isOnSkyblock() && !(Minecraft.getMinecraft().currentScreen instanceof GuiProfileViewer)) { boolean matches = false; GuiTextField textField = NotEnoughUpdates.INSTANCE.overlay.getTextField(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java index 1bf61ad8..ea440396 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java @@ -422,6 +422,36 @@ public class EquipmentOverlay { return offset + 20; } + public void renderPreviewArmorHud() { + if (!NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud) return; + + int width = Utils.peekGuiScale().getScaledWidth(); + int height = Utils.peekGuiScale().getScaledHeight(); + + Minecraft.getMinecraft().getTextureManager().bindTexture(getCustomEquipmentTexture(NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay)); + + GlStateManager.color(1, 1, 1, 1); + GL11.glTranslatef(0, 0, 401); + float yNumber = (float) (height - 167) / 2f; + Utils.drawTexturedRect((float) ((width - 224.1) / 2f), yNumber, 31, 86, GL11.GL_NEAREST); + GlStateManager.bindTexture(0); + } + + public void renderPreviewPetInvHud() { + if (!NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay) return; + + int width = Utils.peekGuiScale().getScaledWidth(); + int height = Utils.peekGuiScale().getScaledHeight(); + + Minecraft.getMinecraft().getTextureManager().bindTexture(getCustomPetTexture(NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud)); + + GlStateManager.color(1, 1, 1, 1); + GL11.glTranslatef(0, 0, 401); + float yNumber = (float) (height - 23) / 2f; + Utils.drawTexturedRect((float) ((width - 224.1) / 2f), yNumber, 31, 32, GL11.GL_NEAREST); + GlStateManager.bindTexture(0); + } + public ItemStack slot1 = null; public ItemStack slot2 = null; public ItemStack slot3 = null; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java index c707f7fc..15a70ded 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java @@ -196,9 +196,9 @@ public class DungeonPage extends GuiProfileViewerPage { if (F7 > 50) { F7 = 50; } - float xpF5 = 2000 * (F5 / 100 + 1); - float xpF6 = 4000 * (F6 / 100 + 1); - float xpF7 = 20000 * (F7 / 100 + 1); + float xpF5 = 2400 * (F5 / 100 + 1); + float xpF6 = 4880 * (F6 / 100 + 1); + float xpF7 = 28000 * (F7 / 100 + 1); if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { xpF5 *= 1.1; xpF6 *= 1.1; @@ -306,6 +306,13 @@ public class DungeonPage extends GuiProfileViewerPage { 0 ) ); + float M7 = + ( + Utils.getElementAsFloat( + Utils.getElement(profileInfo, "dungeons.dungeon_types.master_catacombs.tier_completions." + 7), + 0 + ) + ); if (M3 > 50) { M3 = 50; } @@ -318,22 +325,28 @@ public class DungeonPage extends GuiProfileViewerPage { if (M6 > 50) { M6 = 50; } - float xpM3 = 36500 * (M3 / 100 + 1); - float xpM4 = 48500 * (M4 / 100 + 1); + if (M7 > 50) { + M7 = 50; + } + float xpM3 = 35000 * (M3 / 100 + 1); + float xpM4 = 55000 * (M4 / 100 + 1); float xpM5 = 70000 * (M5 / 100 + 1); float xpM6 = 100000 * (M6 / 100 + 1); + float xpM7 = 300000 * (M7 / 100 + 1); //No clue if M3 or M4 xp values are right if (!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { xpM3 *= 1.1; xpM4 *= 1.1; xpM5 *= 1.1; xpM6 *= 1.1; + xpM7 *= 1.1; } long runsM3 = (int) Math.ceil(floorLevelToXP / xpM3); long runsM4 = (int) Math.ceil(floorLevelToXP / xpM4); long runsM5 = (int) Math.ceil(floorLevelToXP / xpM5); long runsM6 = (int) Math.ceil(floorLevelToXP / xpM6); + long runsM7 = (int) Math.ceil(floorLevelToXP / xpM7); float timeM3 = Utils.getElementAsFloat( Utils.getElement(profileInfo, "dungeons.dungeon_types.master_catacombs.fastest_time_s_plus.3"), @@ -351,6 +364,10 @@ public class DungeonPage extends GuiProfileViewerPage { Utils.getElement(profileInfo, "dungeons.dungeon_types.master_catacombs.fastest_time_s_plus.6"), 0 ); + float timeM7 = Utils.getElementAsFloat( + Utils.getElement(profileInfo, "dungeons.dungeon_types.master_catacombs.fastest_time_s_plus.7"), + 0 + ); getInstance().tooltipToDisplay = Lists.newArrayList( @@ -358,6 +375,7 @@ public class DungeonPage extends GuiProfileViewerPage { String.format("# M4 Runs (%s xp) : %d", StringUtils.shortNumberFormat(xpM4), runsM4), String.format("# M5 Runs (%s xp) : %d", StringUtils.shortNumberFormat(xpM5), runsM5), String.format("# M6 Runs (%s xp) : %d", StringUtils.shortNumberFormat(xpM6), runsM6), + String.format("# M7 Runs (%s xp) : %d", StringUtils.shortNumberFormat(xpM7), runsM7), "" ); boolean hasTime = false; @@ -381,6 +399,11 @@ public class DungeonPage extends GuiProfileViewerPage { .tooltipToDisplay.add(String.format("Expected Time (M6) : %s", Utils.prettyTime(runsM6 * (long) (timeM6 * 1.2)))); hasTime = true; } + if (timeM7 > 1000) { + getInstance() + .tooltipToDisplay.add(String.format("Expected Time (M7) : %s", Utils.prettyTime(runsM7 * (long) (timeM7 * 1.2)))); + hasTime = true; + } if (hasTime) { getInstance().tooltipToDisplay.add(""); } -- cgit From 1fec0d019215df8c57d410c18bd06445d8c2ded7 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 13 Sep 2022 00:23:14 +1000 Subject: Fix crash related to profile viewer button (#272) --- .../io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java index 7c3414fa..be36d0b4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java @@ -96,7 +96,7 @@ public abstract class MixinGuiContainer extends GuiScreen { if (tag.hasKey("SkullOwner") && tag.getCompoundTag("SkullOwner").hasKey("Name")) { String tagName = tag.getCompoundTag("SkullOwner").getString("Name"); String displayName = Utils.cleanColour(cc.inventorySlots.get(22).getStack().getDisplayName()); - if (tagName.equals(displayName.substring(displayName.length() - tagName.length()))) { + if (displayName.length() - tagName.length() > 0 && tagName.equals(displayName.substring(displayName.length() - tagName.length()))) { ci.cancel(); this.zLevel = 100.0F; -- cgit From 16fedc90309a898bc709eaadc944fd047300fd0d Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 13 Sep 2022 00:24:07 +1000 Subject: Fixed pet overlay going to level 100 (#268) --- Update Notes/2.1.md | 1 + .../java/io/github/moulberry/notenoughupdates/util/XPInformation.java | 1 + 2 files changed, 2 insertions(+) diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index 9c73e649..fa49a1d0 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -10,6 +10,7 @@ - [Donpireso replied to a sba dev's email about some of sba features, and it seems to imply that blocking clicks in guis aren't bannable](https://cdn.discordapp.com/attachments/823769568933576764/906101631861526559/unknown.png) - Made it if you hold shift in the enchant solvers it overrides prevent missclicks - nopo - Fixed pet overlay not updating when going into /pets - nopo +- Fixed pet overlay randomly going to level 100 - nopo - [Added an armor overlay for the new armor slots](https://cdn.discordapp.com/attachments/832652653292027904/922399046528794634/unknown.png) - Added a pet overlay that shows your active pet in your inventory - nopo - [Price graph for items on /ah and /bz](https://cdn.discordapp.com/attachments/896407218151366687/926968296929107999/unknown.png) - DeDiamondPro diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java index 58794e07..81eea343 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/XPInformation.java @@ -187,6 +187,7 @@ public class XPInformation { skillInfo.currentXp += updateWithPercentage.get(skill) / 100f * cap; skillInfo.totalXp += skillInfo.currentXp; skillInfo.currentXpMax = cap; + break; } else { skillInfo.totalXp += cap; } -- cgit From 996b42013330944403684b4a127015e5b04c6295 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Mon, 12 Sep 2022 16:26:49 +0200 Subject: Fix bazaar item sack (#271) --- .../moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java index 7007f39b..9ab85390 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java @@ -103,6 +103,10 @@ public class BazaarSacksProfit { .getItemInformation() .entrySet()) { String internalName = entry.getKey(); + + // Ignoring builder melon, builder clay and builder cactus + if (NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(internalName) == null) continue; + JsonObject object = entry.getValue(); if (object.has("displayname")) { String name = object.get("displayname").getAsString(); -- cgit From 7fb629f0fc0d6e2455418f85c36a11667f888d42 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 13 Sep 2022 00:27:37 +1000 Subject: Fixed clicking outside of experimentation game causing it to go count that as a valid click (#269) --- Update Notes/2.1.md | 1 + .../moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index fa49a1d0..6080e656 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -149,6 +149,7 @@ - Fixed shortened damage - nopo - Fixed bazaar prices sorting order in neu item list - hannibal2 - Fixed priceless items showing first in the missing tab of the accessory bag overlay - nopo +- Fixed clicking outside of experimentation game causing it to go count that as a valid click - nopo - Fixed storage gui when having locked backpack slots - nopo ### **Other:** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java index 558917fe..a1580d8e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java @@ -342,8 +342,9 @@ public class EnchantingSolvers { if (chronomatronReplayIndex < chronomatronOrder.size()) { String chronomatronCurrent = chronomatronOrder.get(chronomatronReplayIndex); - if (!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.preventMisclicks1 || - chronomatronCurrent.equals(displayName) || Keyboard.getEventKey() == Keyboard.KEY_LSHIFT) { + if ((!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.preventMisclicks1 || + chronomatronCurrent.equals(displayName) || Keyboard.getEventKey() == Keyboard.KEY_LSHIFT) && + stack.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane) && slotId != 4 && slotId != 49) { chronomatronReplayIndex++; Minecraft.getMinecraft().playerController.windowClick(windowId, slotId, 2, mode, Minecraft.getMinecraft().thePlayer @@ -374,7 +375,7 @@ public class EnchantingSolvers { long currentTime = System.currentTimeMillis(); if (currentTime - millisLastClick > 150 && (!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.preventMisclicks1 || - current.containerIndex == slotId || Keyboard.getEventKey() == Keyboard.KEY_LSHIFT)) { + current.containerIndex == slotId || Keyboard.getEventKey() == Keyboard.KEY_LSHIFT) && (slotId < 45 && slotId > 8)) { ultrasequencerReplayIndex++; Minecraft.getMinecraft().playerController.windowClick(windowId, slotId, 2, mode, Minecraft.getMinecraft().thePlayer -- cgit From d404b5c694e9873c1f2bcb48966785ad5c9640d0 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 13 Sep 2022 00:28:25 +1000 Subject: Fixed dungeon profit not showing books when one sells for 0 (#274) --- .../github/moulberry/notenoughupdates/listener/RenderListener.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java index d4df7bfd..a8d69c87 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -787,8 +787,10 @@ public class RenderListener { if (bazaarPrice < 5000000 && internal.equals("RECOMBOBULATOR_3000")) bazaarPrice = 5000000; double worth = -1; - if (bazaarPrice > 0) { + boolean isOnBz = false; + if (bazaarPrice >= 0) { worth = bazaarPrice; + isOnBz = true; } else { switch (NotEnoughUpdates.INSTANCE.config.dungeons.profitType) { case 1: @@ -826,7 +828,7 @@ public class RenderListener { } } - if (worth > 0 && totalValue >= 0) { + if ((worth >= 0 || isOnBz) && totalValue >= 0) { totalValue += worth; String display = item.getDisplayName(); -- cgit From 94054563ff1d595253a4e50cf48b22fc77a05515 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 13 Sep 2022 02:31:56 +1000 Subject: Fix enchantment table overlay (#238) Co-authored-by: nea --- Update Notes/2.1.md | 2 + .../listener/ItemTooltipListener.java | 7 +- .../listener/NEUEventListener.java | 4 + .../notenoughupdates/listener/RenderListener.java | 22 + .../notenoughupdates/miscgui/CalendarOverlay.java | 5 +- .../notenoughupdates/miscgui/GuiCustomEnchant.java | 309 +- .../notenoughupdates/miscgui/hex/EnchantState.java | 37 + .../notenoughupdates/miscgui/hex/GuiCustomHex.java | 4794 ++++++++++++++++++++ .../notenoughupdates/miscgui/hex/HexItem.java | 264 ++ .../notenoughupdates/miscgui/hex/ItemType.java | 84 + .../miscgui/util/ExperienceOrb.java | 32 + .../notenoughupdates/miscgui/util/OrbDisplay.java | 142 + .../notenoughupdates/mixins/MixinGuiContainer.java | 2 + 13 files changed, 5521 insertions(+), 183 deletions(-) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/EnchantState.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/HexItem.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/ItemType.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/util/ExperienceOrb.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/util/OrbDisplay.java diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index 6080e656..50e2d0e4 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -18,6 +18,7 @@ - Improved metal detector logic to solve using a single position in most cases using known locations based on Keeper coordinates - CraftyOldMiner - Added support for official Hypixel wiki, can be toggled in /neu misc - DeDiamondPro - Added a calculator (/neucalc help), that also works in the auction house / bazaar - nea89 +- Added an enchant table style gui for /hex - nopo - Added and fixed various things in the profile viewer: - [Added hotm tab](https://media.discordapp.net/attachments/659613194066722833/991115131507441724/unknown.png) - nopo - Big thanks to kwev1n for some math and jani for the texture @@ -146,6 +147,7 @@ - Fixed crash with spamming remove enchant in /neuec - nopo - Fixed missing enchants not working with shiny items - nopo - Fixed golden dragon not working in pet overlay - CrypticPlasma +- Fixed enchant overlay - nopo - Fixed shortened damage - nopo - Fixed bazaar prices sorting order in neu item list - hannibal2 - Fixed priceless items showing first in the missing tab of the accessory bag overlay - nopo diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java index 3936ad74..d4e0becd 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java @@ -906,11 +906,16 @@ public class ItemTooltipListener { boolean m = Keyboard.isKeyDown(Keyboard.KEY_M); boolean n = Keyboard.isKeyDown(Keyboard.KEY_N); boolean f = Keyboard.isKeyDown(Keyboard.KEY_F); + boolean l = Keyboard.isKeyDown(Keyboard.KEY_L); if (!copied && f && NotEnoughUpdates.INSTANCE.config.hidden.dev) { MiscUtils.copyToClipboard(NotEnoughUpdates.INSTANCE.manager.getSkullValueForItem(event.itemStack)); } + if (!copied && l) { + NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI = !NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI; + } + event.toolTip.add( EnumChatFormatting.AQUA + "Internal Name: " + EnumChatFormatting.GRAY + internal + EnumChatFormatting.GOLD + " [K]"); @@ -948,7 +953,7 @@ public class ItemTooltipListener { } } - copied = k || m || n || f; + copied = k || m || n || f || l; } } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java index 305135fc..e202b828 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/NEUEventListener.java @@ -34,6 +34,7 @@ import io.github.moulberry.notenoughupdates.miscfeatures.ItemCustomizeManager; import io.github.moulberry.notenoughupdates.miscfeatures.NPCRetexturing; import io.github.moulberry.notenoughupdates.miscgui.AccessoryBagOverlay; import io.github.moulberry.notenoughupdates.miscgui.GuiCustomEnchant; +import io.github.moulberry.notenoughupdates.miscgui.hex.GuiCustomHex; import io.github.moulberry.notenoughupdates.miscgui.StorageOverlay; import io.github.moulberry.notenoughupdates.overlays.OverlayManager; import io.github.moulberry.notenoughupdates.overlays.TextOverlay; @@ -144,6 +145,9 @@ public class NEUEventListener { if (GuiCustomEnchant.getInstance().shouldOverride(containerName)) { GuiCustomEnchant.getInstance().tick(); } + if (GuiCustomHex.getInstance().shouldOverride(containerName)) { + GuiCustomHex.getInstance().tick(containerName); + } } //MiningOverlay and TimersOverlay need real tick speed diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java index a8d69c87..c822a51d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -45,6 +45,7 @@ import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager; import io.github.moulberry.notenoughupdates.miscgui.AccessoryBagOverlay; import io.github.moulberry.notenoughupdates.miscgui.CalendarOverlay; import io.github.moulberry.notenoughupdates.miscgui.GuiCustomEnchant; +import io.github.moulberry.notenoughupdates.miscgui.hex.GuiCustomHex; import io.github.moulberry.notenoughupdates.miscgui.GuiInvButtonEditor; import io.github.moulberry.notenoughupdates.miscgui.GuiItemRecipe; import io.github.moulberry.notenoughupdates.miscgui.StorageOverlay; @@ -445,12 +446,19 @@ public class RenderListener { containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText(); } + if (GuiCustomHex.getInstance().shouldOverride(containerName)) { + GuiCustomHex.getInstance().render(event.renderPartialTicks, containerName); + event.setCanceled(true); + return; + } + if (GuiCustomEnchant.getInstance().shouldOverride(containerName)) { GuiCustomEnchant.getInstance().render(event.renderPartialTicks); event.setCanceled(true); return; } + boolean tradeWindowActive = TradeWindow.tradeWindowActive(containerName); boolean storageOverlayActive = StorageManager.getInstance().shouldRenderStorageOverlay(containerName); boolean customAhActive = @@ -595,6 +603,7 @@ public class RenderListener { ContainerChest cc = (ContainerChest) eventGui.inventorySlots; containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText(); + if (GuiCustomHex.getInstance().shouldOverride(containerName)) return; if (GuiCustomEnchant.getInstance().shouldOverride(containerName)) return; } @@ -1050,12 +1059,18 @@ public class RenderListener { } } + if (GuiCustomHex.getInstance().shouldOverride(containerName) && + GuiCustomHex.getInstance().mouseInput(mouseX, mouseY)) { + event.setCanceled(true); + return; + } if (GuiCustomEnchant.getInstance().shouldOverride(containerName) && GuiCustomEnchant.getInstance().mouseInput(mouseX, mouseY)) { event.setCanceled(true); return; } + boolean tradeWindowActive = TradeWindow.tradeWindowActive(containerName); boolean storageOverlayActive = StorageManager.getInstance().shouldRenderStorageOverlay(containerName); boolean customAhActive = @@ -1519,12 +1534,19 @@ public class RenderListener { .getUnformattedText(); } + if (GuiCustomHex.getInstance().shouldOverride(containerName) && + GuiCustomHex.getInstance().keyboardInput()) { + event.setCanceled(true); + return; + } + if (GuiCustomEnchant.getInstance().shouldOverride(containerName) && GuiCustomEnchant.getInstance().keyboardInput()) { event.setCanceled(true); return; } + boolean tradeWindowActive = TradeWindow.tradeWindowActive(containerName); boolean storageOverlayActive = StorageManager.getInstance().shouldRenderStorageOverlay(containerName); boolean customAhActive = diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java index 2905a941..b1a3dca9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java @@ -75,6 +75,8 @@ public class CalendarOverlay { private static boolean enabled = false; + public static boolean ableToClickCalendar = true; + public static void setEnabled(boolean enabled) { CalendarOverlay.enabled = enabled; } @@ -479,8 +481,7 @@ public class CalendarOverlay { guiLeft = (width - xSize) / 2; guiTop = 5; - - if (mouseX >= guiLeft && mouseX <= guiLeft + xSize) { + if (mouseX >= guiLeft && mouseX <= guiLeft + xSize && ableToClickCalendar) { if (mouseY >= guiTop && mouseY <= guiTop + ySize) { ClientCommandHandler.instance.executeCommand(Minecraft.getMinecraft().thePlayer, "/neucalendar"); } 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 8ba3a98a..cbf98290 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java @@ -28,6 +28,7 @@ import io.github.moulberry.notenoughupdates.core.GuiElementTextField; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingFloat; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger; import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking; +import io.github.moulberry.notenoughupdates.miscgui.util.OrbDisplay; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; import io.github.moulberry.notenoughupdates.options.NEUConfig; import io.github.moulberry.notenoughupdates.util.Constants; @@ -74,9 +75,9 @@ public class GuiCustomEnchant extends Gui { "textures/entity/enchanting_table_book.png"); private static final ModelBook MODEL_BOOK = new ModelBook(); - private static final int EXPERIENCE_ORB_COUNT = 30; - private static final Pattern XP_COST_PATTERN = Pattern.compile("\\u00a73(\\d+) Exp Levels"); + private static final Pattern ENCHANT_LEVEL_PATTERN = Pattern.compile("(.*)_(.*)"); + private static final Pattern ENCHANT_NAME_PATTERN = Pattern.compile("([^IVX]*) ([IVX]*)"); private enum EnchantState { NO_ITEM, @@ -105,6 +106,10 @@ public class GuiCustomEnchant extends Gui { this.enchId = enchId; this.displayLore = displayLore; this.level = level; + if (this.enchId.equals("prosecute")) { + this.enchId = "PROSECUTE"; + } + if (Constants.ENCHANTS != null) { if (checkConflicts && Constants.ENCHANTS.has("enchant_pools")) { @@ -133,12 +138,18 @@ public class GuiCustomEnchant extends Gui { if (level >= 1 && Constants.ENCHANTS.has("enchants_xp_cost")) { JsonObject allCosts = Constants.ENCHANTS.getAsJsonObject("enchants_xp_cost"); + JsonObject maxLevel = null; + if (Constants.ENCHANTS.has("max_xp_table_levels")) { + maxLevel = Constants.ENCHANTS.getAsJsonObject("max_xp_table_levels"); + } + if (allCosts.has(enchId)) { JsonArray costs = allCosts.getAsJsonArray(enchId); if (costs.size() >= 1) { if (useMaxLevelForCost) { - this.xpCost = costs.get(costs.size() - 1).getAsInt(); + int cost = (maxLevel != null && maxLevel.has(enchId) ? maxLevel.get(enchId).getAsInt() : costs.size()); + this.xpCost = costs.get(cost - 1).getAsInt(); } else if (level - 1 < costs.size()) { this.xpCost = costs.get(level - 1).getAsInt(); } else { @@ -152,21 +163,7 @@ public class GuiCustomEnchant extends Gui { } } - public static class ExperienceOrb { - public float x; - public float y; - public float xLast; - public float yLast; - public float xVel; - public float yVel; - - public int type; - public int rotationDeg; - } - - private final List orbs = new ArrayList<>(); - private int orbTargetX = 0; - private int orbTargetY = 0; + public OrbDisplay orbDisplay = new OrbDisplay(); private int guiLeft; private int guiTop; @@ -226,8 +223,15 @@ public class GuiCustomEnchant extends Gui { } public boolean shouldOverride(String containerName) { + if (containerName == null) { + shouldOverrideFast = false; + return false; + } shouldOverrideFast = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI && - Objects.equals("Enchant Item", containerName) && + (containerName.length() >= 12 && Objects.equals( + "Enchant Item", + containerName.substring(0, "Enchant Item".length()) + )) && NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard(); if (!shouldOverrideFast) { currentState = EnchantState.NO_ITEM; @@ -235,6 +239,10 @@ public class GuiCustomEnchant extends Gui { removable.clear(); expectedMaxPage = 1; } + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + ContainerChest cc = (ContainerChest) chest.inventorySlots; + ItemStack hexStack = cc.getLowerChestInventory().getStackInSlot(50); + if (hexStack != null && hexStack.getItem() == Items.experience_bottle) return false; return shouldOverrideFast; } @@ -245,13 +253,15 @@ public class GuiCustomEnchant extends Gui { ContainerChest cc = (ContainerChest) chest.inventorySlots; ItemStack stack = cc.getLowerChestInventory().getStackInSlot(23); - ItemStack enchantGuideStack = cc.getLowerChestInventory().getStackInSlot(50); + ItemStack arrowStack = cc.getLowerChestInventory().getStackInSlot(45); ItemStack enchantingItemStack = cc.getLowerChestInventory().getStackInSlot(19); + ItemStack hexStack = cc.getLowerChestInventory().getStackInSlot(50); int lastPage = currentPage; this.lastState = currentState; - if (enchantGuideStack != null && enchantGuideStack.getItem() != Items.book && enchantingItem != null) { + if (hexStack != null && hexStack.getItem() == Items.experience_bottle) return; + if (arrowStack != null && arrowStack.getItem() == Items.arrow && enchantingItem != null) { currentState = EnchantState.ADDING_ENCHANT; } else if (stack == null || enchantingItemStack == null) { if (currentState == EnchantState.SWITCHING_DONT_UPDATE || currentState == EnchantState.NO_ITEM) { @@ -305,30 +315,7 @@ public class GuiCustomEnchant extends Gui { } } - List toRemove = new ArrayList<>(); - for (ExperienceOrb orb : orbs) { - float targetDeltaX = guiLeft + orbTargetX - orb.x; - float targetDeltaY = guiTop + orbTargetY - orb.y; - - float length = (float) Math.sqrt(targetDeltaX * targetDeltaX + targetDeltaY * targetDeltaY); - - if (length < 8 && orb.xVel * orb.xVel + orb.yVel * orb.yVel < 20) { - toRemove.add(orb); - continue; - } - - orb.xVel += targetDeltaX * 2 / length; - orb.yVel += targetDeltaY * 2 / length; - - orb.xVel *= 0.90; - orb.yVel *= 0.90; - - orb.xLast = orb.x; - orb.yLast = orb.y; - orb.x += orb.xVel; - orb.y += orb.yVel; - } - orbs.removeAll(toRemove); + orbDisplay.physicsTickOrbs(); if (++tickCounter >= 20) { tickCounter = 0; @@ -389,40 +376,48 @@ public class GuiCustomEnchant extends Gui { if (ea != null) { NBTTagCompound enchantments = ea.getCompoundTag("enchantments"); if (enchantments != null) { - for (String enchId : enchantments.getKeySet()) { - String name = Utils.cleanColour(book.getDisplayName()); - if (name.equalsIgnoreCase("Bane of Arthropods")) { - name = "Bane of Arth."; - } else if (name.equalsIgnoreCase("Projectile Protection")) { - name = "Projectile Prot"; - } else if (name.equalsIgnoreCase("Blast Protection")) { - name = "Blast Prot"; - } - Enchantment enchantment = new Enchantment(slotIndex, name, enchId, - Utils.getRawTooltip(book), enchantments.getInteger(enchId), false, true - ); - enchantment.displayLore.remove(0); + String enchId = Utils.cleanColour(book.getDisplayName()).toLowerCase().replace(" ", "_").replace( + "-", + "_" + ); + String name = Utils.cleanColour(book.getDisplayName()); + int enchLevel = -1; + if (name.equalsIgnoreCase("Bane of Arthropods")) { + name = "Bane of Arth."; + } else if (name.equalsIgnoreCase("Projectile Protection")) { + name = "Projectile Prot"; + } else if (name.equalsIgnoreCase("Blast Protection")) { + name = "Blast Prot"; + } + Matcher levelMatcher = ENCHANT_LEVEL_PATTERN.matcher(enchId); + if (levelMatcher.matches()) { + enchLevel = Utils.parseRomanNumeral(levelMatcher.group(2).toUpperCase()); + enchId = levelMatcher.group(1); + } + Enchantment enchantment = new Enchantment(slotIndex, name, enchId, + Utils.getRawTooltip(book), enchLevel, false, true + ); + enchantment.displayLore.remove(0); - if (removingEnchantPlayerLevel == -1 && playerEnchantIds.containsKey(enchId)) { - removingEnchantPlayerLevel = playerEnchantIds.get(enchId); - } + if (removingEnchantPlayerLevel == -1 && playerEnchantIds.containsKey(enchId)) { + removingEnchantPlayerLevel = playerEnchantIds.get(enchId); + } - if (removingEnchantPlayerLevel >= 0 && enchantment.level < removingEnchantPlayerLevel) { - continue; - } + if (removingEnchantPlayerLevel >= 0 && enchantment.level < removingEnchantPlayerLevel) { + continue; + } - if (enchanterCurrentEnch == null) { + if (enchanterCurrentEnch == null) { + enchanterCurrentEnch = enchantment; + } else if (updateLevel) { + if (removingEnchantPlayerLevel < 0 && enchantment.level > enchanterCurrentEnch.level) { + enchanterCurrentEnch = enchantment; + } else if (removingEnchantPlayerLevel >= 0 && enchantment.level < enchanterCurrentEnch.level) { enchanterCurrentEnch = enchantment; - } else if (updateLevel) { - if (removingEnchantPlayerLevel < 0 && enchantment.level > enchanterCurrentEnch.level) { - enchanterCurrentEnch = enchantment; - } else if (removingEnchantPlayerLevel >= 0 && enchantment.level < enchanterCurrentEnch.level) { - enchanterCurrentEnch = enchantment; - } } - - enchanterEnchLevels.put(enchantment.level, enchantment); } + + enchanterEnchLevels.put(enchantment.level, enchantment); } } } @@ -455,43 +450,54 @@ public class GuiCustomEnchant extends Gui { if (ea != null) { NBTTagCompound enchantments = ea.getCompoundTag("enchantments"); if (enchantments != null) { - for (String enchId : enchantments.getKeySet()) { - String name = Utils.cleanColour(book.getDisplayName()); - - if (searchField.getText().trim().isEmpty() || - name.toLowerCase().contains(searchField.getText().trim().toLowerCase())) { - if (name.equalsIgnoreCase("Bane of Arthropods")) { - name = "Bane of Arth."; - } else if (name.equalsIgnoreCase("Projectile Protection")) { - name = "Projectile Prot"; - } else if (name.equalsIgnoreCase("Blast Protection")) { - name = "Blast Prot"; - } else if (name.equalsIgnoreCase("Luck of the Sea")) { - name = "Luck of Sea"; - } + String enchId = Utils + .cleanColour(book.getDisplayName()) + .toLowerCase() + .replace(" ", "_") + .replace("-", "_"); + if (enchId.equalsIgnoreCase("_")) continue; + if (enchId.equals("prosecute")) { + enchId = "PROSECUTE"; + } + String name = Utils.cleanColour(book.getDisplayName()); + + if (searchField.getText().trim().isEmpty() || + name.toLowerCase().contains(searchField.getText().trim().toLowerCase())) { + if (name.equalsIgnoreCase("Bane of Arthropods")) { + name = "Bane of Arth."; + } else if (name.equalsIgnoreCase("Projectile Protection")) { + name = "Projectile Prot"; + } else if (name.equalsIgnoreCase("Blast Protection")) { + name = "Blast Prot"; + } else if (name.equalsIgnoreCase("Luck of the Sea")) { + name = "Luck of Sea"; + } + Matcher nameMatcher = ENCHANT_NAME_PATTERN.matcher(name); + if (nameMatcher.matches()) { + name = nameMatcher.group(1); + } - if (playerEnchantIds.containsKey(enchId)) { - Enchantment enchantment = new Enchantment(slotIndex, name, enchId, - Utils.getRawTooltip(book), playerEnchantIds.get(enchId), false, false - ); - if (!enchantment.overMaxLevel) { - removable.add(enchantment); - } - } else { - Enchantment enchantment = new Enchantment(slotIndex, name, enchId, - Utils.getRawTooltip(book), enchantments.getInteger(enchId), true, true - ); - applicable.add(enchantment); + if (playerEnchantIds.containsKey(enchId)) { + Enchantment enchantment = new Enchantment(slotIndex, name, enchId, + Utils.getRawTooltip(book), playerEnchantIds.get(enchId), false, false + ); + if (!enchantment.overMaxLevel) { + removable.add(enchantment); } } else { - if (playerEnchantIds.containsKey(enchId)) { - searchRemovedFromRemovable = true; - } else { - searchRemovedFromApplicable = true; - } + Enchantment enchantment = new Enchantment(slotIndex, name, enchId, + Utils.getRawTooltip(book), 1, true, true + ); + applicable.add(enchantment); + } + } else { + if (playerEnchantIds.containsKey(enchId)) { + searchRemovedFromRemovable = true; + } else { + searchRemovedFromApplicable = true; } - } + } } } @@ -1356,37 +1362,11 @@ public class GuiCustomEnchant extends Gui { //Orb animation Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); - GlStateManager.color(1, 1, 1, 1); GlStateManager.disableDepth(); - for (ExperienceOrb orb : orbs) { - int orbX = Math.round(orb.xLast + (orb.x - orb.xLast) * partialTicks); - int orbY = Math.round(orb.yLast + (orb.y - orb.yLast) * partialTicks); - GlStateManager.pushMatrix(); - GlStateManager.translate(orbX, orbY, 0); - GlStateManager.rotate(orb.rotationDeg, 0, 0, 1); - - float targetDeltaX = guiLeft + orbTargetX - orb.x; - float targetDeltaY = guiTop + orbTargetY - orb.y; - float length = (float) Math.sqrt(targetDeltaX * targetDeltaX + targetDeltaY * targetDeltaY); - float velSq = orb.xVel * orb.xVel + orb.yVel * orb.yVel; - float opacity = Math.min(2, Math.max(0.5f, length / 16)) * Math.min(2, Math.max(0.5f, velSq / 40)); - if (opacity > 1) opacity = 1; - opacity = (float) Math.sqrt(opacity); - GlStateManager.color(1, 1, 1, opacity); - - Utils.drawTexturedRect( - -8, - -8, - 16, - 16, - ((orb.type % 3) * 16) / 512f, - (16 + (orb.type % 3) * 16) / 512f, - (217 + orb.type / 3 * 16) / 512f, - (217 + 16 + orb.type / 3 * 16) / 512f, - GL11.GL_NEAREST - ); - GlStateManager.popMatrix(); - } + GlStateManager.pushMatrix(); + GlStateManager.translate(guiLeft, guiTop, 0); + orbDisplay.renderOrbs(partialTicks); + GlStateManager.popMatrix(); GlStateManager.enableDepth(); if (stackOnMouse != null) { @@ -1403,37 +1383,6 @@ public class GuiCustomEnchant extends Gui { GlStateManager.translate(0, 0, -300); } - private void spawnExperienceOrbs(int startX, int startY, int targetX, int targetY, int baseType) { - orbs.clear(); - - this.orbTargetX = targetX; - this.orbTargetY = targetY; - - Random rand = new Random(); - for (int i = 0; i < EXPERIENCE_ORB_COUNT; i++) { - ExperienceOrb orb = new ExperienceOrb(); - orb.x = startX; - orb.y = startY; - orb.xLast = startX; - orb.yLast = startY; - orb.xVel = rand.nextFloat() * 20 - 10; - orb.yVel = rand.nextFloat() * 20 - 10; - orb.type = baseType; - - float typeRand = rand.nextFloat(); - if (typeRand < 0.6) { - orb.type += 0; - } else if (typeRand < 0.9) { - orb.type += 1; - } else { - orb.type += 2; - } - orb.rotationDeg = rand.nextInt(4) * 90; - - orbs.add(orb); - } - } - private void renderEnchantBook(ScaledResolution scaledresolution, float partialTicks) { GlStateManager.enableDepth(); @@ -1540,9 +1489,9 @@ public class GuiCustomEnchant extends Gui { EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); - ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(48); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( - chest.inventorySlots.windowId, 48, 0, 0, stack, transactionID)); + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); cancelButtonAnimTime = System.currentTimeMillis(); } @@ -1592,9 +1541,9 @@ public class GuiCustomEnchant extends Gui { EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); - ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(48); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( - chest.inventorySlots.windowId, 48, 0, 0, stack, transactionID)); + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); cancelButtonAnimTime = System.currentTimeMillis(); } else if (!isChangingEnchLevel && enchanterCurrentEnch != null && @@ -1617,9 +1566,9 @@ public class GuiCustomEnchant extends Gui { int playerXpLevel = Minecraft.getMinecraft().thePlayer.experienceLevel; if (playerXpLevel >= enchanterCurrentEnch.xpCost) { if (removingEnchantPlayerLevel >= 0 && enchanterCurrentEnch.level == removingEnchantPlayerLevel) { - spawnExperienceOrbs(guiLeft + X_SIZE / 2, guiTop + 66, X_SIZE / 2, 36, 3); + orbDisplay.spawnExperienceOrbs(X_SIZE / 2, 66, X_SIZE / 2, 36, 3); } else { - spawnExperienceOrbs(mouseX, mouseY, X_SIZE / 2, 66, 0); + orbDisplay.spawnExperienceOrbs(mouseX - guiLeft, mouseY - guiTop, X_SIZE / 2, 66, 0); } } @@ -1790,9 +1739,9 @@ public class GuiCustomEnchant extends Gui { } else if (currentState == EnchantState.ADDING_ENCHANT) { EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); - ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(48); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( - chest.inventorySlots.windowId, 48, 0, 0, stack, transactionID)); + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); cancelButtonAnimTime = System.currentTimeMillis(); } @@ -1830,9 +1779,9 @@ public class GuiCustomEnchant extends Gui { } else if (currentState == EnchantState.ADDING_ENCHANT) { EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); - ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(48); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( - chest.inventorySlots.windowId, 48, 0, 0, stack, transactionID)); + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); cancelButtonAnimTime = System.currentTimeMillis(); } @@ -1877,9 +1826,9 @@ public class GuiCustomEnchant extends Gui { EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); - ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(48); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( - chest.inventorySlots.windowId, 48, 0, 0, stack, transactionID)); + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); cancelButtonAnimTime = System.currentTimeMillis(); } @@ -1898,9 +1847,9 @@ public class GuiCustomEnchant extends Gui { EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); - ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(48); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( - chest.inventorySlots.windowId, 48, 0, 0, stack, transactionID)); + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); cancelButtonAnimTime = System.currentTimeMillis(); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/EnchantState.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/EnchantState.java new file mode 100644 index 00000000..08e720a2 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/EnchantState.java @@ -0,0 +1,37 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.miscgui.hex; + +enum EnchantState { + NO_ITEM, + ADDING_ENCHANT, + SWITCHING_DONT_UPDATE, + INVALID_ITEM, + HAS_ITEM, + HAS_ITEM_IN_HEX, + HAS_ITEM_IN_BOOKS, + ADDING_BOOK, + NO_ITEM_IN_HEX, + INVALID_ITEM_HEX, + HAS_ITEM_IN_GEMSTONE, + ADDING_GEMSTONE, + APPLYING_GEMSTONE + +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java new file mode 100644 index 00000000..39374f9d --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java @@ -0,0 +1,4794 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.miscgui.hex; + +import com.google.common.collect.Lists; +import com.google.gson.JsonArray; +import com.google.gson.JsonObject; +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.core.GlScissorStack; +import io.github.moulberry.notenoughupdates.core.GuiElementTextField; +import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingFloat; +import io.github.moulberry.notenoughupdates.core.util.lerp.LerpingInteger; +import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking; +import io.github.moulberry.notenoughupdates.miscgui.CalendarOverlay; +import io.github.moulberry.notenoughupdates.miscgui.util.OrbDisplay; +import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; +import io.github.moulberry.notenoughupdates.options.NEUConfig; +import io.github.moulberry.notenoughupdates.util.Constants; +import io.github.moulberry.notenoughupdates.util.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.entity.EntityPlayerSP; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.client.model.ModelBook; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.inventory.ContainerChest; +import net.minecraft.inventory.Slot; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.network.play.client.C0EPacketClickWindow; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.text.WordUtils; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.glu.Project; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.List; +import java.util.Locale; +import java.util.Objects; +import java.util.Random; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class GuiCustomHex extends Gui { + private static final GuiCustomHex INSTANCE = new GuiCustomHex(); + private static final ResourceLocation TEXTURE = new ResourceLocation("notenoughupdates:custom_enchant_gui.png"); + private static final ResourceLocation ENCHANTMENT_TABLE_BOOK_TEXTURE = new ResourceLocation( + "textures/entity/enchanting_table_book.png"); + private static final ModelBook MODEL_BOOK = new ModelBook(); + + private static final int EXPERIENCE_ORB_COUNT = 30; + + private static final Pattern XP_COST_PATTERN = Pattern.compile("\\u00a73(\\d+) Exp Levels"); + private static final Pattern ENCHANT_LEVEL_PATTERN = Pattern.compile("(.*)_(.*)"); + private static final Pattern ENCHANT_NAME_PATTERN = Pattern.compile("([^IVX]*) ([IVX]*)"); + + public static final NumberFormat numberFormat = NumberFormat.getInstance(Locale.US); + + public class Enchantment { + public int slotIndex; + public String enchantName; + public String enchId; + public List displayLore; + public int level; + public int xpCost = -1; + public boolean overMaxLevel = false; + public boolean conflicts = false; + public int price = -1; + + public Enchantment( + int slotIndex, String enchantName, String enchId, List displayLore, int level, + boolean useMaxLevelForCost, boolean checkConflicts + ) { + this.slotIndex = slotIndex; + this.enchantName = enchantName; + this.enchId = enchId; + this.displayLore = displayLore; + this.level = level; + boolean isUlt = false; + for (String lore : displayLore) { + if (lore.contains("§l")) isUlt = true; + break; + } + JsonObject bazaarInfo = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo( + (isUlt ? "ULTIMATE_" : "") + enchId.toUpperCase() + ";" + level); + if (bazaarInfo != null && bazaarInfo.get("curr_buy") != null) { + this.price = bazaarInfo.get("curr_buy").getAsInt(); + } + if (this.enchId.equals("prosecute")) { + this.enchId = "PROSECUTE"; + } + + if (Constants.ENCHANTS != null) { + if (checkConflicts && Constants.ENCHANTS.has("enchant_pools")) { + JsonArray pools = Constants.ENCHANTS.getAsJsonArray("enchant_pools"); + out: + for (int i = 0; i < pools.size(); i++) { + JsonArray pool = pools.get(i).getAsJsonArray(); + + boolean hasThis = false; + boolean hasApplied = false; + + for (int j = 0; j < pool.size(); j++) { + String enchIdPoolElement = pool.get(j).getAsString(); + if (enchId.equalsIgnoreCase(enchIdPoolElement)) { + hasThis = true; + } else if (playerEnchantIds.containsKey(enchIdPoolElement)) { + hasApplied = true; + } + if (hasThis && hasApplied) { + this.conflicts = true; + break out; + } + } + } + } + + if (level >= 1 && Constants.ENCHANTS.has("enchants_xp_cost")) { + JsonObject allCosts = Constants.ENCHANTS.getAsJsonObject("enchants_xp_cost"); + if (allCosts.has(enchId)) { + JsonArray costs = allCosts.getAsJsonArray(enchId); + + if (costs.size() >= 1) { + if (useMaxLevelForCost) { + this.xpCost = costs.get(costs.size() - 1).getAsInt(); + } else if (level - 1 < costs.size()) { + this.xpCost = costs.get(level - 1).getAsInt(); + } else { + overMaxLevel = true; + } + } + } + + } + } + } + } + + public OrbDisplay orbDisplay = new OrbDisplay(); + + private int guiLeft; + private int guiTop; + private boolean shouldOverrideFast = false; + private boolean shouldOverrideET = false; + private boolean shouldOverrideGemstones = false; + private boolean shouldOverrideXp = false; + public float pageOpen; + public float pageOpenLast; + public float pageOpenRandom; + public float pageOpenVelocity; + public float bookOpen; + public float bookOpenLast; + + private int currentPage; + private int expectedMaxPage; + + private boolean isScrollingLeft = true; + + private ItemStack enchantingItem = null; + + private int removingEnchantPlayerLevel = -1; + + private final GuiElementTextField searchField = new GuiElementTextField("", GuiElementTextField.SCISSOR_TEXT); + + private final HashMap playerEnchantIds = new HashMap<>(); + + private boolean searchRemovedFromApplicable = false; + private boolean searchRemovedFromRemovable = false; + private final List applicable = new ArrayList<>(); + private final List removable = new ArrayList<>(); + + private final List applicableItem = new ArrayList<>(); + private final List removableItem = new ArrayList<>(); + private final HashMap enchanterEnchLevels = new HashMap<>(); + private final HashMap enchanterItemLevels = new HashMap<>(); + private Enchantment enchanterCurrentEnch = null; + private HexItem enchanterCurrentItem = null; + + public Random random = new Random(); + + private EnchantState currentState = EnchantState.NO_ITEM; + private EnchantState lastState = EnchantState.NO_ITEM; + + private final LerpingInteger leftScroll = new LerpingInteger(0, 150); + private final LerpingInteger rightScroll = new LerpingInteger(0, 150); + + private final LerpingFloat arrowAmount = new LerpingFloat(0, 100); + + private static final int X_SIZE = 364; + private static final int Y_SIZE = 215; + + private int clickedScrollOffset = -1; + private boolean isClickedScrollLeft = true; + + private boolean isChangingEnchLevel = false; + + private long cancelButtonAnimTime = 0; + private long confirmButtonAnimTime = 0; + + public static GuiCustomHex getInstance() { + return INSTANCE; + } + + public boolean shouldOverride(String containerName) { + CalendarOverlay.ableToClickCalendar = true; + if (containerName == null) { + shouldOverrideET = false; + shouldOverrideFast = false; + shouldOverrideGemstones = false; + shouldOverrideXp = false; + searchField.setText(""); + return false; + } + boolean config = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI; + final List gemList = new ArrayList<>(Arrays.asList( + "\u2764", + "\u2748", + "\u270e", + "\u2618", + "\u2e15", + "\u2727", + "\u2741", + "\u2742" + )); + shouldOverrideFast = config && + (containerName.length() >= 7 && Objects.equals("The Hex", containerName.substring(0, "The Hex".length()))) && + NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard(); + + shouldOverrideET = config && + (containerName.length() >= 12 && Objects.equals( + "Enchant Item", + containerName.substring(0, "Enchant Item".length()) + )) && NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard(); + + shouldOverrideGemstones = config && + (containerName.length() >= 12 && Objects.equals( + "Gemstones ➜", + containerName.substring(0, "Gemstones ➜".length()) + )) && NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard(); + if (shouldOverrideGemstones) { + for (String string : gemList) { + if (containerName.contains(string)) { + shouldOverrideGemstones = false; + break; + } + } + } + + shouldOverrideXp = config && + (containerName.length() >= 21 && Objects.equals("Bottles of Enchanting", containerName.substring(0, "Bottles of Enchanting".length()))) && + NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard(); + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + ContainerChest cc = (ContainerChest) chest.inventorySlots; + ItemStack hexStack = cc.getLowerChestInventory().getStackInSlot(50); + CalendarOverlay.ableToClickCalendar = !(shouldOverrideET || shouldOverrideFast || shouldOverrideGemstones || shouldOverrideXp); + if (hexStack != null && hexStack.getItem() == Items.experience_bottle) + return (shouldOverrideET || shouldOverrideFast); + if (!shouldOverrideFast && !shouldOverrideET && !shouldOverrideGemstones && !shouldOverrideXp) { + currentState = EnchantState.NO_ITEM; + applicable.clear(); + removable.clear(); + applicableItem.clear(); + removableItem.clear(); + expectedMaxPage = 1; + enchanterCurrentItem = null; + searchField.setText(""); + } + return (shouldOverrideFast || shouldOverrideGemstones || shouldOverrideXp); + } + + private int tickCounter = 0; + + public void tick(String containerName) { + if (containerName.equals("The Hex")) { + currentState = EnchantState.HAS_ITEM_IN_HEX; + tickHex(); + } else if (containerName.contains("Enchant Item")) { + tickEnchants(); + } else if (containerName.contains("Books") || containerName.contains("Modifiers") || containerName.contains( + "Reforges") || containerName.contains("Item Upgrades") || containerName.equals("Bottles of Enchanting")) { + tickBooks(); + } else if (containerName.contains("Gemstones")) { + tickGemstones(); + } else { + tickBooks(); + } + } + + private void tickEnchants() { + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + ContainerChest cc = (ContainerChest) chest.inventorySlots; + + //ItemStack hexStack = cc.getLowerChestInventory().getStackInSlot(12); + ItemStack enchantingItemStack = cc.getLowerChestInventory().getStackInSlot(19); + //ItemStack stack = cc.getLowerChestInventory().getStackInSlot(23); + ItemStack hopperStack = cc.getLowerChestInventory().getStackInSlot(51); + + int lastPage = currentPage; + + this.lastState = currentState; + + if (hopperStack != null && hopperStack.getItem() != Item.getItemFromBlock(Blocks.hopper) && + enchantingItem != null) { + currentState = EnchantState.ADDING_ENCHANT; + } else if (enchantingItemStack == null) { + if (currentState == EnchantState.SWITCHING_DONT_UPDATE || currentState == EnchantState.NO_ITEM) { + currentState = EnchantState.NO_ITEM; + } else { + currentState = EnchantState.SWITCHING_DONT_UPDATE; + } + } else { + ItemStack sanityCheckStack = cc.getLowerChestInventory().getStackInSlot(12); + if (sanityCheckStack == null || sanityCheckStack.getItem() == Items.enchanted_book) { + currentState = EnchantState.HAS_ITEM; + enchantingItem = enchantingItemStack; + } else { + currentState = EnchantState.SWITCHING_DONT_UPDATE; + } + } + + if (currentState == EnchantState.HAS_ITEM) { + ItemStack pageUpStack = cc.getLowerChestInventory().getStackInSlot(17); + ItemStack pageDownStack = cc.getLowerChestInventory().getStackInSlot(35); + if (pageUpStack != null && pageDownStack != null) { + currentPage = 0; + boolean upIsGlass = pageUpStack.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane); + boolean downIsGlass = pageDownStack.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane); + int page = -1; + + expectedMaxPage = 1; + if (!downIsGlass) { + try { + page = Integer.parseInt(Utils.getRawTooltip(pageDownStack).get(1).substring(11)) - 1; + expectedMaxPage = page + 1; + } catch (Exception ignored) { + } + } + if (page == -1 && !upIsGlass) { + try { + page = Integer.parseInt(Utils.getRawTooltip(pageUpStack).get(1).substring(11)) + 1; + expectedMaxPage = page; + } catch (Exception ignored) { + } + } + if (page == -1) { + currentPage = 1; + } else { + currentPage = page; + } + } + } + + orbDisplay.physicsTickOrbs(); + + if (++tickCounter >= 20) { + tickCounter = 0; + } + + boolean updateItems = tickCounter == 0; + + if (currentState == EnchantState.ADDING_ENCHANT) { + if (arrowAmount.getTarget() != 1) { + arrowAmount.setTarget(1); + arrowAmount.resetTimer(); + } + } else { + if (arrowAmount.getTarget() != 0) { + arrowAmount.setTarget(0); + arrowAmount.resetTimer(); + } + } + + // Set allowedSwitchStates = Sets.newHashSet(EnchantState.ADDING_ENCHANT, EnchantState.HAS_ITEM, EnchantState.SWITCHING_DONT_UPDATE); + if (lastState != currentState || lastPage != currentPage) { + // if (!allowedSwitchStates.contains(lastState) || !allowedSwitchStates.contains(currentState)) { + leftScroll.setValue(0); + rightScroll.setValue(0); + // } + updateItems = true; + } + + if (updateItems && currentState != EnchantState.SWITCHING_DONT_UPDATE) { + enchanterEnchLevels.clear(); + + if (enchantingItem != null) { + playerEnchantIds.clear(); + NBTTagCompound tag = enchantingItem.getTagCompound(); + if (tag != null) { + NBTTagCompound ea = tag.getCompoundTag("ExtraAttributes"); + if (ea != null) { + NBTTagCompound enchantments = ea.getCompoundTag("enchantments"); + if (enchantments != null) { + for (String enchId : enchantments.getKeySet()) { + playerEnchantIds.put(enchId, enchantments.getInteger(enchId)); + } + } + } + } + } + + if (currentState == EnchantState.ADDING_ENCHANT) { + removingEnchantPlayerLevel = -1; + boolean updateLevel = enchanterCurrentEnch == null; + boolean hasXpBottle = false; + for (int i = 0; i < 27; i++) { + int slotIndex = 9 + i; + ItemStack book = cc.getLowerChestInventory().getStackInSlot(slotIndex); + ItemStack xpBottle = cc.getLowerChestInventory().getStackInSlot(50); + if (!hasXpBottle && xpBottle != null && + xpBottle.getItem() == Items.experience_bottle) { //Make show when in dungeon screen + String name = "Buy Xp Bottles"; + String id = "XP_BOTTLE"; + Enchantment xpBottleEnch = new Enchantment(50, name, id, + Utils.getRawTooltip(xpBottle), 1, true, false + ); + boolean hasHasXpBottle = false; + for (Enchantment ench : applicable) { + if (ench.enchId.equals("XP_BOTTLE")) { + hasHasXpBottle = true; + break; + } + } + if (!hasHasXpBottle) applicable.add(xpBottleEnch); + hasXpBottle = true; + } + if (book != null && book.getItem() == Items.enchanted_book) { + NBTTagCompound tagBook = book.getTagCompound(); + if (tagBook != null) { + NBTTagCompound ea = tagBook.getCompoundTag("ExtraAttributes"); + if (ea != null) { + NBTTagCompound enchantments = ea.getCompoundTag("enchantments"); + if (enchantments != null) { + String enchId = Utils.cleanColour(book.getDisplayName()).toLowerCase().replace(" ", "_").replace( + "-", + "_" + ); + String name = Utils.cleanColour(book.getDisplayName()); + int enchLevel = -1; + if (name.equalsIgnoreCase("Bane of Arthropods")) { + name = "Bane of Arth."; + } else if (name.equalsIgnoreCase("Projectile Protection")) { + name = "Projectile Prot"; + } else if (name.equalsIgnoreCase("Blast Protection")) { + name = "Blast Prot"; + } else if (name.equalsIgnoreCase("Turbo-Mushrooms")) { + name = "Turbo-Mush"; + } + Matcher levelMatcher = ENCHANT_LEVEL_PATTERN.matcher(enchId); + if (levelMatcher.matches()) { + enchLevel = Utils.parseRomanNumeral(levelMatcher.group(2).toUpperCase()); + enchId = levelMatcher.group(1); + } + Enchantment enchantment = new Enchantment(slotIndex, name, enchId, + Utils.getRawTooltip(book), enchLevel, false, true + ); + int index = 0; + for (String lore : enchantment.displayLore) { + if (lore.contains("N/A") && enchantment.price > 0) { + String price = numberFormat.format(enchantment.price); + enchantment.displayLore.set(index, "\u00a76" + price + ".0 Coins"); + } + index++; + } + enchantment.displayLore.remove(0); + + if (removingEnchantPlayerLevel == -1 && playerEnchantIds.containsKey(enchId)) { + removingEnchantPlayerLevel = playerEnchantIds.get(enchId); + } + + if (removingEnchantPlayerLevel >= 0 && enchantment.level < removingEnchantPlayerLevel) { + continue; + } + + if (enchanterCurrentEnch == null) { + enchanterCurrentEnch = enchantment; + } else if (updateLevel) { + if (removingEnchantPlayerLevel < 0 && enchantment.level > enchanterCurrentEnch.level) { + enchanterCurrentEnch = enchantment; + } else if (removingEnchantPlayerLevel >= 0 && enchantment.level < enchanterCurrentEnch.level) { + enchanterCurrentEnch = enchantment; + } + } + + enchanterEnchLevels.put(enchantment.level, enchantment); + } + } + } + } + } + if (enchanterCurrentEnch != null && removingEnchantPlayerLevel >= 0) { + for (String line : enchanterCurrentEnch.displayLore) { + Matcher matcher = XP_COST_PATTERN.matcher(line); + if (matcher.find()) { + enchanterCurrentEnch.xpCost = Integer.parseInt(matcher.group(1)); + } + } + } + } else { + isChangingEnchLevel = false; + enchanterCurrentEnch = null; + + searchRemovedFromRemovable = false; + searchRemovedFromApplicable = false; + applicable.clear(); + removable.clear(); + boolean hasXpBottle = false; + if (currentState == EnchantState.HAS_ITEM) { + for (int i = 0; i < 15; i++) { + int slotIndex = 12 + (i % 5) + (i / 5) * 9; + ItemStack book = cc.getLowerChestInventory().getStackInSlot(slotIndex); + ItemStack xpBottle = cc.getLowerChestInventory().getStackInSlot(50); + if (!hasXpBottle && xpBottle != null && + xpBottle.getItem() == Items.experience_bottle) { //Make show when in dungeon screen + String name = "Buy Xp Bottles"; + String id = "XP_BOTTLE"; + Enchantment xpBottleEnch = new Enchantment(50, name, id, + Utils.getRawTooltip(xpBottle), 1, true, false + ); + applicable.add(xpBottleEnch); + hasXpBottle = true; + } + if (book != null) { + NBTTagCompound tagBook = book.getTagCompound(); + if (tagBook != null) { + NBTTagCompound ea = tagBook.getCompoundTag("ExtraAttributes"); + if (ea != null) { + NBTTagCompound enchantments = ea.getCompoundTag("enchantments"); + if (enchantments != null) { + String enchId = Utils + .cleanColour(book.getDisplayName()) + .toLowerCase() + .replace(" ", "_") + .replace("-", "_"); + if (enchId.equalsIgnoreCase("_")) continue; + if (enchId.equals("prosecute")) { + enchId = "PROSECUTE"; + } + String name = Utils.cleanColour(book.getDisplayName()); + + if (searchField.getText().trim().isEmpty() || + name.toLowerCase().contains(searchField.getText().trim().toLowerCase())) { + if (name.equalsIgnoreCase("Bane of Arthropods")) { + name = "Bane of Arth."; + } else if (name.equalsIgnoreCase("Projectile Protection")) { + name = "Projectile Prot"; + } else if (name.equalsIgnoreCase("Blast Protection")) { + name = "Blast Prot"; + } else if (name.equalsIgnoreCase("Turbo-Mushrooms")) { + name = "Turbo-Mush"; + } + Matcher nameMatcher = ENCHANT_NAME_PATTERN.matcher(name); + if (nameMatcher.matches()) { + name = nameMatcher.group(1); + } + + if (playerEnchantIds.containsKey(enchId)) { + Enchantment enchantment = new Enchantment(slotIndex, name, enchId, + Utils.getRawTooltip(book), playerEnchantIds.get(enchId), false, false + ); + if (!enchantment.overMaxLevel) { + removable.add(enchantment); + } + } else { + Enchantment enchantment = new Enchantment(slotIndex, name, enchId, + Utils.getRawTooltip(book), 1, true, true + ); + applicable.add(enchantment); + } + } else { + if (playerEnchantIds.containsKey(enchId)) { + searchRemovedFromRemovable = true; + } else { + searchRemovedFromApplicable = true; + } + } + + } + } + } + } + } + NEUConfig cfg = NotEnoughUpdates.INSTANCE.config; + int mult = cfg.enchantingSolvers.enchantOrdering == 0 ? 1 : -1; + Comparator comparator = cfg.enchantingSolvers.enchantSorting == 0 ? + Comparator.comparingInt(e -> mult * e.xpCost) : + (c1, c2) -> mult * + c1.enchId.toLowerCase().compareTo(c2.enchId.toLowerCase()); + removable.sort(comparator); + applicable.sort(comparator); + } + } + } + + //Update book model state + if (lastState != currentState) { + do { + this.pageOpenRandom += (float) (this.random.nextInt(4) - this.random.nextInt(4)); + + } while (!(this.pageOpen > this.pageOpenRandom + 1.0F) && !(this.pageOpen < this.pageOpenRandom - 1.0F)); + } + + this.pageOpenLast = this.pageOpen; + this.bookOpenLast = this.bookOpen; + + if (currentState == EnchantState.HAS_ITEM || currentState == EnchantState.ADDING_ENCHANT) { + this.bookOpen += 0.2F; + } else { + this.bookOpen -= 0.2F; + } + + this.bookOpen = MathHelper.clamp_float(this.bookOpen, 0.0F, 1.0F); + float f1 = (this.pageOpenRandom - this.pageOpen) * 0.4F; + f1 = MathHelper.clamp_float(f1, -0.2F, 0.2F); + this.pageOpenVelocity += (f1 - this.pageOpenVelocity) * 0.9F; + this.pageOpen += this.pageOpenVelocity; + } + + private void tickBooks() { + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + ContainerChest cc = (ContainerChest) chest.inventorySlots; + + ItemStack enchantingItemStack = cc.getLowerChestInventory().getStackInSlot(19); + ItemStack anvilStack = cc.getLowerChestInventory().getStackInSlot(28); + + this.lastState = currentState; + + if (anvilStack != null && anvilStack.getItem() == Item.getItemFromBlock(Blocks.anvil) && + currentState != EnchantState.ADDING_BOOK) { + currentState = EnchantState.HAS_ITEM_IN_BOOKS; + enchantingItem = enchantingItemStack; + } else if (currentState == EnchantState.HAS_ITEM_IN_BOOKS && enchantingItem == null && + enchantingItemStack != null) { + enchantingItem = enchantingItemStack; + } else if (anvilStack != null && anvilStack.getItem() == Item.getItemFromBlock(Blocks.enchanting_table) && + currentState != EnchantState.ADDING_BOOK) { + currentState = EnchantState.HAS_ITEM_IN_BOOKS; + enchantingItem = enchantingItemStack; + } + + orbDisplay.physicsTickOrbs(); + + if (++tickCounter >= 20) { + tickCounter = 0; + } + + if (currentState == EnchantState.ADDING_BOOK) { + if (arrowAmount.getTarget() != 1) { + arrowAmount.setTarget(1); + arrowAmount.resetTimer(); + } + } else { + if (arrowAmount.getTarget() != 0) { + arrowAmount.setTarget(0); + arrowAmount.resetTimer(); + } + } + + isChangingEnchLevel = false; + + searchRemovedFromRemovable = false; + searchRemovedFromApplicable = false; + if (applicableItem.size() < 6) leftScroll.setValue(0); + applicableItem.clear(); + removableItem.clear(); + if (currentState == EnchantState.HAS_ITEM_IN_BOOKS || currentState == EnchantState.ADDING_BOOK) { + boolean hasRandomReforge = false; + for (int i = 0; i < 15; i++) { + int slotIndex = 12 + (i % 5) + (i / 5) * 9; + ItemStack book = cc.getLowerChestInventory().getStackInSlot(slotIndex); + ItemStack randomReforge = cc.getLowerChestInventory().getStackInSlot(48); + if (!hasRandomReforge && randomReforge != null && + randomReforge.getItem() == Item.getItemFromBlock(Blocks.anvil)) { //Make show when in dungeon screen + String name = Utils.cleanColour(randomReforge.getDisplayName()); + String id = Utils.cleanColour(randomReforge.getDisplayName()); + if (name.equals("Convert to Dungeon Item")) { + name = "Dungeonize Item"; + id = "CONVERT_TO_DUNGEON"; + } else if (name.equals("Random Basic Reforge")) { + name = "Basic Reforge"; + id = "RANDOM_REFORGE"; + } + HexItem reforgeItem = new HexItem(48, name, id, + Utils.getRawTooltip(randomReforge), true, true + ); + boolean hasAdded = false; + for (String lore : reforgeItem.displayLore) { + if (lore.contains("This item is already a Dungeon")) { + removableItem.add(reforgeItem); + hasAdded = true; + break; + } + } + if (!hasAdded) applicableItem.add(reforgeItem); + hasRandomReforge = true; + } + if (book != null) { + NBTTagCompound tagBook = book.getTagCompound(); + if (tagBook != null) { + NBTTagCompound ea = tagBook.getCompoundTag("ExtraAttributes"); + if (ea != null) { + NBTTagCompound enchantments = ea.getCompoundTag("enchantments"); + if (enchantments != null) { + String itemId = Utils.cleanColour(book.getDisplayName()).toUpperCase().replace(" ", "_").replace( + "-", + "_" + ); + String name = Utils.cleanColour(book.getDisplayName()); + if (itemId.equalsIgnoreCase("_")) continue; + if (itemId.equalsIgnoreCase("Item_Maxed_Out")) continue; + if (searchField.getText().trim().isEmpty() || + name.toLowerCase().contains(searchField.getText().trim().toLowerCase())) { + if (name.equalsIgnoreCase("Hot Potato Book")) { + name = "Hot Potato"; + } else if (name.equalsIgnoreCase("Fuming Potato Book")) { + name = "Fuming Potato"; + } else if (name.equalsIgnoreCase("Recombobulator 3000")) { + name = "Recombobulator"; + } else if (name.contains("Power Scroll")) { + name = name.replace("Power ", ""); + } else if (name.contains("\u272a")) { + name = name.replaceAll("[^✪]*", ""); + } else if (name.equalsIgnoreCase("First Master Star")) { + name = "Master Star \u00a7c➊"; + } else if (name.equalsIgnoreCase("Second Master Star")) { + name = "Master Star \u00a7c➋"; + } else if (name.equalsIgnoreCase("Third Master Star")) { + name = "Master Star \u00a7c➌"; + } else if (name.equalsIgnoreCase("Fourth Master Star")) { + name = "Master Star \u00a7c➍"; + } else if (name.equalsIgnoreCase("Fifth Master Star")) { + name = "Master Star \u00a7c➎"; + } else if (name.equalsIgnoreCase("The Art Of Peace")) { + name = "Art Of Peace"; + } else if (name.equalsIgnoreCase("Mana Disintegrator")) { + name = "M Disintegrator"; + } + /*if (playerEnchantIds.containsKey(itemId)) { + HexItem item = new HexItem(slotIndex, name, itemId, + Utils.getRawTooltip(book), false, false + ); + if (!item.overMaxLevel) { + removableItem.add(item); + } + enchanterItemLevels.put(item.level, item); + } else */ + { + HexItem item = new HexItem(slotIndex, name, itemId, + Utils.getRawTooltip(book), true, true + ); + enchanterItemLevels.put(item.level, item); + if (item.itemType != ItemType.UNKNOWN) { + int potatoCount = 0; + int killCount = 0; + int warCount = 0; + int ffdCount = 0; + int recombCount = 0; + int effLevel = 0; + int starCount = 0; + int singularityCount = 0; + int tunerCount = 0; + int peaceCount = 0; + int manaDisintegratorCount = 0; + boolean shadowWarp = false; + boolean witherShield = false; + boolean implosion = false; + String reforge = ""; + if (enchantingItem != null) { + NBTTagCompound tagItem = enchantingItem.getTagCompound(); + if (tagItem != null) { + NBTTagCompound extra = tagItem.getCompoundTag("ExtraAttributes"); + if (extra != null) { + potatoCount = extra.getInteger("hot_potato_count"); + killCount = extra.getInteger("stats_book"); + warCount = extra.getInteger("art_of_war_count"); + ffdCount = extra.getInteger("farming_for_dummies_count"); + recombCount = extra.getInteger("rarity_upgrades"); + starCount = extra.getInteger("upgrade_level"); + singularityCount = extra.getInteger("wood_singularity_count"); + tunerCount = extra.getInteger("tuned_transmission"); + peaceCount = extra.getInteger("art_of_peace_count"); + manaDisintegratorCount = extra.getInteger("mana_disintegrator_count"); + reforge = extra.getString("modifier"); + NBTTagCompound enchs = extra.getCompoundTag("enchantments"); + NBTTagList scrolls = extra.getTagList("ability_scroll", 8); + if (enchs != null) { + effLevel = enchs.getInteger("efficiency"); + } + if (scrolls != null) { + for (int index = 0; index < scrolls.tagCount(); index++) { + if (scrolls.getStringTagAt(index).equals("IMPLOSION_SCROLL")) { + implosion = true; + } else if (scrolls.getStringTagAt(index).equals("SHADOW_WARP_SCROLL")) { + shadowWarp = true; + } else if (scrolls.getStringTagAt(index).equals("WITHER_SHIELD_SCROLL")) { + witherShield = true; + } + } + } + } + } + } + if (item.itemName.length() > 14) item.itemName = item.itemName.substring(0, 14); + + if (item.itemType == ItemType.HOT_POTATO) { + if (potatoCount < 10) applicableItem.add(item); + else removableItem.add(item); + + } else if (item.itemType == ItemType.FUMING_POTATO) { + if (potatoCount >= 10 && potatoCount < 15) applicableItem.add(item); + else if (potatoCount >= 15) removableItem.add(item); + + } else if (item.itemType == ItemType.BOOK_OF_STATS) { + if (killCount > 0) removableItem.add(item); + else applicableItem.add(item); + + } else if (item.itemType == ItemType.ART_OF_WAR) { + if (warCount > 0) removableItem.add(item); + else applicableItem.add(item); + + } else if (item.itemType == ItemType.FARMING_DUMMY) { + if (ffdCount < 5) applicableItem.add(item); + else removableItem.add(item); + + } else if (item.itemType == ItemType.RECOMB) { + if (recombCount > 0) removableItem.add(item); + else applicableItem.add(item); + + } else if (item.itemType == ItemType.SILEX) { + if (effLevel >= 5 && effLevel < 10) applicableItem.add(item); + else if (effLevel == 10) removableItem.add(item); + + } else if (item.isPowerScroll()) { + applicableItem.add(item); + + } else if (item.isMasterStar()) { + applicableItem.add(item); + + } else if (item.isDungeonStar()) { + if (starCount >= item.itemType.getStarLevel()) removableItem.add(item); + else applicableItem.add(item); + + } else if (item.itemType == ItemType.WOOD_SINGULARITY) { + if (singularityCount > 0) removableItem.add(item); + else applicableItem.add(item); + + } else if (item.isHypeScroll()) { + if (shadowWarp) removableItem.add(item); + else if (implosion) removableItem.add(item); + else if (witherShield) removableItem.add(item); + else applicableItem.add(item); + + } else if (item.itemType == ItemType.TUNER) { + if (tunerCount >= 4) removableItem.add(item); + else applicableItem.add(item); + + } else if (item.itemType == ItemType.REFORGE) { + if (item.getReforge().equalsIgnoreCase(reforge) && !reforge.equals("")) removableItem.add(item); + else applicableItem.add(item); + + } else if (item.itemType == ItemType.ART_OF_PEACE) { + if (peaceCount > 0) removableItem.add(item); + else applicableItem.add(item); + + } else if (item.itemType == ItemType.MANA_DISINTEGRATOR) { + if (manaDisintegratorCount >= 10) removableItem.add(item); + else applicableItem.add(item); + + } else { + applicableItem.add(item); + } + } else { + applicableItem.add(item); + } + } + } else { + if (playerEnchantIds.containsKey(itemId)) { + searchRemovedFromRemovable = true; + } else { + searchRemovedFromApplicable = true; + } + } + } + } + } + } + } + NEUConfig cfg = NotEnoughUpdates.INSTANCE.config; + int mult = cfg.enchantingSolvers.enchantOrdering == 0 ? 1 : -1; + Comparator comparator = cfg.enchantingSolvers.enchantSorting == 0 ? + Comparator.comparingInt(e -> (int) (mult * e.price)) : + (c1, c2) -> mult * + c1.itemId.toLowerCase().compareTo(c2.itemId.toLowerCase()); + removableItem.sort(comparator); + applicableItem.sort(comparator); + } + } + + private void tickHex() { + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + ContainerChest cc = (ContainerChest) chest.inventorySlots; + + ItemStack enchantingItemStack = cc.getLowerChestInventory().getStackInSlot(22); + ItemStack glassStack = cc.getLowerChestInventory().getStackInSlot(12); + //ItemStack anvilStack = cc.getLowerChestInventory().getStackInSlot(28); + + this.lastState = currentState; + + if (enchantingItemStack != null) { + if (glassStack.getItem() != null && glassStack.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane)) { + if (glassStack.getItemDamage() == 14) { + currentState = EnchantState.INVALID_ITEM_HEX; + } else if (glassStack.getItemDamage() == 10) { + currentState = EnchantState.HAS_ITEM_IN_HEX; + } else { + currentState = EnchantState.NO_ITEM_IN_HEX; + } + enchantingItem = enchantingItemStack; + } + } else { + currentState = EnchantState.NO_ITEM_IN_HEX; + } + + orbDisplay.physicsTickOrbs(); + + if (++tickCounter >= 20) { + tickCounter = 0; + } + + if (currentState == EnchantState.ADDING_BOOK) { + if (arrowAmount.getTarget() != 1) { + arrowAmount.setTarget(1); + arrowAmount.resetTimer(); + } + } else { + if (arrowAmount.getTarget() != 0) { + arrowAmount.setTarget(0); + arrowAmount.resetTimer(); + } + } + + isChangingEnchLevel = false; + + searchRemovedFromRemovable = false; + searchRemovedFromApplicable = false; + applicableItem.clear(); + removableItem.clear(); + boolean hasHexItem = false; + if (currentState == EnchantState.HAS_ITEM_IN_HEX) { + for (int i = 0; i < 9; i++) { + int slotIndex = 15 + (i % 3) + (i / 3) * 9; + ItemStack book = cc.getLowerChestInventory().getStackInSlot(slotIndex); + if (!hasHexItem && glassStack != null) { + HexItem item = new HexItem(slotIndex, "Total Upgrades", "TOTAL_UPGRADES", + Utils.getRawTooltip(glassStack), true, true + ); + removableItem.add(item); + hasHexItem = true; + } + if (book != null) { + NBTTagCompound tagBook = book.getTagCompound(); + if (tagBook != null) { + NBTTagCompound ea = tagBook.getCompoundTag("ExtraAttributes"); + if (ea != null) { + NBTTagCompound enchantments = ea.getCompoundTag("enchantments"); + if (enchantments != null) { + String itemId = Utils.cleanColour(book.getDisplayName()).toUpperCase().replace(" ", "_").replace( + "-", + "_" + ); + String name = Utils.cleanColour(book.getDisplayName()); + if (itemId.equalsIgnoreCase("_")) continue; + if (itemId.equalsIgnoreCase("Item_Maxed_Out")) continue; + if (searchField.getText().trim().isEmpty() || + name.toLowerCase().contains(searchField.getText().trim().toLowerCase())) { + if (name.equalsIgnoreCase("Ultimate Enchantments")) { + name = "Ult Enchants"; + } + /*if (playerEnchantIds.containsKey(itemId)) { + HexItem item = new HexItem(slotIndex, name, itemId, + Utils.getRawTooltip(book), false, false + ); + if (!item.overMaxLevel) { + removableItem.add(item); + } + enchanterItemLevels.put(item.level, item); + } else */ + { + HexItem item = new HexItem(slotIndex, name, "HEX_ITEM" + i, + Utils.getRawTooltip(book), true, true + ); + enchanterItemLevels.put(item.level, item); + applicableItem.add(item); + } + } else { + if (playerEnchantIds.containsKey(itemId)) { + searchRemovedFromRemovable = true; + } else { + searchRemovedFromApplicable = true; + } + } + } + } + } + } + } + NEUConfig cfg = NotEnoughUpdates.INSTANCE.config; + int mult = cfg.enchantingSolvers.enchantOrdering == 0 ? 1 : -1; + Comparator comparator = cfg.enchantingSolvers.enchantSorting == 0 ? + Comparator.comparingInt(e -> (int) (mult * e.price)) : + (c1, c2) -> mult * + c1.itemId.toLowerCase().compareTo(c2.itemId.toLowerCase()); + removableItem.sort(comparator); + applicableItem.sort(comparator); + } + } + + private void tickGemstones() { + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + ContainerChest cc = (ContainerChest) chest.inventorySlots; + + ItemStack enchantingItemStack = cc.getLowerChestInventory().getStackInSlot(19); + ItemStack portalStack = cc.getLowerChestInventory().getStackInSlot(28); + + int lastPage = currentPage; + this.lastState = currentState; + if (portalStack != null && portalStack.getItem() == Item.getItemFromBlock(Blocks.end_portal_frame) && + currentState != EnchantState.ADDING_GEMSTONE && !shouldOverrideGemstones && + currentState != EnchantState.APPLYING_GEMSTONE) { + currentState = EnchantState.HAS_ITEM_IN_GEMSTONE; + enchantingItem = enchantingItemStack; + } else if (portalStack != null && portalStack.getItem() == Item.getItemFromBlock(Blocks.end_portal_frame) && + shouldOverrideGemstones && currentState != EnchantState.APPLYING_GEMSTONE) { + currentState = EnchantState.ADDING_GEMSTONE; + } else if (currentState == EnchantState.HAS_ITEM_IN_GEMSTONE && enchantingItem == null && + enchantingItemStack != null) { + enchantingItem = enchantingItemStack; + } else if (currentState != EnchantState.APPLYING_GEMSTONE) { + currentState = EnchantState.HAS_ITEM_IN_GEMSTONE; + } + + if (currentState == EnchantState.APPLYING_GEMSTONE || currentState == EnchantState.ADDING_GEMSTONE) { + ItemStack pageUpStack = cc.getLowerChestInventory().getStackInSlot(17); + ItemStack pageDownStack = cc.getLowerChestInventory().getStackInSlot(35); + if (pageUpStack != null && pageDownStack != null) { + currentPage = 0; + boolean upIsGlass = pageUpStack.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane); + boolean downIsGlass = pageDownStack.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane); + int page = -1; + + expectedMaxPage = 1; + if (!downIsGlass) { + try { + page = Integer.parseInt(Utils.getRawTooltip(pageDownStack).get(1).substring(11)) - 1; + expectedMaxPage = page + 1; + } catch (Exception ignored) { + } + } + if (page == -1 && !upIsGlass) { + try { + page = Integer.parseInt(Utils.getRawTooltip(pageUpStack).get(1).substring(11)) + 1; + expectedMaxPage = page; + } catch (Exception ignored) { + } + } + if (page == -1) { + currentPage = 1; + } else { + currentPage = page; + } + } + } + + orbDisplay.physicsTickOrbs(); + + if (++tickCounter >= 20) { + tickCounter = 0; + } + + if (lastState != currentState || lastPage != currentPage) { + leftScroll.setValue(0); + rightScroll.setValue(0); + } + + if (currentState == EnchantState.APPLYING_GEMSTONE) { + if (arrowAmount.getTarget() != 1) { + arrowAmount.setTarget(1); + arrowAmount.resetTimer(); + } + } else { + if (arrowAmount.getTarget() != 0) { + arrowAmount.setTarget(0); + arrowAmount.resetTimer(); + } + } + + isChangingEnchLevel = false; + + searchRemovedFromRemovable = false; + searchRemovedFromApplicable = false; + applicableItem.clear(); + removableItem.clear(); + if (isInGemstones()) { + for (int i = 0; i < 15; i++) { + int slotIndex = 12 + (i % 5) + (i / 5) * 9; + ItemStack book = cc.getLowerChestInventory().getStackInSlot(slotIndex); + if (book != null) { + NBTTagCompound tagBook = book.getTagCompound(); + if (tagBook != null) { + NBTTagCompound ea = tagBook.getCompoundTag("ExtraAttributes"); + if (ea != null) { + NBTTagCompound enchantments = ea.getCompoundTag("enchantments"); + if (enchantments != null) { + String itemId = Utils.cleanColour(book.getDisplayName()).toUpperCase().replace(" ", "_").replace( + "-", + "_" + ); + String name = Utils.cleanColour(book.getDisplayName()); + if (itemId.equalsIgnoreCase("_")) continue; + if (itemId.equalsIgnoreCase("Item_Maxed_Out")) continue; + if (searchField.getText().trim().isEmpty() || + name.toLowerCase().contains(searchField.getText().trim().toLowerCase())) { + /*if (playerEnchantIds.containsKey(itemId)) { + HexItem item = new HexItem(slotIndex, name, itemId, + Utils.getRawTooltip(book), false, false + ); + if (!item.overMaxLevel) { + removableItem.add(item); + } + enchanterItemLevels.put(item.level, item); + } else */ + { + HexItem item = new HexItem(slotIndex, name, itemId, + Utils.getRawTooltip(book), true, true + ); + enchanterItemLevels.put(item.level, item); + if (item.isGemstone()) { + if (book.getItem() == Items.dye) { + item.conflicts = true; + } + boolean removed = false; + for (String lore : item.displayLore) { + if (lore.contains("Click to remove!")) { + removableItem.add(item); + removed = true; + break; + } + } + if (!removed) { + applicableItem.add(item); + } + if (item.itemName.length() > 14) item.itemName = item.itemName.substring(0, 14); + } else { + applicableItem.add(item); + } + } + } else { + if (playerEnchantIds.containsKey(itemId)) { + searchRemovedFromRemovable = true; + } else { + searchRemovedFromApplicable = true; + } + } + } + } + } + } + } + NEUConfig cfg = NotEnoughUpdates.INSTANCE.config; + int mult = cfg.enchantingSolvers.enchantOrdering == 0 ? 1 : -1; + Comparator comparator = cfg.enchantingSolvers.enchantSorting == 0 ? + Comparator.comparingInt(e -> (int) (mult * e.price)) : + (c1, c2) -> mult * + c1.itemId.toLowerCase().compareTo(c2.itemId.toLowerCase()); + removableItem.sort(comparator); + applicableItem.sort(comparator); + } + this.pageOpenLast = this.pageOpen; + } + + private List createTooltip(String title, int selectedOption, String... options) { + String selPrefix = EnumChatFormatting.DARK_AQUA + " \u25b6 "; + String unselPrefix = EnumChatFormatting.GRAY.toString(); + + for (int i = 0; i < options.length; i++) { + if (i == selectedOption) { + options[i] = selPrefix + options[i]; + } else { + options[i] = unselPrefix + options[i]; + } + } + + List list = Lists.newArrayList(options); + list.add(0, ""); + list.add(0, EnumChatFormatting.GREEN + title); + return list; + } + + public void render(float partialTicks, String containerName) { + if (containerName == null) return; + if (containerName.equals("The Hex")) { + renderHex(partialTicks); + } else if (containerName.contains("Enchant Item")) { + renderEnchantment(partialTicks); + } else if (containerName.contains("Books") || containerName.contains("Modifiers") || containerName.contains("Bottles of Enchanting")) { + renderBooks(partialTicks); + } else if (containerName.contains("Gemstones")) { + renderGemstones(partialTicks); + } else { + renderBooks(partialTicks); + } + } + + private void renderEnchantment(float partialTicks) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return; + + int playerXpLevel = Minecraft.getMinecraft().thePlayer.experienceLevel; + + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + ContainerChest cc = (ContainerChest) chest.inventorySlots; + + leftScroll.tick(); + rightScroll.tick(); + arrowAmount.tick(); + + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + int width = scaledResolution.getScaledWidth(); + int height = scaledResolution.getScaledHeight(); + int mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth; + int mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1; + + guiLeft = (width - X_SIZE) / 2; + guiTop = (height - Y_SIZE) / 2; + + List tooltipToDisplay = null; + boolean disallowClick = false; + ItemStack stackOnMouse = Minecraft.getMinecraft().thePlayer.inventory.getItemStack(); + int itemHoverX = -1; + int itemHoverY = -1; + boolean hoverLocked = false; + + drawGradientRect(0, 0, width, height, 0xc0101010, 0xd0101010); + + renderBaseTexture(); + + Minecraft.getMinecraft().fontRendererObj.drawString("Applicable", guiLeft + 7, guiTop + 7, 0x404040, false); + Minecraft.getMinecraft().fontRendererObj.drawString("Removable", guiLeft + 247, guiTop + 7, 0x404040, false); + + //Page Text + if (currentState == EnchantState.HAS_ITEM || currentState == EnchantState.ADDING_ENCHANT) { + String pageStr = "Page: " + currentPage + "/" + expectedMaxPage; + int pageStrLen = Minecraft.getMinecraft().fontRendererObj.getStringWidth(pageStr); + Utils.drawStringCentered(pageStr, Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2, guiTop + 14, false, 0x404040 + ); + + //Page Arrows + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - pageStrLen / 2 - 2 - 15, guiTop + 6, 15, 15, + 0, 15 / 512f, 372 / 512f, 387 / 512f, GL11.GL_NEAREST + ); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + pageStrLen / 2 + 2, guiTop + 6, 15, 15, + 15 / 512f, 30 / 512f, 372 / 512f, 387 / 512f, GL11.GL_NEAREST + ); + } + + tooltipToDisplay = renderSettings(mouseX, mouseY, tooltipToDisplay); + + renderScrollBars(applicable, removable, mouseY); + + //Enchant book model + renderEnchantBook(scaledResolution, partialTicks); + + //Can't be enchanted text + if (currentState == EnchantState.INVALID_ITEM) { + GlStateManager.disableDepth(); + Utils.drawStringCentered("This item can't", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2, guiTop + 88, true, 0xffff5555 + ); + Utils.drawStringCentered("be enchanted", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2, guiTop + 98, true, 0xffff5555 + ); + GlStateManager.enableDepth(); + } + + renderArrow(); + + //Text if no enchants appear + if (currentState == EnchantState.HAS_ITEM || currentState == EnchantState.ADDING_ENCHANT) { + if (applicable.isEmpty() && removable.isEmpty() && searchRemovedFromApplicable) { + Utils.drawStringCentered("Can't find that", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 28, true, 0xffff5555 + ); + Utils.drawStringCentered("enchant, perhaps", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 38, true, 0xffff5555 + ); + Utils.drawStringCentered("it is on", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 48, true, 0xffff5555 + ); + Utils.drawStringCentered("another page?", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 58, true, 0xffff5555 + ); + } else if (applicable.isEmpty() && !searchRemovedFromApplicable) { + Utils.drawStringCentered("No applicable", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 28, true, 0xffff5555 + ); + Utils.drawStringCentered("enchants on", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 38, true, 0xffff5555 + ); + Utils.drawStringCentered("this page...", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 48, true, 0xffff5555 + ); + } + if (applicable.isEmpty() && removable.isEmpty() && searchRemovedFromRemovable) { + Utils.drawStringCentered("Can't find that", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 28, true, 0xffff5555 + ); + Utils.drawStringCentered("enchant, perhaps", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 38, true, 0xffff5555 + ); + Utils.drawStringCentered("it is on", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 48, true, 0xffff5555 + ); + Utils.drawStringCentered("another page?", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 58, true, 0xffff5555 + ); + } else if (removable.isEmpty() && !searchRemovedFromRemovable) { + Utils.drawStringCentered("No removable", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 28, true, 0xffff5555 + ); + Utils.drawStringCentered("enchants on", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 38, true, 0xffff5555 + ); + Utils.drawStringCentered("this page...", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 48, true, 0xffff5555 + ); + } + } + //Available enchants (left) + GlScissorStack.push(0, guiTop + 18, width, guiTop + 18 + 96, scaledResolution); + for (int i = 0; i < 7; i++) { + int index = i + leftScroll.getValue() / 16; + + if (applicable.size() <= index) break; + Enchantment ench = applicable.get(index); + + int top = guiTop - (leftScroll.getValue() % 16) + 18 + 16 * i; + int vOffset = enchanterCurrentEnch != null && enchanterCurrentEnch.enchId.equals(ench.enchId) ? 16 : 0; + int uOffset = ench.conflicts ? 112 : 0; + int textOffset = vOffset / 16; + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + 8, top, 96, 16, + uOffset / 512f, (96 + uOffset) / 512f, (249 + vOffset) / 512f, (249 + 16 + vOffset) / 512f, GL11.GL_NEAREST + ); + + if (mouseX > guiLeft + 8 && mouseX <= guiLeft + 8 + 96 && + mouseY > top && mouseY <= top + 16) { + disallowClick = true; + if (ench.displayLore != null) { + tooltipToDisplay = ench.displayLore; + } + } + + String levelStr = "" + ench.xpCost; + int colour = 0xc8ff8f; + if (ench.xpCost > playerXpLevel) { + colour = 0xff5555; + } + + int levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2 - 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2 + 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2, + top + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2, + top + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2, + top + 4, + colour, + false + ); + + Minecraft.getMinecraft().fontRendererObj.drawString( + ench.enchantName, + guiLeft + 8 + 16 + 2 + textOffset, + top + 4 + textOffset, + 0xffffffdd, + true + ); + } + GlScissorStack.pop(scaledResolution); + + //Removable enchants (right) + GlScissorStack.push(0, guiTop + 18, width, guiTop + 18 + 96, scaledResolution); + for (int i = 0; i < 7; i++) { + int index = i + rightScroll.getValue() / 16; + + if (removable.size() <= index) break; + Enchantment ench = removable.get(index); + + int top = guiTop - (rightScroll.getValue() % 16) + 18 + 16 * i; + int vOffset = enchanterCurrentEnch != null && enchanterCurrentEnch.enchId.equals(ench.enchId) ? 16 : 0; + int textOffset = vOffset / 16; + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + 248, top, 96, 16, + 0, 96 / 512f, (249 + vOffset) / 512f, (249 + 16 + vOffset) / 512f, GL11.GL_NEAREST + ); + + if (mouseX > guiLeft + 248 && mouseX <= guiLeft + 248 + 96 && + mouseY > top && mouseY <= top + 16) { + disallowClick = true; + if (ench.displayLore != null) { + tooltipToDisplay = ench.displayLore; + } + } + + String levelStr = "" + ench.xpCost; + if (ench.xpCost < 0) levelStr = "?"; + int colour = 0xc8ff8f; + if (ench.xpCost > playerXpLevel) { + colour = 0xff5555; + } + + int levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2 - 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2 + 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2, + top + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2, + top + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2, + top + 4, + colour, + false + ); + + Minecraft.getMinecraft().fontRendererObj.drawString(ench.enchantName, + guiLeft + 248 + 16 + 2 + textOffset, top + 4 + textOffset, 0xffffffdd, true + ); + } + GlScissorStack.pop(scaledResolution); + + //Player Inventory Items + Minecraft.getMinecraft().fontRendererObj.drawString(Minecraft.getMinecraft().thePlayer.inventory + .getDisplayName() + .getUnformattedText(), + guiLeft + 102, guiTop + Y_SIZE - 96 + 2, 0x404040 + ); + int inventoryStartIndex = cc.getLowerChestInventory().getSizeInventory(); + GlStateManager.enableDepth(); + for (int i = 0; i < 36; i++) { + int itemX = guiLeft + 102 + 18 * (i % 9); + int itemY = guiTop + 133 + 18 * (i / 9); + + if (i >= 27) { + itemY += 4; + } + + GlStateManager.pushMatrix(); + GlStateManager.translate(guiLeft + 102 - 8, guiTop + 191 - (inventoryStartIndex / 9 * 18 + 89), 0); + Slot slot = cc.getSlot(inventoryStartIndex + i); + ((AccessorGuiContainer) chest).doDrawSlot(slot); + GlStateManager.popMatrix(); + + if (mouseX >= itemX && mouseX < itemX + 18 && + mouseY >= itemY && mouseY < itemY + 18) { + itemHoverX = itemX; + itemHoverY = itemY; + hoverLocked = SlotLocking.getInstance().isSlotLocked(slot); + + if (slot.getHasStack()) { + tooltipToDisplay = slot.getStack().getTooltip( + Minecraft.getMinecraft().thePlayer, + Minecraft.getMinecraft().gameSettings.advancedItemTooltips + ); + } + } + } + + //Search bar + if (currentState == EnchantState.HAS_ITEM) { + if (searchField.getText().isEmpty() && !searchField.getFocus()) { + searchField.setSize(90, 14); + searchField.setPrependText("\u00a77Search..."); + } else { + if (searchField.getFocus()) { + int len = Minecraft.getMinecraft().fontRendererObj.getStringWidth(searchField.getTextDisplay()) + 10; + searchField.setSize(Math.max(90, len), 14); + } else { + searchField.setSize(90, 14); + } + searchField.setPrependText(""); + } + searchField.render(guiLeft + X_SIZE / 2 - searchField.getWidth() / 2, guiTop + 83); + } else if (currentState == EnchantState.ADDING_ENCHANT && + enchanterCurrentEnch != null && !enchanterEnchLevels.isEmpty()) { + int left = guiLeft + X_SIZE / 2 - 56; + int top = guiTop + 83; + + int uOffset = enchanterCurrentEnch.conflicts ? 112 : 0; + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(left, top, 112, 16, + uOffset / 512f, (112 + uOffset) / 512f, 249 / 512f, (249 + 16) / 512f, GL11.GL_NEAREST + ); + + if (mouseX > left + 16 && mouseX <= left + 96 && + mouseY > top && mouseY <= top + 16) { + disallowClick = true; + if (enchanterCurrentEnch.displayLore != null) { + tooltipToDisplay = enchanterCurrentEnch.displayLore; + } + } + + //Enchant cost + String levelStr = "" + enchanterCurrentEnch.xpCost; + if (enchanterCurrentEnch.xpCost < 0) levelStr = "?"; + + int colour = 0xc8ff8f; + if (enchanterCurrentEnch.xpCost > playerXpLevel) { + colour = 0xff5555; + } + + int levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 8 - levelWidth / 2 - 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 8 - levelWidth / 2 + 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 8 - levelWidth / 2, + top + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 8 - levelWidth / 2, + top + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString(levelStr, left + 8 - levelWidth / 2, top + 4, colour, false); + + //Enchant name + String name = WordUtils.capitalizeFully(enchanterCurrentEnch.enchId.replace("_", " ")); + if (name.equalsIgnoreCase("Bane of Arthropods")) { + name = "Bane of Arth."; + } else if (name.equalsIgnoreCase("Projectile Protection")) { + name = "Projectile Prot"; + } else if (name.equalsIgnoreCase("Blast Protection")) { + name = "Blast Prot"; + } else if (name.equalsIgnoreCase("Luck of the Sea")) { + name = "Luck of Sea"; + } else if (name.equalsIgnoreCase("Turbo Mushrooms")) { + name = "Turbo-Mush"; + } + Utils.drawStringCentered( + name, + Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2, + top + 8, + true, + 0xffffffdd + ); + + if (isChangingEnchLevel) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(left + 96, top, 16, 16, + 96 / 512f, 112 / 512f, 265 / 512f, (265 + 16) / 512f, GL11.GL_NEAREST + ); + } + + //Enchant level + levelStr = "" + enchanterCurrentEnch.level; + if (enchanterCurrentEnch.xpCost < 0) levelStr = "?"; + levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2 - 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2 + 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2, + top + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2, + top + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2, + top + 4, + 0xea82ff, + false + ); + + //Confirm button + + String confirmText = "Apply"; + if (removingEnchantPlayerLevel >= 0) { + if (removingEnchantPlayerLevel == enchanterCurrentEnch.level) { + confirmText = "Remove"; + } else if (enchanterCurrentEnch.level > removingEnchantPlayerLevel) { + confirmText = "Upgrade"; + } else { + confirmText = "Bad Level"; + } + } + if (System.currentTimeMillis() - confirmButtonAnimTime < 500 && !(playerXpLevel < enchanterCurrentEnch.xpCost)) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - 1 - 48, top + 18, 48, 14, + 0, 48 / 512f, 342 / 512f, (342 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered(confirmText, Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 - 1 - 23, top + 18 + 9, false, 0x408040 + ); + } else { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - 1 - 48, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered(confirmText, Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 - 1 - 24, top + 18 + 8, false, 0x408040 + ); + + if (playerXpLevel < enchanterCurrentEnch.xpCost) { + Gui.drawRect(guiLeft + X_SIZE / 2 - 1 - 48, top + 18, guiLeft + X_SIZE / 2 - 1, top + 18 + 14, 0x80000000); + } + } + + //Cancel button + if (System.currentTimeMillis() - cancelButtonAnimTime < 500) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + 1, top + 18, 48, 14, + 0, 48 / 512f, 342 / 512f, (342 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered("Cancel", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 + 1 + 25, top + 18 + 9, false, 0xa04040 + ); + } else { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + 1, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered("Cancel", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 + 1 + 24, top + 18 + 8, false, 0xa04040 + ); + } + + if (mouseY > top + 18 && mouseY <= top + 18 + 16) { + if (mouseX > guiLeft + X_SIZE / 2 - 1 - 48 && mouseX <= guiLeft + X_SIZE / 2 - 1) { + disallowClick = true; + if (enchanterCurrentEnch.displayLore != null) { + tooltipToDisplay = enchanterCurrentEnch.displayLore; + } + } else if (mouseX > guiLeft + X_SIZE / 2 + 1 && mouseX <= guiLeft + X_SIZE / 2 + 1 + 48) { + disallowClick = true; + tooltipToDisplay = Lists.newArrayList("\u00a7cCancel"); + } + } + + //Enchant level switcher + if (isChangingEnchLevel) { + tooltipToDisplay = null; + + List before = new ArrayList<>(); + List after = new ArrayList<>(); + + for (Enchantment ench : enchanterEnchLevels.values()) { + if (ench.level < enchanterCurrentEnch.level) { + before.add(ench); + } else if (ench.level > enchanterCurrentEnch.level) { + after.add(ench); + } + } + + before.sort(Comparator.comparingInt(o -> -o.level)); + after.sort(Comparator.comparingInt(o -> o.level)); + + int bSize = before.size(); + int aSize = after.size(); + GlStateManager.disableDepth(); + for (int i = 0; i < bSize + aSize; i++) { + Enchantment ench; + int yIndex; + if (i < bSize) { + ench = before.get(i); + yIndex = -i - 1; + } else { + ench = after.get(i - bSize); + yIndex = i - bSize + 1; + } + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + + int type = 0; + if (i == bSize) { + type = 2; + } else if (i == 0) { + type = 1; + } + + if (mouseX > left + 96 && mouseX <= left + 96 + 16 && + mouseY > top + 16 * yIndex && mouseY <= top + 16 * yIndex + 16) { + tooltipToDisplay = new ArrayList<>(ench.displayLore); + if (tooltipToDisplay.size() > 2) { + tooltipToDisplay.remove(tooltipToDisplay.size() - 1); + tooltipToDisplay.remove(tooltipToDisplay.size() - 1); + } + itemHoverX = -1; + itemHoverY = -1; + } + + Utils.drawTexturedRect(left + 96, top + 16 * yIndex, 16, 16, + 16 * type / 512f, (16 + 16 * type) / 512f, 356 / 512f, (356 + 16) / 512f, GL11.GL_NEAREST + ); + + levelStr = "" + ench.level; + levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2 - 1, + top + 16 * yIndex + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2 + 1, + top + 16 * yIndex + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2, + top + 16 * yIndex + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2, + top + 16 * yIndex + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2, + top + 16 * yIndex + 4, + 0xea82ff, + false + ); + } + GlStateManager.enableDepth(); + } + + if (mouseX > left + 96 && mouseX <= left + 96 + 16 && + mouseY > top && mouseY <= top + 16) { + if (isChangingEnchLevel) { + tooltipToDisplay = Lists.newArrayList("\u00a7cCancel level change"); + } else { + tooltipToDisplay = Lists.newArrayList("\u00a7aChange enchant level"); + } + } + } + + if (currentState == EnchantState.HAS_ITEM) { + renderCancel(); + } + + //Item enchant input + ItemStack itemEnchantInput; + if (currentState == EnchantState.HAS_ITEM_IN_HEX) { + itemEnchantInput = cc.getSlot(22).getStack(); + } else { + itemEnchantInput = cc.getSlot(19).getStack(); + } + if (itemEnchantInput != null && itemEnchantInput.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane)) { + itemEnchantInput = enchantingItem; + } + { + int itemX = guiLeft + 174; + int itemY = guiTop + 58; + + if (itemEnchantInput == null) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(itemX, itemY, 16, 16, + 0, 16 / 512f, 281 / 512f, (281 + 16) / 512f, GL11.GL_NEAREST + ); + } else { + Utils.drawItemStack(itemEnchantInput, itemX, itemY); + } + + if (mouseX >= itemX && mouseX < itemX + 18 && + mouseY >= itemY && mouseY < itemY + 18) { + itemHoverX = itemX; + itemHoverY = itemY; + + if (itemEnchantInput != null) { + tooltipToDisplay = itemEnchantInput.getTooltip( + Minecraft.getMinecraft().thePlayer, + Minecraft.getMinecraft().gameSettings.advancedItemTooltips + ); + } + } + } + + if (!isChangingEnchLevel && itemHoverX >= 0 && itemHoverY >= 0) { + GlStateManager.disableDepth(); + GlStateManager.colorMask(true, true, true, false); + Gui.drawRect(itemHoverX, itemHoverY, itemHoverX + 16, itemHoverY + 16, + hoverLocked ? 0x80ff8080 : 0x80ffffff + ); + GlStateManager.colorMask(true, true, true, true); + GlStateManager.enableDepth(); + } + + GlStateManager.translate(0, 0, 300); + + renderOrbAnim(partialTicks); + + renderMouseStack(stackOnMouse, disallowClick, mouseX, mouseY, + width, height, tooltipToDisplay + ); + GlStateManager.translate(0, 0, -300); + } + + private void renderBooks(float partialTicks) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return; + + int playerXpLevel = Minecraft.getMinecraft().thePlayer.experienceLevel; + + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + ContainerChest cc = (ContainerChest) chest.inventorySlots; + + leftScroll.tick(); + rightScroll.tick(); + arrowAmount.tick(); + + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + int width = scaledResolution.getScaledWidth(); + int height = scaledResolution.getScaledHeight(); + int mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth; + int mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1; + + guiLeft = (width - X_SIZE) / 2; + guiTop = (height - Y_SIZE) / 2; + + List tooltipToDisplay = null; + boolean disallowClick = false; + ItemStack stackOnMouse = Minecraft.getMinecraft().thePlayer.inventory.getItemStack(); + int itemHoverX = -1; + int itemHoverY = -1; + boolean hoverLocked = false; + + drawGradientRect(0, 0, width, height, 0xc0101010, 0xd0101010); + + renderBaseTexture(); + + Minecraft.getMinecraft().fontRendererObj.drawString("Applicable", guiLeft + 7, guiTop + 7, 0x404040, false); + Minecraft.getMinecraft().fontRendererObj.drawString("Applied", guiLeft + 247, guiTop + 7, 0x404040, false); + + //Page Text + /*if (currentState == EnchantState.HAS_ITEM || currentState == EnchantState.ADDING_ENCHANT) { + String pageStr = "Page: " + currentPage + "/" + expectedMaxPage; + int pageStrLen = Minecraft.getMinecraft().fontRendererObj.getStringWidth(pageStr); + Utils.drawStringCentered(pageStr, Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2, guiTop + 14, false, 0x404040 + ); + + //Page Arrows + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - pageStrLen / 2 - 2 - 15, guiTop + 6, 15, 15, + 0, 15 / 512f, 372 / 512f, 387 / 512f, GL11.GL_NEAREST + ); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + pageStrLen / 2 + 2, guiTop + 6, 15, 15, + 15 / 512f, 30 / 512f, 372 / 512f, 387 / 512f, GL11.GL_NEAREST + ); + }*/ + + tooltipToDisplay = renderSettings(mouseX, mouseY, tooltipToDisplay); + + renderScrollBars(applicableItem, applicableItem, mouseY); + + //Enchant book model + renderEnchantBook(scaledResolution, partialTicks); + + //Can't be enchanted text + /*if (currentState == EnchantState.INVALID_ITEM) { + GlStateManager.disableDepth(); + Utils.drawStringCentered("This item can't", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2, guiTop + 88, true, 0xffff5555 + ); + Utils.drawStringCentered("be enchanted", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2, guiTop + 98, true, 0xffff5555 + ); + GlStateManager.enableDepth(); + }*/ + + renderArrow(); + + //Text if no enchants appear + if (currentState == EnchantState.HAS_ITEM || currentState == EnchantState.ADDING_ENCHANT || + currentState == EnchantState.HAS_ITEM_IN_BOOKS || currentState == EnchantState.ADDING_BOOK) { + if (applicableItem.isEmpty() && removableItem.isEmpty() && searchRemovedFromApplicable) { + Utils.drawStringCentered("Can't find that", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 28, true, 0xffff5555 + ); + Utils.drawStringCentered("enchant, perhaps", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 38, true, 0xffff5555 + ); + Utils.drawStringCentered("it is on", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 48, true, 0xffff5555 + ); + Utils.drawStringCentered("another page?", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 58, true, 0xffff5555 + ); + } else if (applicableItem.isEmpty() && !searchRemovedFromApplicable) { + Utils.drawStringCentered("No applicable", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 28, true, 0xffff5555 + ); + Utils.drawStringCentered("enchants on", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 38, true, 0xffff5555 + ); + Utils.drawStringCentered("this page...", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 8 + 48, guiTop + 48, true, 0xffff5555 + ); + } + if (applicableItem.isEmpty() && removableItem.isEmpty() && searchRemovedFromRemovable) { + Utils.drawStringCentered("Can't find that", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 28, true, 0xffff5555 + ); + Utils.drawStringCentered("enchant, perhaps", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 38, true, 0xffff5555 + ); + Utils.drawStringCentered("it is on", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 48, true, 0xffff5555 + ); + Utils.drawStringCentered("another page?", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 58, true, 0xffff5555 + ); + } else if (removableItem.isEmpty() && !searchRemovedFromRemovable) { + Utils.drawStringCentered("No removable", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 28, true, 0xffff5555 + ); + Utils.drawStringCentered("enchants on", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 38, true, 0xffff5555 + ); + Utils.drawStringCentered("this page...", Minecraft.getMinecraft().fontRendererObj, + guiLeft + 248 + 48, guiTop + 48, true, 0xffff5555 + ); + } + } + //Available enchants (left) + GlScissorStack.push(0, guiTop + 18, width, guiTop + 18 + 96, scaledResolution); + for (int i = 0; i < 7; i++) { + int index = i + leftScroll.getValue() / 16; + + if (applicableItem.size() <= index) break; + HexItem item = applicableItem.get(index); + + int top = guiTop - (leftScroll.getValue() % 16) + 18 + 16 * i; + int vOffset = enchanterCurrentItem != null && enchanterCurrentItem.itemId.equals(item.itemId) ? 16 : 0; + int uOffset = item.conflicts ? 112 : 0; + int textOffset = vOffset / 16; + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + 8, top, 96, 16, + uOffset / 512f, (96 + uOffset) / 512f, (249 + vOffset) / 512f, (249 + 16 + vOffset) / 512f, GL11.GL_NEAREST + ); + + if (mouseX > guiLeft + 8 && mouseX <= guiLeft + 8 + 96 && + mouseY > top && mouseY <= top + 16) { + disallowClick = true; + if (item.displayLore != null) { + tooltipToDisplay = item.displayLore; + } + } + + String levelStr = getIconStr(item); + int colour = 0xc8ff8f; + if (item.price > playerXpLevel) { + colour = 0xff5555; + } + + int levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2 - 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2 + 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2, + top + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2, + top + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2, + top + 4, + colour, + false + ); + + Minecraft.getMinecraft().fontRendererObj.drawString( + item.itemName, + guiLeft + 8 + 16 + 2 + textOffset, + top + 4 + textOffset, + 0xffffffdd, + true + ); + } + GlScissorStack.pop(scaledResolution); + + //Removable enchants (right) + GlScissorStack.push(0, guiTop + 18, width, guiTop + 18 + 96, scaledResolution); + for (int i = 0; i < 7; i++) { + int index = i + rightScroll.getValue() / 16; + + if (removableItem.size() <= index) break; + HexItem item = removableItem.get(index); + + int top = guiTop - (rightScroll.getValue() % 16) + 18 + 16 * i; + int vOffset = enchanterCurrentItem != null && enchanterCurrentItem.itemId.equals(item.itemId) ? 16 : 0; + int textOffset = vOffset / 16; + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + 248, top, 96, 16, + 0, 96 / 512f, (249 + vOffset) / 512f, (249 + 16 + vOffset) / 512f, GL11.GL_NEAREST + ); + + if (mouseX > guiLeft + 248 && mouseX <= guiLeft + 248 + 96 && + mouseY > top && mouseY <= top + 16) { + disallowClick = true; + if (item.displayLore != null) { + tooltipToDisplay = item.displayLore; + } + } + + String levelStr = getIconStr(item); + int colour = 0xc8ff8f; + /*if (item.price > playerXpLevel) { + colour = 0xff5555; + }*/ + + int levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2 - 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2 + 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2, + top + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2, + top + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2, + top + 4, + colour, + false + ); + + Minecraft.getMinecraft().fontRendererObj.drawString(item.itemName, + guiLeft + 248 + 16 + 2 + textOffset, top + 4 + textOffset, 0xffffffdd, true + ); + } + GlScissorStack.pop(scaledResolution); + + //Player Inventory Items + Minecraft.getMinecraft().fontRendererObj.drawString(Minecraft.getMinecraft().thePlayer.inventory + .getDisplayName() + .getUnformattedText(), + guiLeft + 102, guiTop + Y_SIZE - 96 + 2, 0x404040 + ); + int inventoryStartIndex = cc.getLowerChestInventory().getSizeInventory(); + GlStateManager.enableDepth(); + for (int i = 0; i < 36; i++) { + int itemX = guiLeft + 102 + 18 * (i % 9); + int itemY = guiTop + 133 + 18 * (i / 9); + + if (i >= 27) { + itemY += 4; + } + + GlStateManager.pushMatrix(); + GlStateManager.translate(guiLeft + 102 - 8, guiTop + 191 - (inventoryStartIndex / 9 * 18 + 89), 0); + Slot slot = cc.getSlot(inventoryStartIndex + i); + ((AccessorGuiContainer) chest).doDrawSlot(slot); + GlStateManager.popMatrix(); + + if (mouseX >= itemX && mouseX < itemX + 18 && + mouseY >= itemY && mouseY < itemY + 18) { + itemHoverX = itemX; + itemHoverY = itemY; + hoverLocked = SlotLocking.getInstance().isSlotLocked(slot); + + if (slot.getHasStack()) { + tooltipToDisplay = slot.getStack().getTooltip( + Minecraft.getMinecraft().thePlayer, + Minecraft.getMinecraft().gameSettings.advancedItemTooltips + ); + } + } + } + + //Search bar + if (currentState == EnchantState.HAS_ITEM) { + if (searchField.getText().isEmpty() && !searchField.getFocus()) { + searchField.setSize(90, 14); + searchField.setPrependText("\u00a77Search..."); + } else { + if (searchField.getFocus()) { + int len = Minecraft.getMinecraft().fontRendererObj.getStringWidth(searchField.getTextDisplay()) + 10; + searchField.setSize(Math.max(90, len), 14); + } else { + searchField.setSize(90, 14); + } + searchField.setPrependText(""); + } + searchField.render(guiLeft + X_SIZE / 2 - searchField.getWidth() / 2, guiTop + 83); + } else if (currentState == EnchantState.ADDING_BOOK && + enchanterCurrentItem != null /*&& !enchanterItemLevels.isEmpty()*/) { + int left = guiLeft + X_SIZE / 2 - 56; + int top = guiTop + 83; + + int uOffset = enchanterCurrentItem.conflicts ? 112 : 0; + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(left, top, 112, 16, + uOffset / 512f, (112 + uOffset) / 512f, 249 / 512f, (249 + 16) / 512f, GL11.GL_NEAREST + ); + + if (mouseX > left + 16 && mouseX <= left + 96 && + mouseY > top && mouseY <= top + 16) { + disallowClick = true; + if (enchanterCurrentItem.displayLore != null) { + tooltipToDisplay = enchanterCurrentItem.displayLore; + } + } + + String priceStr = "" + numberFormat.format(enchanterCurrentItem.getPrice()) + " Coins"; + if (enchanterCurrentItem.price < 0) priceStr = ""; + int priceWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(priceStr); + int priceTop = guiTop + 10; + int x = 180; + int color = 0x2d2102; + Minecraft.getMinecraft().fontRendererObj.drawString( + priceStr, + guiLeft + x - priceWidth / 2 - 1, + priceTop + 4, + color, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + priceStr, + guiLeft + x - priceWidth / 2 + 1, + priceTop + 4, + color, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + priceStr, + guiLeft + x - priceWidth / 2, + priceTop + 4 - 1, + color, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + priceStr, + guiLeft + x - priceWidth / 2, + priceTop + 4 + 1, + color, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + priceStr, + guiLeft + x - priceWidth / 2, + priceTop + 4, + 0xfcba03, + false + ); + + //Enchant name + String name = WordUtils.capitalizeFully(enchanterCurrentItem.itemId.replace("_", " ")); + if (name.equalsIgnoreCase("Hot Potato Book")) { + name = "Hot Potato"; + } else if (name.equalsIgnoreCase("Fuming Potato Book")) { + name = "Fuming Potato"; + } else if (name.equalsIgnoreCase("Recombobulator 3000")) { + name = "Recombobulator"; + } else if (name.contains("Power Scroll")) { + name = name.replace("Power ", ""); + } else if (name.contains("\u272a")) { + name = name.replaceAll("[^✪]*", ""); + } else if (name.equalsIgnoreCase("First Master Star")) { + name = "Master Star \u00a7c➊"; + } else if (name.equalsIgnoreCase("Second Master Star")) { + name = "Master Star \u00a7c➋"; + } else if (name.equalsIgnoreCase("Third Master Star")) { + name = "Master Star \u00a7c➌"; + } else if (name.equalsIgnoreCase("Fourth Master Star")) { + name = "Master Star \u00a7c➍"; + } else if (name.equalsIgnoreCase("Fifth Master Star")) { + name = "Master Star \u00a7c➎"; + } else if (name.equalsIgnoreCase("The Art Of Peace")) { + name = "Art Of Peace"; + } else if (name.equalsIgnoreCase("Mana Disintegrator")) { + name = "M Disintegrator"; + } + Utils.drawStringCentered( + name, + Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2, + top + 8, + true, + 0xffffffdd + ); + + //Confirm button + String confirmText = "Apply"; + if (removingEnchantPlayerLevel >= 0) { + if (removingEnchantPlayerLevel == enchanterCurrentItem.level) { + confirmText = "Remove"; + } else if (enchanterCurrentItem.level > removingEnchantPlayerLevel) { + confirmText = "Upgrade"; + } else { + confirmText = "Bad Level"; + } + } + if (System.currentTimeMillis() - confirmButtonAnimTime < 500 && !(playerXpLevel < enchanterCurrentItem.price)) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - 1 - 48, top + 18, 48, 14, + 0, 48 / 512f, 342 / 512f, (342 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered(confirmText, Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 - 1 - 23, top + 18 + 9, false, 0x408040 + ); + } else { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - 1 - 48, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered(confirmText, Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 - 1 - 24, top + 18 + 8, false, 0x408040 + ); + + /*if (playerXpLevel < enchanterCurrentItem.price) { + Gui.drawRect(guiLeft + X_SIZE / 2 - 1 - 48, top + 18, guiLeft + X_SIZE / 2 - 1, top + 18 + 14, 0x80000000); + }*/ + } + + //Cancel button + if (System.currentTimeMillis() - cancelButtonAnimTime < 500) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + 1, top + 18, 48, 14, + 0, 48 / 512f, 342 / 512f, (342 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered("Cancel", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 + 1 + 25, top + 18 + 9, false, 0xa04040 + ); + } else { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + 1, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered("Cancel", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 + 1 + 24, top + 18 + 8, false, 0xa04040 + ); + } + + if (mouseY > top + 18 && mouseY <= top + 18 + 16) { + if (mouseX > guiLeft + X_SIZE / 2 - 1 - 48 && mouseX <= guiLeft + X_SIZE / 2 - 1) { + disallowClick = true; + if (enchanterCurrentItem.displayLore != null) { + tooltipToDisplay = enchanterCurrentItem.displayLore; + } + } else if (mouseX > guiLeft + X_SIZE / 2 + 1 && mouseX <= guiLeft + X_SIZE / 2 + 1 + 48) { + disallowClick = true; + tooltipToDisplay = Lists.newArrayList("\u00a7cCancel"); + } + } + } + + if (currentState == EnchantState.HAS_ITEM_IN_BOOKS || currentState == EnchantState.ADDING_BOOK) { + renderCancel(); + } + + //Item enchant input + ItemStack itemEnchantInput; + if (currentState == EnchantState.HAS_ITEM_IN_HEX) { + itemEnchantInput = cc.getSlot(22).getStack(); + } else { + itemEnchantInput = cc.getSlot(19).getStack(); + } + if (itemEnchantInput != null && itemEnchantInput.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane)) { + itemEnchantInput = enchantingItem; + } + { + int itemX = guiLeft + 174; + int itemY = guiTop + 58; + + if (itemEnchantInput == null) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(itemX, itemY, 16, 16, + 0, 16 / 512f, 281 / 512f, (281 + 16) / 512f, GL11.GL_NEAREST + ); + } else { + Utils.drawItemStack(itemEnchantInput, itemX, itemY); + } + + if (mouseX >= itemX && mouseX < itemX + 18 && + mouseY >= itemY && mouseY < itemY + 18) { + itemHoverX = itemX; + itemHoverY = itemY; + + if (itemEnchantInput != null) { + tooltipToDisplay = itemEnchantInput.getTooltip( + Minecraft.getMinecraft().thePlayer, + Minecraft.getMinecraft().gameSettings.advancedItemTooltips + ); + } + } + } + + if (!isChangingEnchLevel && itemHoverX >= 0 && itemHoverY >= 0) { + GlStateManager.disableDepth(); + GlStateManager.colorMask(true, true, true, false); + Gui.drawRect(itemHoverX, itemHoverY, itemHoverX + 16, itemHoverY + 16, + hoverLocked ? 0x80ff8080 : 0x80ffffff + ); + GlStateManager.colorMask(true, true, true, true); + GlStateManager.enableDepth(); + } + + GlStateManager.translate(0, 0, 300); + + renderOrbAnim(partialTicks); + + renderMouseStack(stackOnMouse, disallowClick, mouseX, mouseY, + width, height, tooltipToDisplay + ); + GlStateManager.translate(0, 0, -300); + } + + private void renderHex(float partialTicks) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return; + + int playerXpLevel = Minecraft.getMinecraft().thePlayer.experienceLevel; + + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + ContainerChest cc = (ContainerChest) chest.inventorySlots; + + leftScroll.tick(); + //rightScroll.tick(); + //arrowAmount.tick(); + + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + int width = scaledResolution.getScaledWidth(); + int height = scaledResolution.getScaledHeight(); + int mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth; + int mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1; + + guiLeft = (width - X_SIZE) / 2; + guiTop = (height - Y_SIZE) / 2; + + List tooltipToDisplay = null; + boolean disallowClick = false; + ItemStack stackOnMouse = Minecraft.getMinecraft().thePlayer.inventory.getItemStack(); + int itemHoverX = -1; + int itemHoverY = -1; + boolean hoverLocked = false; + + drawGradientRect(0, 0, width, height, 0xc0101010, 0xd0101010); + + renderBaseTexture(); + + Minecraft.getMinecraft().fontRendererObj.drawString("The Hex", guiLeft + 7, guiTop + 7, 0x404040, false); + //Minecraft.getMinecraft().fontRendererObj.drawString("Applied", guiLeft + 247, guiTop + 7, 0x404040, false); + + tooltipToDisplay = renderSettings(mouseX, mouseY, tooltipToDisplay); + + renderScrollBars(applicableItem, applicableItem, mouseY); + + //Enchant book model + renderEnchantBook(scaledResolution, partialTicks); + + //Can't be enchanted text + if (currentState == EnchantState.INVALID_ITEM_HEX) { + GlStateManager.disableDepth(); + Utils.drawStringCentered("This item can't", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2, guiTop + 88, true, 0xffff5555 + ); + Utils.drawStringCentered("be enchanted", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2, guiTop + 98, true, 0xffff5555 + ); + GlStateManager.enableDepth(); + } + + renderArrow(); + + //Available enchants (left) + GlScissorStack.push(0, guiTop + 18, width, guiTop + 18 + 96, scaledResolution); + for (int i = 0; i < 7; i++) { + int index = i + leftScroll.getValue() / 16; + + if (applicableItem.size() <= index) break; + HexItem item = applicableItem.get(index); + + int top = guiTop - (leftScroll.getValue() % 16) + 18 + 16 * i; + int vOffset = enchanterCurrentItem != null && enchanterCurrentItem.itemId.equals(item.itemId) ? 16 : 0; + int uOffset = item.conflicts ? 112 : 0; + int textOffset = vOffset / 16; + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + 8, top, 96, 16, + uOffset / 512f, (96 + uOffset) / 512f, (249 + vOffset) / 512f, (249 + 16 + vOffset) / 512f, GL11.GL_NEAREST + ); + + if (mouseX > guiLeft + 8 && mouseX <= guiLeft + 8 + 96 && + mouseY > top && mouseY <= top + 16) { + disallowClick = true; + if (item.displayLore != null) { + tooltipToDisplay = item.displayLore; + } + } + + String levelStr = getIconStr(item); + int colour = 0xc8ff8f; + if (item.price > playerXpLevel) { + colour = 0xff5555; + } + + int levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2 - 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2 + 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2, + top + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2, + top + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2, + top + 4, + colour, + false + ); + + Minecraft.getMinecraft().fontRendererObj.drawString( + item.itemName, + guiLeft + 8 + 16 + 2 + textOffset, + top + 4 + textOffset, + 0xffffffdd, + true + ); + } + GlScissorStack.pop(scaledResolution); + + //Removable enchants (right) + GlScissorStack.push(0, guiTop + 18, width, guiTop + 18 + 96, scaledResolution); + for (int i = 0; i < 7; i++) { + int index = i + rightScroll.getValue() / 16; + + if (removableItem.size() <= index) break; + HexItem item = removableItem.get(index); + + int top = guiTop - (rightScroll.getValue() % 16) + 18 + 16 * i; + int vOffset = enchanterCurrentItem != null && enchanterCurrentItem.itemId.equals(item.itemId) ? 16 : 0; + int textOffset = vOffset / 16; + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + 248, top, 96, 16, + 0, 96 / 512f, (249 + vOffset) / 512f, (249 + 16 + vOffset) / 512f, GL11.GL_NEAREST + ); + + if (mouseX > guiLeft + 248 && mouseX <= guiLeft + 248 + 96 && + mouseY > top && mouseY <= top + 16) { + disallowClick = true; + if (item.displayLore != null) { + tooltipToDisplay = item.displayLore; + } + } + + String levelStr = getIconStr(item); + int colour = 0xc8ff8f; + if (item.price > playerXpLevel) { + colour = 0xff5555; + } + + int levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2 - 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2 + 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2, + top + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2, + top + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2, + top + 4, + colour, + false + ); + + Minecraft.getMinecraft().fontRendererObj.drawString(item.itemName, + guiLeft + 248 + 16 + 2 + textOffset, top + 4 + textOffset, 0xffffffdd, true + ); + } + GlScissorStack.pop(scaledResolution); + + //Player Inventory Items + Minecraft.getMinecraft().fontRendererObj.drawString(Minecraft.getMinecraft().thePlayer.inventory + .getDisplayName() + .getUnformattedText(), + guiLeft + 102, guiTop + Y_SIZE - 96 + 2, 0x404040 + ); + int inventoryStartIndex = cc.getLowerChestInventory().getSizeInventory(); + GlStateManager.enableDepth(); + for (int i = 0; i < 36; i++) { + int itemX = guiLeft + 102 + 18 * (i % 9); + int itemY = guiTop + 133 + 18 * (i / 9); + + if (i >= 27) { + itemY += 4; + } + + GlStateManager.pushMatrix(); + GlStateManager.translate(guiLeft + 102 - 8, guiTop + 191 - (inventoryStartIndex / 9 * 18 + 89), 0); + Slot slot = cc.getSlot(inventoryStartIndex + i); + ((AccessorGuiContainer) chest).doDrawSlot(slot); + GlStateManager.popMatrix(); + + if (mouseX >= itemX && mouseX < itemX + 18 && + mouseY >= itemY && mouseY < itemY + 18) { + itemHoverX = itemX; + itemHoverY = itemY; + hoverLocked = SlotLocking.getInstance().isSlotLocked(slot); + + if (slot.getHasStack()) { + tooltipToDisplay = slot.getStack().getTooltip( + Minecraft.getMinecraft().thePlayer, + Minecraft.getMinecraft().gameSettings.advancedItemTooltips + ); + } + } + } + + if (currentState == EnchantState.ADDING_BOOK && + enchanterCurrentItem != null /*&& !enchanterItemLevels.isEmpty()*/) { + int left = guiLeft + X_SIZE / 2 - 56; + int top = guiTop + 83; + + int uOffset = enchanterCurrentItem.conflicts ? 112 : 0; + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(left, top, 112, 16, + uOffset / 512f, (112 + uOffset) / 512f, 249 / 512f, (249 + 16) / 512f, GL11.GL_NEAREST + ); + + if (mouseX > left + 16 && mouseX <= left + 96 && + mouseY > top && mouseY <= top + 16) { + disallowClick = true; + if (enchanterCurrentItem.displayLore != null) { + tooltipToDisplay = enchanterCurrentItem.displayLore; + } + } + + if (mouseY > top + 18 && mouseY <= top + 18 + 16) { + if (mouseX > guiLeft + X_SIZE / 2 - 1 - 48 && mouseX <= guiLeft + X_SIZE / 2 - 1) { + disallowClick = true; + if (enchanterCurrentItem.displayLore != null) { + tooltipToDisplay = enchanterCurrentItem.displayLore; + } + } else if (mouseX > guiLeft + X_SIZE / 2 + 1 && mouseX <= guiLeft + X_SIZE / 2 + 1 + 48) { + disallowClick = true; + tooltipToDisplay = Lists.newArrayList("\u00a7cCancel"); + } + } + } + + if (currentState == EnchantState.HAS_ITEM_IN_BOOKS || currentState == EnchantState.ADDING_BOOK) { + renderCancel(); + } + + //Item enchant input + ItemStack itemEnchantInput; + if (isInHex()) { + itemEnchantInput = cc.getSlot(22).getStack(); + } else { + itemEnchantInput = cc.getSlot(19).getStack(); + } + if (itemEnchantInput != null && itemEnchantInput.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane)) { + itemEnchantInput = enchantingItem; + } + { + int itemX = guiLeft + 174; + int itemY = guiTop + 58; + + if (itemEnchantInput == null) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(itemX, itemY, 16, 16, + 0, 16 / 512f, 281 / 512f, (281 + 16) / 512f, GL11.GL_NEAREST + ); + } else { + Utils.drawItemStack(itemEnchantInput, itemX, itemY); + } + + if (mouseX >= itemX && mouseX < itemX + 18 && + mouseY >= itemY && mouseY < itemY + 18) { + itemHoverX = itemX; + itemHoverY = itemY; + + if (itemEnchantInput != null) { + tooltipToDisplay = itemEnchantInput.getTooltip( + Minecraft.getMinecraft().thePlayer, + Minecraft.getMinecraft().gameSettings.advancedItemTooltips + ); + } + } + } + + if (!isChangingEnchLevel && itemHoverX >= 0 && itemHoverY >= 0) { + GlStateManager.disableDepth(); + GlStateManager.colorMask(true, true, true, false); + Gui.drawRect(itemHoverX, itemHoverY, itemHoverX + 16, itemHoverY + 16, + hoverLocked ? 0x80ff8080 : 0x80ffffff + ); + GlStateManager.colorMask(true, true, true, true); + GlStateManager.enableDepth(); + } + + GlStateManager.translate(0, 0, 300); + + renderOrbAnim(partialTicks); + + renderMouseStack(stackOnMouse, disallowClick, mouseX, mouseY, + width, height, tooltipToDisplay + ); + GlStateManager.translate(0, 0, -300); + } + + private void renderGemstones(float partialTicks) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return; + + int playerXpLevel = Minecraft.getMinecraft().thePlayer.experienceLevel; + + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + ContainerChest cc = (ContainerChest) chest.inventorySlots; + + leftScroll.tick(); + rightScroll.tick(); + arrowAmount.tick(); + + ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + int width = scaledResolution.getScaledWidth(); + int height = scaledResolution.getScaledHeight(); + int mouseX = Mouse.getX() * width / Minecraft.getMinecraft().displayWidth; + int mouseY = height - Mouse.getY() * height / Minecraft.getMinecraft().displayHeight - 1; + + guiLeft = (width - X_SIZE) / 2; + guiTop = (height - Y_SIZE) / 2; + + List tooltipToDisplay = null; + boolean disallowClick = false; + ItemStack stackOnMouse = Minecraft.getMinecraft().thePlayer.inventory.getItemStack(); + int itemHoverX = -1; + int itemHoverY = -1; + boolean hoverLocked = false; + + drawGradientRect(0, 0, width, height, 0xc0101010, 0xd0101010); + + renderBaseTexture(); + + Minecraft.getMinecraft().fontRendererObj.drawString("Applicable", guiLeft + 7, guiTop + 7, 0x404040, false); + Minecraft.getMinecraft().fontRendererObj.drawString("Applied", guiLeft + 247, guiTop + 7, 0x404040, false); + + //Page Text + if (currentState == EnchantState.ADDING_GEMSTONE || currentState == EnchantState.APPLYING_GEMSTONE) { + String pageStr = "Page: " + currentPage + "/" + expectedMaxPage; + int pageStrLen = Minecraft.getMinecraft().fontRendererObj.getStringWidth(pageStr); + Utils.drawStringCentered(pageStr, Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2, guiTop + 14, false, 0x404040 + ); + + //Page Arrows + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - pageStrLen / 2 - 2 - 15, guiTop + 6, 15, 15, + 0, 15 / 512f, 372 / 512f, 387 / 512f, GL11.GL_NEAREST + ); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + pageStrLen / 2 + 2, guiTop + 6, 15, 15, + 15 / 512f, 30 / 512f, 372 / 512f, 387 / 512f, GL11.GL_NEAREST + ); + } + + //Confirm button + { + int top = guiTop + 83; + if (currentState == EnchantState.APPLYING_GEMSTONE) { + String confirmText = "Apply"; + if (removingEnchantPlayerLevel >= 0) { + if (removingEnchantPlayerLevel == enchanterCurrentItem.level) { + confirmText = "Remove"; + } else if (enchanterCurrentItem.level > removingEnchantPlayerLevel) { + confirmText = "Upgrade"; + } else { + confirmText = "Bad Level"; + } + } + if (System.currentTimeMillis() - confirmButtonAnimTime < 500) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - 1 - 48, top + 18, 48, 14, + 0, 48 / 512f, 342 / 512f, (342 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered(confirmText, Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 - 1 - 23, top + 18 + 9, false, 0x408040 + ); + } else { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - 1 - 48, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered(confirmText, Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 - 1 - 24, top + 18 + 8, false, 0x408040 + ); + } + } + + //Cancel button + + if (System.currentTimeMillis() - cancelButtonAnimTime < 500) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + 1, top + 18, 48, 14, + 0, 48 / 512f, 342 / 512f, (342 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered("Cancel", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 + 1 + 25, top + 18 + 9, false, 0xa04040 + ); + } else { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + 1, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered("Cancel", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 + 1 + 24, top + 18 + 8, false, 0xa04040 + ); + } + } + + tooltipToDisplay = renderSettings(mouseX, mouseY, tooltipToDisplay); + + renderScrollBars(applicableItem, applicableItem, mouseY); + + //Enchant book model + renderEnchantBook(scaledResolution, partialTicks); + + renderArrow(); + + //Available enchants (left) + GlScissorStack.push(0, guiTop + 18, width, guiTop + 18 + 96, scaledResolution); + for (int i = 0; i < 7; i++) { + int index = i + leftScroll.getValue() / 16; + + if (applicableItem.size() <= index) break; + HexItem item = applicableItem.get(index); + + int top = guiTop - (leftScroll.getValue() % 16) + 18 + 16 * i; + int vOffset = enchanterCurrentItem != null && enchanterCurrentItem.itemId.equals(item.itemId) ? 16 : 0; + int uOffset = item.conflicts ? 112 : 0; + int textOffset = vOffset / 16; + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + 8, top, 96, 16, + uOffset / 512f, (96 + uOffset) / 512f, (249 + vOffset) / 512f, (249 + 16 + vOffset) / 512f, GL11.GL_NEAREST + ); + + if (mouseX > guiLeft + 8 && mouseX <= guiLeft + 8 + 96 && + mouseY > top && mouseY <= top + 16) { + disallowClick = true; + if (item.displayLore != null) { + tooltipToDisplay = item.displayLore; + } + } + + String levelStr = getIconStr(item); + int colour = 0xc8ff8f; + if (item.price > playerXpLevel) { + colour = 0xff5555; + } + + int levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2 - 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2 + 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2, + top + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2, + top + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 16 - levelWidth / 2, + top + 4, + colour, + false + ); + + Minecraft.getMinecraft().fontRendererObj.drawString( + item.itemName, + guiLeft + 8 + 16 + 2 + textOffset, + top + 4 + textOffset, + 0xffffffdd, + true + ); + } + GlScissorStack.pop(scaledResolution); + + //Removable enchants (right) + GlScissorStack.push(0, guiTop + 18, width, guiTop + 18 + 96, scaledResolution); + for (int i = 0; i < 7; i++) { + int index = i + rightScroll.getValue() / 16; + + if (removableItem.size() <= index) break; + HexItem item = removableItem.get(index); + + int top = guiTop - (rightScroll.getValue() % 16) + 18 + 16 * i; + int vOffset = enchanterCurrentItem != null && enchanterCurrentItem.itemId.equals(item.itemId) ? 16 : 0; + int textOffset = vOffset / 16; + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + 248, top, 96, 16, + 0, 96 / 512f, (249 + vOffset) / 512f, (249 + 16 + vOffset) / 512f, GL11.GL_NEAREST + ); + + if (mouseX > guiLeft + 248 && mouseX <= guiLeft + 248 + 96 && + mouseY > top && mouseY <= top + 16) { + disallowClick = true; + if (item.displayLore != null) { + tooltipToDisplay = item.displayLore; + } + } + + String levelStr = getIconStr(item); + int colour = 0xc8ff8f; + if (item.price > playerXpLevel) { + colour = 0xff5555; + } + + int levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2 - 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2 + 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2, + top + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2, + top + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + guiLeft + 256 - levelWidth / 2, + top + 4, + colour, + false + ); + + Minecraft.getMinecraft().fontRendererObj.drawString(item.itemName, + guiLeft + 248 + 16 + 2 + textOffset, top + 4 + textOffset, 0xffffffdd, true + ); + } + GlScissorStack.pop(scaledResolution); + + //Player Inventory Items + Minecraft.getMinecraft().fontRendererObj.drawString(Minecraft.getMinecraft().thePlayer.inventory + .getDisplayName() + .getUnformattedText(), + guiLeft + 102, guiTop + Y_SIZE - 96 + 2, 0x404040 + ); + int inventoryStartIndex = cc.getLowerChestInventory().getSizeInventory(); + GlStateManager.enableDepth(); + for (int i = 0; i < 36; i++) { + int itemX = guiLeft + 102 + 18 * (i % 9); + int itemY = guiTop + 133 + 18 * (i / 9); + + if (i >= 27) { + itemY += 4; + } + + GlStateManager.pushMatrix(); + GlStateManager.translate(guiLeft + 102 - 8, guiTop + 191 - (inventoryStartIndex / 9 * 18 + 89), 0); + Slot slot = cc.getSlot(inventoryStartIndex + i); + ((AccessorGuiContainer) chest).doDrawSlot(slot); + GlStateManager.popMatrix(); + + if (mouseX >= itemX && mouseX < itemX + 18 && + mouseY >= itemY && mouseY < itemY + 18) { + itemHoverX = itemX; + itemHoverY = itemY; + hoverLocked = SlotLocking.getInstance().isSlotLocked(slot); + + if (slot.getHasStack()) { + tooltipToDisplay = slot.getStack().getTooltip( + Minecraft.getMinecraft().thePlayer, + Minecraft.getMinecraft().gameSettings.advancedItemTooltips + ); + } + } + } + + if (currentState == EnchantState.APPLYING_GEMSTONE && + enchanterCurrentItem != null /*&& !enchanterItemLevels.isEmpty()*/) { + int left = guiLeft + X_SIZE / 2 - 56; + int top = guiTop + 83; + + int uOffset = enchanterCurrentItem.conflicts ? 112 : 0; + + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(left, top, 112, 16, + uOffset / 512f, (112 + uOffset) / 512f, 249 / 512f, (249 + 16) / 512f, GL11.GL_NEAREST + ); + + if (mouseX > left + 16 && mouseX <= left + 96 && + mouseY > top && mouseY <= top + 16) { + disallowClick = true; + if (enchanterCurrentItem.displayLore != null) { + tooltipToDisplay = enchanterCurrentItem.displayLore; + } + } + + if (mouseY > top + 18 && mouseY <= top + 18 + 16) { + if (mouseX > guiLeft + X_SIZE / 2 - 1 - 48 && mouseX <= guiLeft + X_SIZE / 2 - 1) { + disallowClick = true; + if (enchanterCurrentItem.displayLore != null) { + tooltipToDisplay = enchanterCurrentItem.displayLore; + } + } else if (mouseX > guiLeft + X_SIZE / 2 + 1 && mouseX <= guiLeft + X_SIZE / 2 + 1 + 48) { + disallowClick = true; + tooltipToDisplay = Lists.newArrayList("\u00a7cCancel"); + } + } + } + + if (currentState == EnchantState.HAS_ITEM_IN_BOOKS || currentState == EnchantState.ADDING_BOOK) { + renderCancel(); + } + + //Item enchant input + ItemStack itemEnchantInput; + if (isInHex()) { + itemEnchantInput = cc.getSlot(22).getStack(); + } else { + itemEnchantInput = cc.getSlot(19).getStack(); + } + if (itemEnchantInput != null && itemEnchantInput.getItem() == Item.getItemFromBlock(Blocks.stained_glass_pane)) { + itemEnchantInput = enchantingItem; + } + { + int itemX = guiLeft + 174; + int itemY = guiTop + 58; + + if (itemEnchantInput == null) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(itemX, itemY, 16, 16, + 0, 16 / 512f, 281 / 512f, (281 + 16) / 512f, GL11.GL_NEAREST + ); + } else { + Utils.drawItemStack(itemEnchantInput, itemX, itemY); + } + + if (mouseX >= itemX && mouseX < itemX + 18 && + mouseY >= itemY && mouseY < itemY + 18) { + itemHoverX = itemX; + itemHoverY = itemY; + + if (itemEnchantInput != null) { + tooltipToDisplay = itemEnchantInput.getTooltip( + Minecraft.getMinecraft().thePlayer, + Minecraft.getMinecraft().gameSettings.advancedItemTooltips + ); + } + } + } + + if (currentState == EnchantState.APPLYING_GEMSTONE) { + int left = guiLeft + X_SIZE / 2 - 56; + int top = guiTop + 83; + //Enchant cost + String levelStr = getIconStr(enchanterCurrentItem); + + int colour = 0xc8ff8f; + if (enchanterCurrentItem.price > playerXpLevel) { + colour = 0xff5555; + } + + int levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 8 - levelWidth / 2 - 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 8 - levelWidth / 2 + 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 8 - levelWidth / 2, + top + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 8 - levelWidth / 2, + top + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString(levelStr, left + 8 - levelWidth / 2, top + 4, colour, false); + + //Enchant name + String name = WordUtils.capitalizeFully(enchanterCurrentItem.itemName); + if (name.equalsIgnoreCase("Bane of Arthropods")) { + name = "Bane of Arth."; + } else if (name.equalsIgnoreCase("Projectile Protection")) { + name = "Projectile Prot"; + } else if (name.equalsIgnoreCase("Blast Protection")) { + name = "Blast Prot"; + } else if (name.equalsIgnoreCase("Luck of the Sea")) { + name = "Luck of Sea"; + } else if (name.equalsIgnoreCase("Turbo Mushrooms")) { + name = "Turbo-Mush"; + } + Utils.drawStringCentered( + name, + Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2, + top + 8, + true, + 0xffffffdd + ); + + if (isChangingEnchLevel) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(left + 96, top, 16, 16, + 96 / 512f, 112 / 512f, 265 / 512f, (265 + 16) / 512f, GL11.GL_NEAREST + ); + } + + //Enchant level + levelStr = ""; + levelWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(levelStr); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2 - 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2 + 1, + top + 4, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2, + top + 4 - 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2, + top + 4 + 1, + 0x2d2102, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + levelStr, + left + 96 + 8 - levelWidth / 2, + top + 4, + 0xea82ff, + false + ); + } + + if (!isChangingEnchLevel && itemHoverX >= 0 && itemHoverY >= 0) { + GlStateManager.disableDepth(); + GlStateManager.colorMask(true, true, true, false); + Gui.drawRect(itemHoverX, itemHoverY, itemHoverX + 16, itemHoverY + 16, + hoverLocked ? 0x80ff8080 : 0x80ffffff + ); + GlStateManager.colorMask(true, true, true, true); + GlStateManager.enableDepth(); + } + + GlStateManager.translate(0, 0, 300); + + renderOrbAnim(partialTicks); + + renderMouseStack(stackOnMouse, disallowClick, mouseX, mouseY, + width, height, tooltipToDisplay + ); + GlStateManager.translate(0, 0, -300); + } + + private String getIconStr(HexItem item) { + String levelStr = ""; + if (item.itemType != ItemType.UNKNOWN) { + int potatoCount = 0; + int killCount = 0; + int warCount = 0; + int ffdCount = 0; + int recombCount = 0; + int effLevel = 0; + int starCount = 0; + int singularityCount = 0; + int tunerCount = 0; + int manaDisintegratorCount = 0; + int peaceCount = 0; + int dungeonItem = 0; + boolean shadowWarp = false; + boolean witherShield = false; + boolean implosion = false; + String reforge = ""; + if (enchantingItem != null) { + NBTTagCompound tagItem = enchantingItem.getTagCompound(); + if (tagItem != null) { + NBTTagCompound ea = tagItem.getCompoundTag("ExtraAttributes"); + if (ea != null) { + potatoCount = ea.getInteger("hot_potato_count"); + killCount = ea.getInteger("stats_book"); + warCount = ea.getInteger("art_of_war_count"); + ffdCount = ea.getInteger("farming_for_dummies_count"); + recombCount = ea.getInteger("rarity_upgrades"); + starCount = ea.getInteger("upgrade_level"); + singularityCount = ea.getInteger("wood_singularity_count"); + tunerCount = ea.getInteger("tuned_transmission"); + peaceCount = ea.getInteger("art_of_peace_count"); + manaDisintegratorCount = ea.getInteger("mana_disintegrator_count"); + dungeonItem = ea.getInteger("dungeon_item"); + reforge = ea.getString("modifier"); + NBTTagCompound enchs = ea.getCompoundTag("enchantments"); + NBTTagList scrolls = ea.getTagList("ability_scroll", 8); + if (enchs != null) { + effLevel = enchs.getInteger("efficiency"); + } + if (scrolls != null) { + for (int index = 0; index < scrolls.tagCount(); index++) { + if (scrolls.getStringTagAt(index).equals("IMPLOSION_SCROLL")) { + implosion = true; + } else if (scrolls.getStringTagAt(index).equals("SHADOW_WARP_SCROLL")) { + shadowWarp = true; + } else if (scrolls.getStringTagAt(index).equals("WITHER_SHIELD_SCROLL")) { + witherShield = true; + } + } + } + } + } + } + if (item.itemType == ItemType.HOT_POTATO) { + if (potatoCount < 10) levelStr = "" + potatoCount; + else levelStr = "✔"; + + } else if (item.itemType == ItemType.FUMING_POTATO) { + if (potatoCount <= 10) levelStr = "" + 0; + else if (potatoCount < 15) levelStr = "" + (potatoCount - 10); + else levelStr = "✔"; + + } else if (item.itemType == ItemType.BOOK_OF_STATS) { + if (killCount > 0) levelStr = "✔"; + else levelStr = "✖"; + + } else if (item.itemType == ItemType.ART_OF_WAR) { + if (warCount > 0) levelStr = "✔"; + else levelStr = "✖"; + + } else if (item.itemType == ItemType.FARMING_DUMMY) { + if (ffdCount < 5) levelStr = "" + ffdCount; + else levelStr = "✔"; + + } else if (item.itemType == ItemType.RECOMB) { + if (recombCount > 0) levelStr = "✔"; + else levelStr = "✖"; + + } else if (item.itemType == ItemType.SILEX) { + if (effLevel < 10) levelStr = "✖"; + else levelStr = "✔"; + + } else if (item.isPowerScroll()) { + levelStr = "✖"; + + } else if (item.isMasterStar()) { + levelStr = "✖"; + + } else if (item.isDungeonStar()) { + if (starCount >= item.itemType.getStarLevel()) levelStr = "✔"; + else levelStr = "✖"; + + } else if (item.itemType == ItemType.WOOD_SINGULARITY) { + if (singularityCount > 0) levelStr = "✔"; + else levelStr = "✖"; + + } else if (item.isHypeScroll()) { + if (shadowWarp) levelStr = "✔"; + else if (implosion) levelStr = "✔"; + else if (witherShield) levelStr = "✔"; + else levelStr = "✖"; + + } else if (item.itemType == ItemType.TUNER) { + if (tunerCount >= 4) levelStr = "✔"; + else levelStr = "✖"; + + } else if (item.itemType == ItemType.REFORGE) { + if (item.getReforge().equalsIgnoreCase(reforge)) levelStr = "✔"; + else levelStr = "✖"; + + } else if (item.itemType == ItemType.RANDOM_REFORGE) { + levelStr = "?"; + + } else if (item.itemType == ItemType.ART_OF_PEACE) { + if (peaceCount > 0) levelStr = "✔"; + else levelStr = "✖"; + + } else if (item.itemType == ItemType.MANA_DISINTEGRATOR) { + if (manaDisintegratorCount >= 10) levelStr = "✔"; + else levelStr = "✖"; + + } else if (item.itemType == ItemType.CONVERT_TO_DUNGEON) { + if (dungeonItem > 0) levelStr = "✔"; + else levelStr = "✖"; + + } else if (item.itemType == ItemType.RUBY_GEMSTONE) { + levelStr = "❤"; + + } else if (item.itemType == ItemType.AMETHYST_GEMSTONE) { + levelStr = "❈"; + + } else if (item.itemType == ItemType.SAPPHIRE_GEMSTONE) { + levelStr = "✎"; + + } else if (item.itemType == ItemType.JADE_GEMSTONE) { + levelStr = "☘"; + + } else if (item.itemType == ItemType.AMBER_GEMSTONE) { + levelStr = "⸕"; + + } else if (item.itemType == ItemType.TOPAZ_GEMSTONE) { + levelStr = "✧"; + + } else if (item.itemType == ItemType.JASPER_GEMSTONE) { + levelStr = "❁"; + + } else if (item.itemType == ItemType.OPAL_GEMSTONE) { + levelStr = "❂"; + } + } else { + levelStr = "?"; + } + return levelStr; + } + + private void renderBaseTexture() { + //Base Texture + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft, guiTop, X_SIZE, Y_SIZE, + 0, X_SIZE / 512f, 0, Y_SIZE / 512f, GL11.GL_NEAREST + ); + } + + private List renderSettings(int mouseX, int mouseY, List tooltipToDisplay) { + //Settings Buttons + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + //On Settings Button + Utils.drawTexturedRect(guiLeft + 295, guiTop + 147, 16, 16, + 0, 16 / 512f, 387 / 512f, (387 + 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, + sortingMinU, sortingMinU + 16 / 512f, 419 / 512f, (419 + 16) / 512f, GL11.GL_NEAREST + ); + //Ordering Settings Button + float orderingMinU = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enchantOrdering * 16 / 512f; + Utils.drawTexturedRect(guiLeft + 295 + 18, guiTop + 147 + 18, 16, 16, + orderingMinU, orderingMinU + 16 / 512f, 435 / 512f, (435 + 16) / 512f, GL11.GL_NEAREST + ); + + if (mouseX >= guiLeft + 294 && mouseX < guiLeft + 294 + 36 && + mouseY >= guiTop + 146 && mouseY < guiTop + 146 + 36) { + int index = (mouseX - (guiLeft + 295)) / 18 + (mouseY - (guiTop + 147)) / 18 * 2; + switch (index) { + case 0: + Gui.drawRect(guiLeft + 295, guiTop + 147, guiLeft + 295 + 16, guiTop + 147 + 16, 0x80ffffff); + tooltipToDisplay = createTooltip("Enable GUI", 0, "On", "Off"); + break; + case 2: + Gui.drawRect(guiLeft + 295, guiTop + 147 + 18, guiLeft + 295 + 16, guiTop + 147 + 16 + 18, 0x80ffffff); + tooltipToDisplay = createTooltip("Sort enchants...", + NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enchantSorting, + "By Cost", "Alphabetically" + ); + break; + case 3: + Gui.drawRect( + guiLeft + 295 + 18, + guiTop + 147 + 18, + guiLeft + 295 + 16 + 18, + guiTop + 147 + 16 + 18, + 0x80ffffff + ); + tooltipToDisplay = createTooltip("Order enchants...", + NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enchantOrdering, + "Ascending", "Descending" + ); + break; + } + } + return tooltipToDisplay; + } + + private void renderScrollBars(List applicable, List removable, int mouseY) { + //Left scroll bar + { + int offset; + if (applicable.size() <= 6) { + offset = 0; + } else if (isScrollingLeft && clickedScrollOffset >= 0) { + offset = mouseY - clickedScrollOffset; + if (offset < 0) offset = 0; + if (offset > 96 - 15) offset = 96 - 15; + } else { + offset = Math.round((96 - 15) * (leftScroll.getValue() / (float) ((applicable.size() - 6) * 16))); + } + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + 104, guiTop + 18 + offset, 12, 15, + 0, 12 / 512f, 313 / 512f, (313 + 15) / 512f, GL11.GL_NEAREST + ); + } + //Right scroll bar + { + int offset; + if (removable.size() <= 6) { + offset = 0; + } else if (!isScrollingLeft && clickedScrollOffset >= 0) { + offset = mouseY - clickedScrollOffset; + if (offset < 0) offset = 0; + if (offset > 96 - 15) offset = 96 - 15; + } else { + offset = Math.round((96 - 15) * (rightScroll.getValue() / (float) ((removable.size() - 6) * 16))); + } + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + 344, guiTop + 18 + offset, 12, 15, + 0, 12 / 512f, 313 / 512f, (313 + 15) / 512f, GL11.GL_NEAREST + ); + } + } + + private void renderArrow() { + //Enchant arrow + if (arrowAmount.getValue() > 0) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + float w = 22 * arrowAmount.getValue(); + if (removingEnchantPlayerLevel < 0) { + Utils.drawTexturedRect(guiLeft + 134, guiTop + 58, w, 16, + 0, w / 512f, 297 / 512f, (297 + 16) / 512f, GL11.GL_NEAREST + ); + } else { + Utils.drawTexturedRect(guiLeft + 230 - w, guiTop + 58, w, 16, + (44 - w) / 512f, 44 / 512f, 297 / 512f, (297 + 16) / 512f, GL11.GL_NEAREST + ); + } + } + } + + private void renderCancel() { + int top = guiTop + 83; + //Cancel button + if (System.currentTimeMillis() - cancelButtonAnimTime < 500) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + 1, top + 18, 48, 14, + 0, 48 / 512f, 342 / 512f, (342 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered("Cancel", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 + 1 + 25, top + 18 + 9, false, 0xa04040 + ); + } else { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.color(1, 1, 1, 1); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + 1, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawStringCentered("Cancel", Minecraft.getMinecraft().fontRendererObj, + guiLeft + X_SIZE / 2 + 1 + 24, top + 18 + 8, false, 0xa04040 + ); + } + } + + private void renderOrbAnim(float partialTicks) { + //Orb animation + GlStateManager.pushMatrix(); + GlStateManager.translate(guiLeft, guiTop, 0); + orbDisplay.renderOrbs(partialTicks); + GlStateManager.popMatrix(); + } + + private void renderMouseStack( + ItemStack stackOnMouse, boolean disallowClick, + int mouseX, int mouseY, int width, int height, + List tooltipToDisplay + ) { + if (stackOnMouse != null) { + if (disallowClick) { + Utils.drawItemStack(new ItemStack(Item.getItemFromBlock(Blocks.barrier)), mouseX - 8, mouseY - 8); + } else { + Utils.drawItemStack(stackOnMouse, mouseX - 8, mouseY - 8); + } + } else if (tooltipToDisplay != null) { + Utils.drawHoveringText(tooltipToDisplay, mouseX, mouseY, width, height, -1, + Minecraft.getMinecraft().fontRendererObj + ); + } + } + + private void renderEnchantBook(ScaledResolution scaledresolution, float partialTicks) { + GlStateManager.enableDepth(); + + GlStateManager.pushMatrix(); + GlStateManager.matrixMode(5889); + GlStateManager.pushMatrix(); + GlStateManager.loadIdentity(); + GlStateManager.viewport((scaledresolution.getScaledWidth() - 320) / 2 * scaledresolution.getScaleFactor(), + (scaledresolution.getScaledHeight() - 240) / 2 * scaledresolution.getScaleFactor(), + 320 * scaledresolution.getScaleFactor(), 240 * scaledresolution.getScaleFactor() + ); + GlStateManager.translate(0.0F, 0.33F, 0.0F); + Project.gluPerspective(90.0F, 1.3333334F, 9.0F, 80.0F); + GlStateManager.matrixMode(5888); + GlStateManager.loadIdentity(); + RenderHelper.enableStandardItemLighting(); + GlStateManager.translate(0.0F, 3.3F, -16.0F); + GlStateManager.scale(5, 5, 5); + GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + Minecraft.getMinecraft().getTextureManager().bindTexture(ENCHANTMENT_TABLE_BOOK_TEXTURE); + GlStateManager.rotate(20.0F, 1.0F, 0.0F, 0.0F); + float bookOpenAngle = this.bookOpenLast + (this.bookOpen - this.bookOpenLast) * partialTicks; + GlStateManager.translate( + (1.0F - bookOpenAngle) * 0.2F, + (1.0F - bookOpenAngle) * 0.1F, + (1.0F - bookOpenAngle) * 0.25F + ); + GlStateManager.rotate(-(1.0F - bookOpenAngle) * 90.0F - 90.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F); + float pageAngle1 = this.pageOpenLast + (this.pageOpen - this.pageOpenLast) * partialTicks + 0.25F; + float pageAngle2 = this.pageOpenLast + (this.pageOpen - this.pageOpenLast) * partialTicks + 0.75F; + pageAngle1 = (pageAngle1 - (float) MathHelper.truncateDoubleToInt(pageAngle1)) * 1.6F - 0.3F; + pageAngle2 = (pageAngle2 - (float) MathHelper.truncateDoubleToInt(pageAngle2)) * 1.6F - 0.3F; + + if (pageAngle1 < 0.0F) pageAngle1 = 0.0F; + if (pageAngle1 > 1.0F) pageAngle1 = 1.0F; + if (pageAngle2 < 0.0F) pageAngle2 = 0.0F; + if (pageAngle2 > 1.0F) pageAngle2 = 1.0F; + + GlStateManager.enableRescaleNormal(); + MODEL_BOOK.render(null, 0.0F, pageAngle1, pageAngle2, bookOpenAngle, 0.0F, 0.0625F); + GlStateManager.disableRescaleNormal(); + RenderHelper.disableStandardItemLighting(); + GlStateManager.matrixMode(5889); + GlStateManager.viewport(0, 0, Minecraft.getMinecraft().displayWidth, Minecraft.getMinecraft().displayHeight); + GlStateManager.popMatrix(); + GlStateManager.matrixMode(5888); + GlStateManager.popMatrix(); + RenderHelper.disableStandardItemLighting(); + GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); + + GlStateManager.enableDepth(); + } + + private boolean isInEnchanting() { + return currentState == EnchantState.ADDING_ENCHANT || currentState == EnchantState.HAS_ITEM || + currentState == EnchantState.SWITCHING_DONT_UPDATE; + } + + private boolean isInHex() { + return currentState == EnchantState.HAS_ITEM_IN_HEX || currentState == EnchantState.INVALID_ITEM_HEX || + currentState == EnchantState.NO_ITEM_IN_HEX; + } + + private boolean isInGemstones() { + return currentState == EnchantState.HAS_ITEM_IN_GEMSTONE || currentState == EnchantState.ADDING_GEMSTONE || + currentState == EnchantState.APPLYING_GEMSTONE; + } + + public void overrideIsMouseOverSlot(Slot slot, int mouseX, int mouseY, CallbackInfoReturnable cir) { + if ((shouldOverrideFast || shouldOverrideGemstones || shouldOverrideXp) && currentState != EnchantState.ADDING_ENCHANT) { + boolean playerInv = slot.inventory == Minecraft.getMinecraft().thePlayer.inventory; + int slotId = slot.getSlotIndex(); + if (playerInv && slotId < 36) { + slotId -= 9; + if (slotId < 0) slotId += 36; + + int itemX = guiLeft + 102 + 18 * (slotId % 9); + int itemY = guiTop + 133 + 18 * (slotId / 9); + + if (slotId >= 27) { + itemY += 4; + } + + if (mouseX >= itemX && mouseX < itemX + 18 && + mouseY >= itemY && mouseY < itemY + 18) { + cir.setReturnValue(true); + } else { + cir.setReturnValue(false); + } + } else if ((slotId == 19 && !isInHex()) || (slotId == 22 && isInHex())) { + cir.setReturnValue(mouseX >= guiLeft + 173 && mouseX < guiLeft + 173 + 18 && + mouseY >= guiTop + 57 && mouseY < guiTop + 57 + 18); + } + } + } + + public boolean mouseInput(int mouseX, int mouseY) { + if (Mouse.getEventButtonState() && + (currentState == EnchantState.HAS_ITEM || currentState == EnchantState.ADDING_ENCHANT || + currentState == EnchantState.HAS_ITEM_IN_HEX || currentState == EnchantState.ADDING_BOOK || + currentState == EnchantState.ADDING_GEMSTONE || currentState == EnchantState.APPLYING_GEMSTONE)) { + if (mouseY > guiTop + 6 && mouseY < guiTop + 6 + 15) { + String pageStr = "Page: " + currentPage + "/" + expectedMaxPage; + int pageStrLen = Minecraft.getMinecraft().fontRendererObj.getStringWidth(pageStr); + + int click = -1; + if (mouseX > guiLeft + X_SIZE / 2 - pageStrLen / 2 - 2 - 15 && + mouseX <= guiLeft + X_SIZE / 2 - pageStrLen / 2 - 2) { + click = 17; + } else if (mouseX > guiLeft + X_SIZE / 2 + pageStrLen / 2 + 2 && + mouseX <= guiLeft + X_SIZE / 2 + pageStrLen / 2 + 2 + 15) { + click = 35; + } + + if (click >= 0) { + if (currentState == EnchantState.ADDING_ENCHANT || currentState == EnchantState.ADDING_BOOK) { + if (Mouse.getEventButtonState()) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); + + cancelButtonAnimTime = System.currentTimeMillis(); + } + } else { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(click); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, click, 0, 0, stack, transactionID)); + } + return true; + } + } + } + + // Cancel button + if (currentState == EnchantState.HAS_ITEM || + currentState == EnchantState.HAS_ITEM_IN_BOOKS || currentState == EnchantState.HAS_ITEM_IN_GEMSTONE) { + if (Mouse.getEventButtonState()) { + int top = guiTop + 83; + + if (!isChangingEnchLevel && mouseX > guiLeft + X_SIZE / 2 + 1 && mouseX <= guiLeft + X_SIZE / 2 + 1 + 48 && + mouseY > top + 18 && mouseY <= top + 18 + 14) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + leftScroll.setValue(0); + rightScroll.setValue(0); + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + if (currentState != EnchantState.ADDING_BOOK) { + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); + if (isInGemstones()) { + currentState = EnchantState.HAS_ITEM_IN_GEMSTONE; + } + } else { + currentState = EnchantState.HAS_ITEM_IN_BOOKS; + } + searchField.setText(""); + cancelButtonAnimTime = System.currentTimeMillis(); + enchanterCurrentItem = null; + } + + if (mouseX > guiLeft + X_SIZE / 2 - searchField.getWidth() / 2 && + mouseX < guiLeft + X_SIZE / 2 + searchField.getWidth() / 2 && + mouseY > guiTop + 80 && mouseY < guiTop + 96) { + searchField.mouseClicked(mouseX, mouseY, Mouse.getEventButton()); + } else { + searchField.setFocus(false); + } + } else if (Mouse.getEventButton() < 0 && searchField.getFocus() && Mouse.isButtonDown(0)) { + searchField.mouseClickMove(mouseX, mouseY, 0, 0); + } + } else if (currentState == EnchantState.ADDING_ENCHANT && !enchanterEnchLevels.isEmpty()) { + if (Mouse.getEventButtonState()) { + int left = guiLeft + X_SIZE / 2 - 56; + int top = guiTop + 83; + + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - 1 - 48, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + 1, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + + if (!isChangingEnchLevel && mouseX > guiLeft + X_SIZE / 2 + 1 && mouseX <= guiLeft + X_SIZE / 2 + 1 + 48 && + mouseY > top + 18 && mouseY <= top + 18 + 14) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); + + cancelButtonAnimTime = System.currentTimeMillis(); + } else if (!isChangingEnchLevel && enchanterCurrentEnch != null && + (mouseX > left + 16 && mouseX <= left + 96 && + mouseY > top && mouseY <= top + 16) || + (mouseX > guiLeft + X_SIZE / 2 - 1 - 48 && mouseX <= guiLeft + X_SIZE / 2 - 1 && + mouseY > top + 18 && mouseY <= top + 18 + 14)) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot( + enchanterCurrentEnch.slotIndex); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, + enchanterCurrentEnch.slotIndex, 0, 0, stack, transactionID + )); + + int playerXpLevel = Minecraft.getMinecraft().thePlayer.experienceLevel; + if (playerXpLevel >= enchanterCurrentEnch.xpCost) { + if (removingEnchantPlayerLevel >= 0 && enchanterCurrentEnch.level == removingEnchantPlayerLevel) { + orbDisplay.spawnExperienceOrbs(X_SIZE / 2, 66, X_SIZE / 2, 36, 3); + } else { + orbDisplay.spawnExperienceOrbs(mouseX - guiLeft, mouseY - guiTop, X_SIZE / 2, 66, 0); + } + } + + confirmButtonAnimTime = System.currentTimeMillis(); + } else if (mouseX > left + 96 && mouseX <= left + 96 + 16) { + if (!isChangingEnchLevel) { + if (mouseY > top && mouseY < top + 16) { + isChangingEnchLevel = true; + return true; + } + } else { + List before = new ArrayList<>(); + List after = new ArrayList<>(); + + for (Enchantment ench : enchanterEnchLevels.values()) { + if (ench.level < enchanterCurrentEnch.level) { + before.add(ench); + } else if (ench.level > enchanterCurrentEnch.level) { + after.add(ench); + } + } + + before.sort(Comparator.comparingInt(o -> -o.level)); + after.sort(Comparator.comparingInt(o -> o.level)); + + int bSize = before.size(); + int aSize = after.size(); + for (int i = 0; i < bSize + aSize; i++) { + Enchantment ench; + int yIndex; + if (i < bSize) { + yIndex = -i - 1; + ench = before.get(i); + } else { + yIndex = i - bSize + 1; + ench = after.get(i - bSize); + } + + if (mouseY > top + 16 * yIndex && mouseY <= top + 16 * yIndex + 16) { + enchanterCurrentEnch = ench; + isChangingEnchLevel = false; + return true; + } + } + } + } + + if (isChangingEnchLevel) { + isChangingEnchLevel = false; + return true; + } + } + } else if (currentState == EnchantState.ADDING_BOOK) { + if (Mouse.getEventButtonState()) { + int left = guiLeft + X_SIZE / 2 - 56; + int top = guiTop + 83; + + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - 1 - 48, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + 1, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + + if (!isChangingEnchLevel && mouseX > guiLeft + X_SIZE / 2 + 1 && mouseX <= guiLeft + X_SIZE / 2 + 1 + 48 && + mouseY > top + 18 && mouseY <= top + 18 + 14) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + /*GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID));*/ + + cancelButtonAnimTime = System.currentTimeMillis(); + currentState = EnchantState.HAS_ITEM_IN_BOOKS; + enchanterCurrentItem = null; + } else if (!isChangingEnchLevel && enchanterCurrentItem != null && + (mouseX > left + 16 && mouseX <= left + 96 && + mouseY > top && mouseY <= top + 16) || + (mouseX > guiLeft + X_SIZE / 2 - 1 - 48 && mouseX <= guiLeft + X_SIZE / 2 - 1 && + mouseY > top + 18 && mouseY <= top + 18 + 14)) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot( + enchanterCurrentItem.slotIndex); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, + enchanterCurrentItem.slotIndex, 0, 0, stack, transactionID + )); + + if (removingEnchantPlayerLevel >= 0 && enchanterCurrentItem.level == removingEnchantPlayerLevel) { + orbDisplay.spawnExperienceOrbs(X_SIZE / 2, 66, X_SIZE / 2, 36, 3); + } else { + orbDisplay.spawnExperienceOrbs(mouseX - guiLeft, mouseY - guiTop, X_SIZE / 2, 66, 0); + } + + confirmButtonAnimTime = System.currentTimeMillis(); + enchanterCurrentItem = null; + currentState = EnchantState.HAS_ITEM_IN_BOOKS; + } else if (mouseX > left + 96 && mouseX <= left + 96 + 16) { + if (!isChangingEnchLevel) { + if (mouseY > top && mouseY < top + 16) { + isChangingEnchLevel = true; + return true; + } + } else { + List before = new ArrayList<>(); + List after = new ArrayList<>(); + + for (HexItem item : enchanterItemLevels.values()) { + if (item.level < enchanterCurrentItem.level) { + before.add(item); + } else if (item.level > enchanterCurrentItem.level) { + after.add(item); + } + } + + before.sort(Comparator.comparingInt(o -> -o.level)); + after.sort(Comparator.comparingInt(o -> o.level)); + + int bSize = before.size(); + int aSize = after.size(); + for (int i = 0; i < bSize + aSize; i++) { + HexItem item; + int yIndex; + if (i < bSize) { + yIndex = -i - 1; + item = before.get(i); + } else { + yIndex = i - bSize + 1; + item = after.get(i - bSize); + } + + if (mouseY > top + 16 * yIndex && mouseY <= top + 16 * yIndex + 16) { + enchanterCurrentItem = item; + isChangingEnchLevel = false; + return true; + } + } + } + } + + if (isChangingEnchLevel) { + isChangingEnchLevel = false; + return true; + } + } + } else if (currentState == EnchantState.HAS_ITEM_IN_HEX) { + if (Mouse.getEventButtonState()) { + int left = guiLeft + X_SIZE / 2 - 56; + int top = guiTop + 83; + + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - 1 - 48, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + 1, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + + if (!isChangingEnchLevel && mouseX > guiLeft + X_SIZE / 2 + 1 && mouseX <= guiLeft + X_SIZE / 2 + 1 + 48 && + mouseY > top + 18 && mouseY <= top + 18 + 14) { + /*if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); + + cancelButtonAnimTime = System.currentTimeMillis(); + currentState = EnchantState.HAS_ITEM_IN_BOOKS; + enchanterCurrentItem = null;*/ + } else if (!isChangingEnchLevel && enchanterCurrentItem != null && + (mouseX > left + 16 && mouseX <= left + 96 && + mouseY > top && mouseY <= top + 16) || + (mouseX > guiLeft + X_SIZE / 2 - 1 - 48 && mouseX <= guiLeft + X_SIZE / 2 - 1 && + mouseY > top + 18 && mouseY <= top + 18 + 14)) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot( + enchanterCurrentItem.slotIndex); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, + enchanterCurrentItem.slotIndex, 0, 0, stack, transactionID + )); + enchantingItem = null; + if (removingEnchantPlayerLevel >= 0 && enchanterCurrentItem.level == removingEnchantPlayerLevel) { + orbDisplay.spawnExperienceOrbs(X_SIZE / 2, 66, X_SIZE / 2, 36, 3); + } else { + orbDisplay.spawnExperienceOrbs(mouseX - guiLeft, mouseY - guiTop, X_SIZE / 2, 66, 0); + } + + confirmButtonAnimTime = System.currentTimeMillis(); + //enchanterCurrentItem = null; + //currentState = EnchantState.HAS_ITEM_IN_BOOKS; + } else if (mouseX > left + 96 && mouseX <= left + 96 + 16) { + if (!isChangingEnchLevel) { + if (mouseY > top && mouseY < top + 16) { + isChangingEnchLevel = true; + return true; + } + } else { + List before = new ArrayList<>(); + List after = new ArrayList<>(); + + for (HexItem item : enchanterItemLevels.values()) { + if (item.level < enchanterCurrentItem.level) { + before.add(item); + } else if (item.level > enchanterCurrentItem.level) { + after.add(item); + } + } + + before.sort(Comparator.comparingInt(o -> -o.level)); + after.sort(Comparator.comparingInt(o -> o.level)); + + int bSize = before.size(); + int aSize = after.size(); + for (int i = 0; i < bSize + aSize; i++) { + HexItem item; + int yIndex; + if (i < bSize) { + yIndex = -i - 1; + item = before.get(i); + } else { + yIndex = i - bSize + 1; + item = after.get(i - bSize); + } + + if (mouseY > top + 16 * yIndex && mouseY <= top + 16 * yIndex + 16) { + enchanterCurrentItem = item; + isChangingEnchLevel = false; + return true; + } + } + } + } + + if (isChangingEnchLevel) { + isChangingEnchLevel = false; + return true; + } + } + } else if (currentState == EnchantState.ADDING_GEMSTONE || currentState == EnchantState.APPLYING_GEMSTONE) { + if (Mouse.getEventButtonState()) { + int left = guiLeft + X_SIZE / 2 - 56; + int top = guiTop + 83; + + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 - 1 - 48, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + Utils.drawTexturedRect(guiLeft + X_SIZE / 2 + 1, top + 18, 48, 14, + 0, 48 / 512f, 328 / 512f, (328 + 14) / 512f, GL11.GL_NEAREST + ); + + if (!isChangingEnchLevel && mouseX > guiLeft + X_SIZE / 2 + 1 && mouseX <= guiLeft + X_SIZE / 2 + 1 + 48 && + mouseY > top + 18 && mouseY <= top + 18 + 14) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + if (currentState != EnchantState.APPLYING_GEMSTONE) { + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); + + cancelButtonAnimTime = System.currentTimeMillis(); + currentState = EnchantState.HAS_ITEM_IN_GEMSTONE; + enchanterCurrentItem = null; + } else { + currentState = EnchantState.ADDING_ENCHANT; + enchanterCurrentItem = null; + } + } else if (!isChangingEnchLevel && enchanterCurrentItem != null && + (mouseX > left + 16 && mouseX <= left + 96 && + mouseY > top && mouseY <= top + 16) || + (mouseX > guiLeft + X_SIZE / 2 - 1 - 48 && mouseX <= guiLeft + X_SIZE / 2 - 1 && + mouseY > top + 18 && mouseY <= top + 18 + 14) && currentState == EnchantState.APPLYING_GEMSTONE) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot( + enchanterCurrentItem.slotIndex); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, + enchanterCurrentItem.slotIndex, 0, 0, stack, transactionID + )); + enchantingItem = null; + if (removingEnchantPlayerLevel >= 0 && enchanterCurrentItem.level == removingEnchantPlayerLevel) { + orbDisplay.spawnExperienceOrbs(X_SIZE / 2, 66, X_SIZE / 2, 36, 3); + } else { + orbDisplay.spawnExperienceOrbs(mouseX - guiLeft, mouseY - guiTop, X_SIZE / 2, 66, 0); + } + + confirmButtonAnimTime = System.currentTimeMillis(); + enchanterCurrentItem = null; + currentState = EnchantState.ADDING_GEMSTONE; + } else if (mouseX > left + 96 && mouseX <= left + 96 + 16) { + if (!isChangingEnchLevel) { + if (mouseY > top && mouseY < top + 16) { + isChangingEnchLevel = true; + return true; + } + } else { + List before = new ArrayList<>(); + List after = new ArrayList<>(); + + for (HexItem item : enchanterItemLevels.values()) { + if (item.level < enchanterCurrentItem.level) { + before.add(item); + } else if (item.level > enchanterCurrentItem.level) { + after.add(item); + } + } + + before.sort(Comparator.comparingInt(o -> -o.level)); + after.sort(Comparator.comparingInt(o -> o.level)); + + int bSize = before.size(); + int aSize = after.size(); + for (int i = 0; i < bSize + aSize; i++) { + HexItem item; + int yIndex; + if (i < bSize) { + yIndex = -i - 1; + item = before.get(i); + } else { + yIndex = i - bSize + 1; + item = after.get(i - bSize); + } + + if (mouseY > top + 16 * yIndex && mouseY <= top + 16 * yIndex + 16) { + enchanterCurrentItem = item; + isChangingEnchLevel = false; + return true; + } + } + } + } + + if (isChangingEnchLevel) { + isChangingEnchLevel = false; + return true; + } + } + } + + if (!Mouse.getEventButtonState() && Mouse.getEventButton() < 0 && clickedScrollOffset != -1) { + if (isInEnchanting()) { + LerpingInteger lerpingInteger = isClickedScrollLeft ? leftScroll : rightScroll; + List enchantsList = isClickedScrollLeft ? applicable : removable; + + if (enchantsList.size() > 6) { + int newOffset = mouseY - clickedScrollOffset; + + int newScroll = Math.round(newOffset * (float) ((enchantsList.size() - 6) * 16) / (96 - 15)); + int max = (enchantsList.size() - 6) * 16; + + if (newScroll > max) newScroll = max; + if (newScroll < 0) newScroll = 0; + + lerpingInteger.setValue(newScroll); + } + } else { + LerpingInteger lerpingInteger = isClickedScrollLeft ? leftScroll : rightScroll; + List itemsList = isClickedScrollLeft ? applicableItem : removableItem; + + if (itemsList.size() > 6) { + int newOffset = mouseY - clickedScrollOffset; + + int newScroll = Math.round(newOffset * (float) ((itemsList.size() - 6) * 16) / (96 - 15)); + int max = (itemsList.size() - 6) * 16; + + if (newScroll > max) newScroll = max; + if (newScroll < 0) newScroll = 0; + + lerpingInteger.setValue(newScroll); + } + } + } + + //Config options + if (Mouse.getEventButtonState()) { + if (mouseX >= guiLeft + 294 && mouseX < guiLeft + 294 + 36 && + mouseY >= guiTop + 146 && mouseY < guiTop + 146 + 36) { + int index = (mouseX - (guiLeft + 295)) / 18 + (mouseY - (guiTop + 147)) / 18 * 2; + + int direction = Mouse.getEventButton() == 0 ? 1 : -1; + + switch (index) { + case 0: { + NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI = false; + break; + } + case 2: { + int val = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enchantSorting; + val += direction; + if (val < 0) val = 1; + if (val > 1) val = 0; + NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enchantSorting = val; + break; + } + case 3: { + int val = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enchantOrdering; + val += direction; + if (val < 0) val = 1; + if (val > 1) val = 0; + NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enchantOrdering = val; + break; + } + } + } + } + + if (Mouse.getEventButton() == 0) { + if (Mouse.getEventButtonState()) { + if (isInEnchanting()) { + if (mouseX > guiLeft + 104 && mouseX < guiLeft + 104 + 12) { + int offset; + if (applicable.size() <= 6) { + offset = 0; + } else { + offset = Math.round((96 - 15) * (leftScroll.getValue() / (float) ((applicable.size() - 6) * 16))); + } + if (mouseY >= guiTop + 18 + offset && mouseY < guiTop + 18 + offset + 15) { + isClickedScrollLeft = true; + clickedScrollOffset = mouseY - offset; + } + } else if (mouseX > guiLeft + 344 && mouseX < guiLeft + 344 + 12) { + int offset; + if (removable.size() <= 6) { + offset = 0; + } else { + offset = Math.round((96 - 15) * (rightScroll.getValue() / (float) ((removable.size() - 6) * 16))); + } + if (mouseY >= guiTop + 18 + offset && mouseY < guiTop + 18 + offset + 15) { + isClickedScrollLeft = false; + clickedScrollOffset = mouseY - offset; + } + } + } else { + if (mouseX > guiLeft + 104 && mouseX < guiLeft + 104 + 12) { + int offset; + if (applicableItem.size() <= 6) { + offset = 0; + } else { + offset = Math.round((96 - 15) * (leftScroll.getValue() / (float) ((applicableItem.size() - 6) * 16))); + } + if (mouseY >= guiTop + 18 + offset && mouseY < guiTop + 18 + offset + 15) { + isClickedScrollLeft = true; + clickedScrollOffset = mouseY - offset; + } + } else if (mouseX > guiLeft + 344 && mouseX < guiLeft + 344 + 12) { + int offset; + if (removableItem.size() <= 6) { + offset = 0; + } else { + offset = Math.round((96 - 15) * (rightScroll.getValue() / (float) ((removableItem.size() - 6) * 16))); + } + if (mouseY >= guiTop + 18 + offset && mouseY < guiTop + 18 + offset + 15) { + isClickedScrollLeft = false; + clickedScrollOffset = mouseY - offset; + } + } + } + } else { + clickedScrollOffset = -1; + } + } + + if (mouseY > guiTop + 18 && mouseY < guiTop + 18 + 96) { + if (mouseX > guiLeft + 8 && mouseX < guiLeft + 8 + 96) { + if (Mouse.getEventButton() == 0 && Mouse.getEventButtonState() && + Minecraft.getMinecraft().thePlayer.inventory.getItemStack() == null) { + if (isInEnchanting()) { + for (int i = 0; i < 7; i++) { + int index = i + leftScroll.getValue() / 16; + if (applicable.size() <= index) break; + + int top = guiTop - (leftScroll.getValue() % 16) + 18 + 16 * i; + if (mouseX > guiLeft + 8 && mouseX <= guiLeft + 8 + 96 && + mouseY > top && mouseY <= top + 16) { + Enchantment ench = applicable.get(index); + + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + if (currentState == EnchantState.HAS_ITEM) { + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = + ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(ench.slotIndex); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, + ench.slotIndex, 0, 0, stack, transactionID + )); + } else if (currentState == EnchantState.ADDING_ENCHANT) { + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); + + cancelButtonAnimTime = System.currentTimeMillis(); + } + + return true; + } + } + } else if (!isInHex() && !isInGemstones()) { + for (int i = 0; i < 7; i++) { + int index = i + leftScroll.getValue() / 16; + if (applicableItem.size() <= index) break; + + int top = guiTop - (leftScroll.getValue() % 16) + 18 + 16 * i; + if (mouseX > guiLeft + 8 && mouseX <= guiLeft + 8 + 96 && + mouseY > top && mouseY <= top + 16) { + HexItem item = applicableItem.get(index); + + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + if (currentState == EnchantState.HAS_ITEM_IN_BOOKS) { + currentState = EnchantState.ADDING_BOOK; + enchanterCurrentItem = item; + } else if (currentState == EnchantState.ADDING_BOOK && enchanterCurrentItem == item) { + currentState = EnchantState.HAS_ITEM_IN_BOOKS; + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = + ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(item.slotIndex); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, + item.slotIndex, 0, 0, stack, transactionID + )); + + cancelButtonAnimTime = System.currentTimeMillis(); + } else { + currentState = EnchantState.HAS_ITEM_IN_BOOKS; + enchanterCurrentItem = null; + } + + return true; + } + } + } else if (isInHex() && !isInGemstones()) { + for (int i = 0; i < 7; i++) { + int index = i + leftScroll.getValue() / 16; + if (applicableItem.size() <= index) break; + + int top = guiTop - (leftScroll.getValue() % 16) + 18 + 16 * i; + if (mouseX > guiLeft + 8 && mouseX <= guiLeft + 8 + 96 && + mouseY > top && mouseY <= top + 16) { + HexItem item = applicableItem.get(index); + + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + currentState = EnchantState.HAS_ITEM_IN_BOOKS; + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = + ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(item.slotIndex); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, + item.slotIndex, 0, 0, stack, transactionID + )); + + //cancelButtonAnimTime = System.currentTimeMillis(); + + return true; + } + } + } else if (currentState == EnchantState.ADDING_GEMSTONE || currentState == EnchantState.APPLYING_GEMSTONE) { + for (int i = 0; i < 7; i++) { + int index = i + leftScroll.getValue() / 16; + if (applicableItem.size() <= index) break; + + int top = guiTop - (leftScroll.getValue() % 16) + 18 + 16 * i; + if (mouseX > guiLeft + 8 && mouseX <= guiLeft + 8 + 96 && + mouseY > top && mouseY <= top + 16) { + HexItem item = applicableItem.get(index); + + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + if (currentState == EnchantState.ADDING_GEMSTONE) { + currentState = EnchantState.APPLYING_GEMSTONE; + enchanterCurrentItem = item; + } else if (currentState == EnchantState.APPLYING_GEMSTONE && enchanterCurrentItem == item) { + currentState = EnchantState.ADDING_GEMSTONE; + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = + ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(item.slotIndex); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, + item.slotIndex, 0, 0, stack, transactionID + )); + + cancelButtonAnimTime = System.currentTimeMillis(); + } else { + currentState = EnchantState.ADDING_GEMSTONE; + enchanterCurrentItem = null; + } + + //cancelButtonAnimTime = System.currentTimeMillis(); + + return true; + } + } + } else if (currentState == EnchantState.HAS_ITEM_IN_GEMSTONE) { + for (int i = 0; i < 7; i++) { + int index = i + leftScroll.getValue() / 16; + if (applicableItem.size() <= index) break; + + int top = guiTop - (leftScroll.getValue() % 16) + 18 + 16 * i; + if (mouseX > guiLeft + 8 && mouseX <= guiLeft + 8 + 96 && + mouseY > top && mouseY <= top + 16) { + HexItem item = applicableItem.get(index); + + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = + ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(item.slotIndex); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, + item.slotIndex, 0, 0, stack, transactionID + )); + + cancelButtonAnimTime = System.currentTimeMillis(); + + //cancelButtonAnimTime = System.currentTimeMillis(); + + return true; + } + } + } + } + + isScrollingLeft = true; + } else if (mouseX > guiLeft + 248 && mouseX < guiLeft + 248 + 96) { + if (Mouse.getEventButton() == 0 && Mouse.getEventButtonState() && + Minecraft.getMinecraft().thePlayer.inventory.getItemStack() == null) { + if (isInEnchanting()) { + for (int i = 0; i < 7; i++) { + int index = i + rightScroll.getValue() / 16; + if (removable.size() <= index) break; + + int top = guiTop - (rightScroll.getValue() % 16) + 18 + 16 * i; + if (mouseX > guiLeft + 248 && mouseX <= guiLeft + 248 + 96 && + mouseY > top && mouseY <= top + 16) { + Enchantment ench = removable.get(index); + + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + if (currentState == EnchantState.HAS_ITEM || currentState == EnchantState.HAS_ITEM_IN_HEX) { + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = + ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(ench.slotIndex); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, + ench.slotIndex, 0, 0, stack, transactionID + )); + } else if (currentState == EnchantState.ADDING_ENCHANT) { + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); + + cancelButtonAnimTime = System.currentTimeMillis(); + } + + return true; + } + } + } else if (currentState == EnchantState.ADDING_GEMSTONE) { + for (int i = 0; i < 7; i++) { + int index = i + rightScroll.getValue() / 16; + if (removableItem.size() <= index) break; + + int top = guiTop - (rightScroll.getValue() % 16) + 18 + 16 * i; + if (mouseX > guiLeft + 248 && mouseX <= guiLeft + 248 + 96 && + mouseY > top && mouseY <= top + 16) { + HexItem item = removableItem.get(index); + + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + if (currentState == EnchantState.ADDING_GEMSTONE) { + currentState = EnchantState.APPLYING_GEMSTONE; + enchanterCurrentItem = item; + } else if (currentState == EnchantState.APPLYING_GEMSTONE && enchanterCurrentItem == item) { + currentState = EnchantState.ADDING_GEMSTONE; + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = + ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(item.slotIndex); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, + item.slotIndex, 0, 0, stack, transactionID + )); + + cancelButtonAnimTime = System.currentTimeMillis(); + } else { + currentState = EnchantState.ADDING_GEMSTONE; + enchanterCurrentItem = null; + } + + return true; + } + } + + } else { + for (int i = 0; i < 7; i++) { + int index = i + rightScroll.getValue() / 16; + if (removableItem.size() <= index) break; + + int top = guiTop - (rightScroll.getValue() % 16) + 18 + 16 * i; + if (mouseX > guiLeft + 248 && mouseX <= guiLeft + 248 + 96 && + mouseY > top && mouseY <= top + 16) { + HexItem item = removableItem.get(index); + + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + if (currentState == EnchantState.HAS_ITEM_IN_BOOKS) { + currentState = EnchantState.ADDING_BOOK; + enchanterCurrentItem = item; + } else if (currentState == EnchantState.ADDING_BOOK && enchanterCurrentItem == item) { + currentState = EnchantState.HAS_ITEM_IN_BOOKS; + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = + ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(item.slotIndex); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, + item.slotIndex, 0, 0, stack, transactionID + )); + + cancelButtonAnimTime = System.currentTimeMillis(); + } else { + currentState = EnchantState.HAS_ITEM_IN_BOOKS; + enchanterCurrentItem = null; + } + + return true; + } + } + } + } + isScrollingLeft = false; + } + } + if (Mouse.getEventDWheel() != 0) { + int scroll = Mouse.getEventDWheel(); + if (scroll > 0) { + scroll = -16; + } else { + scroll = 16; + } + + LerpingInteger lerpingInteger = isScrollingLeft ? leftScroll : rightScroll; + int elementsCount; + if (isInEnchanting()) { + elementsCount = isScrollingLeft ? applicable.size() : removable.size(); + } else { + elementsCount = isScrollingLeft ? applicableItem.size() : removableItem.size(); + } + int max = (elementsCount - 6) * 16; + + int newTarget = lerpingInteger.getTarget() + scroll; + if (newTarget > max) newTarget = max; + if (newTarget < 0) newTarget = 0; + + if (newTarget != lerpingInteger.getTarget()) { + lerpingInteger.resetTimer(); + lerpingInteger.setTarget(newTarget); + } + } + + if (mouseX > guiLeft + 102 && mouseX < guiLeft + 102 + 160) { + if ((mouseY > guiTop + 133 && mouseY < guiTop + 133 + 54) || + (mouseY > guiTop + 133 + 54 + 4 && mouseY < guiTop + 133 + 54 + 4 + 18)) { + if (currentState == EnchantState.ADDING_ENCHANT) { + if (Mouse.getEventButtonState()) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); + + cancelButtonAnimTime = System.currentTimeMillis(); + } + return true; + } else { + return false; + } + } + } + if (mouseX >= guiLeft + 173 && mouseX < guiLeft + 173 + 18 && + mouseY >= guiTop + 57 && mouseY < guiTop + 57 + 18) { + if (currentState == EnchantState.ADDING_ENCHANT) { + if (Mouse.getEventButtonState()) { + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiContainer)) return true; + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + + EntityPlayerSP playerIn = Minecraft.getMinecraft().thePlayer; + short transactionID = playerIn.openContainer.getNextTransactionID(playerIn.inventory); + ItemStack stack = ((ContainerChest) chest.inventorySlots).getLowerChestInventory().getStackInSlot(45); + Minecraft.getMinecraft().getNetHandler().addToSendQueue(new C0EPacketClickWindow( + chest.inventorySlots.windowId, 45, 0, 0, stack, transactionID)); + + cancelButtonAnimTime = System.currentTimeMillis(); + } + return true; + } else { + return false; + } + } + return true; + } + + public boolean keyboardInput() { + if (currentState == EnchantState.HAS_ITEM && searchField.getFocus()) { + if (Keyboard.getEventKeyState()) { + searchField.keyTyped(Keyboard.getEventCharacter(), Keyboard.getEventKey()); + } + return true; + } + if (Keyboard.getEventKey() == Minecraft.getMinecraft().gameSettings.keyBindScreenshot.getKeyCode()) { + return false; + } + + return Keyboard.getEventKey() != Keyboard.KEY_ESCAPE && + Keyboard.getEventKey() != Minecraft.getMinecraft().gameSettings.keyBindInventory.getKeyCode() && + (!NotEnoughUpdates.INSTANCE.config.slotLocking.enableSlotLocking || + Keyboard.getEventKey() != NotEnoughUpdates.INSTANCE.config.slotLocking.slotLockKey); + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/HexItem.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/HexItem.java new file mode 100644 index 00000000..5b3b30ea --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/HexItem.java @@ -0,0 +1,264 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.miscgui.hex; + +import com.google.gson.JsonObject; +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.util.Constants; +import io.github.moulberry.notenoughupdates.util.Utils; +import net.minecraft.util.StringUtils; + +import java.util.List; + +public class HexItem { + public int slotIndex; + public String itemName; + public String itemId; + public List displayLore; + public int level; + public int price = -1; + public boolean overMaxLevel = false; + public boolean conflicts = false; + public ItemType itemType; + public int gemstoneLevel = -1; + + public HexItem( + int slotIndex, String itemName, String itemId, List displayLore, + boolean useMaxLevelForCost, boolean checkConflicts + ) { + this.slotIndex = slotIndex; + this.itemName = itemName; + this.itemId = itemId.replace("'S", ""); + this.displayLore = displayLore; + switch (itemId) { + default: + this.itemType = ItemType.UNKNOWN; + break; + case "HOT_POTATO_BOOK": + this.itemType = ItemType.HOT_POTATO; + break; + case "FUMING_POTATO_BOOK": + this.itemType = ItemType.FUMING_POTATO; + break; + case "BOOK_OF_STATS": + this.itemType = ItemType.BOOK_OF_STATS; + break; + case "THE_ART_OF_WAR": + this.itemType = ItemType.ART_OF_WAR; + break; + case "FARMING_FOR_DUMMIES": + this.itemType = ItemType.FARMING_DUMMY; + break; + case "THE_ART_OF_PEACE": + this.itemType = ItemType.ART_OF_PEACE; + break; + case "RECOMBOBULATOR_3000": + this.itemType = ItemType.RECOMB; + break; + case "SILEX": + this.itemId = "SIL_EX"; + this.itemType = ItemType.SILEX; + break; + case "RUBY_POWER_SCROLL": + this.itemType = ItemType.RUBY_SCROLL; + break; + case "SAPPHIRE_POWER_SCROLL": + this.itemType = ItemType.SAPPHIRE_SCROLL; + break; + case "JASPER_POWER_SCROLL": + this.itemType = ItemType.JASPER_SCROLL; + break; + case "AMETHYST_POWER_SCROLL": + this.itemType = ItemType.AMETHYST_SCROLL; + break; + case "AMBER_POWER_SCROLL": + this.itemType = ItemType.AMBER_SCROLL; + break; + case "OPAL_POWER_SCROLL": + this.itemType = ItemType.OPAL_SCROLL; + break; + case "FIRST_MASTER_STAR": + this.itemType = ItemType.FIRST_MASTER_STAR; + break; + case "SECOND_MASTER_STAR": + this.itemType = ItemType.SECOND_MASTER_STAR; + break; + case "THIRD_MASTER_STAR": + this.itemType = ItemType.THIRD_MASTER_STAR; + break; + case "FOURTH_MASTER_STAR": + this.itemType = ItemType.FOURTH_MASTER_STAR; + break; + case "FIFTH_MASTER_STAR": + this.itemType = ItemType.FIFTH_MASTER_STAR; + break; + case "WOOD_SINGULARITY": + this.itemType = ItemType.WOOD_SINGULARITY; + break; + case "IMPLOSION": + this.itemType = ItemType.IMPLOSION_SCROLL; + break; + case "WITHER_SHIELD": + this.itemType = ItemType.WITHER_SHIELD_SCROLL; + break; + case "SHADOW_WARP": + this.itemType = ItemType.SHADOW_WARP_SCROLL; + break; + case "TRANSMISSION_TUNER": + this.itemType = ItemType.TUNER; + break; + case "RANDOM_REFORGE": + this.itemType = ItemType.RANDOM_REFORGE; + break; + case "MANA_DISINTEGRATOR": + this.itemType = ItemType.MANA_DISINTEGRATOR; + break; + case "TOTAL_UPGRADES": + this.itemType = ItemType.TOTAL_UPGRADES; + break; + case "CONVERT_TO_DUNGEON": + this.itemType = ItemType.CONVERT_TO_DUNGEON; + break; + case "EXPERIENCE_BOTTLE": + this.itemType = ItemType.EXPERIENCE_BOTTLE; + break; + case "GRAND_EXPERIENCE_BOTTLE": + this.itemType = ItemType.GRAND_EXPERIENCE_BOTTLE; + break; + case "TITANIC_EXPERIENCE_BOTTLE": + this.itemType = ItemType.TITANIC_EXPERIENCE_BOTTLE; + break; + case "COLOSSAL_EXPERIENCE_BOTTLE": + this.itemType = ItemType.COLOSSAL_EXPERIENCE_BOTTLE; + break; + } + if (this.itemType == ItemType.UNKNOWN) { + for (String string : displayLore) { + if ((string.contains("Applies the") && string.contains("reforge")) || + string.contains("reforge when combined")) { + this.itemType = ItemType.REFORGE; + break; + } + } + } + if (!this.isMasterStar() && itemId.contains("✪")) { + if (itemId.contains("✪✪✪✪✪")) this.itemType = ItemType.FIFTH_STAR; + else if (itemId.contains("✪✪✪✪")) this.itemType = ItemType.FOURTH_STAR; + else if (itemId.contains("✪✪✪")) this.itemType = ItemType.THIRD_STAR; + else if (itemId.contains("✪✪")) this.itemType = ItemType.SECOND_STAR; + else if (itemId.contains("✪")) this.itemType = ItemType.FIRST_STAR; + } + if (this.itemId.contains("EXPERIENCE_BOTTLE")) { + this.itemId = this.itemId.replace("EXPERIENCE_BOTTLE", "EXP_BOTTLE"); + } + if (this.itemId.contains("END_STONE_GEODE")) { + this.itemId = this.itemId.replace("END_STONE_GEODE", "ENDSTONE_GEODE"); + } + if (itemId.contains("HEX_ITEM")) this.itemType = ItemType.HEX_ITEM; + JsonObject bazaarInfo = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(this.itemId); + if (bazaarInfo != null && bazaarInfo.get("curr_buy") != null) { + this.price = bazaarInfo.get("curr_buy").getAsInt(); + } + if ("SIL_EX".equals(this.itemId)) this.itemId = "SILEX"; + if (itemName.contains("Amethyst Gemstone")) this.itemType = ItemType.AMETHYST_GEMSTONE; + if (itemName.contains("Ruby Gemstone")) this.itemType = ItemType.RUBY_GEMSTONE; + if (itemName.contains("Sapphire Gemstone")) this.itemType = ItemType.SAPPHIRE_GEMSTONE; + if (itemName.contains("Jasper Gemstone")) this.itemType = ItemType.JASPER_GEMSTONE; + if (itemName.contains("Jade Gemstone")) this.itemType = ItemType.JADE_GEMSTONE; + if (itemName.contains("Amber Gemstone")) this.itemType = ItemType.AMBER_GEMSTONE; + if (itemName.contains("Opal Gemstone")) this.itemType = ItemType.OPAL_GEMSTONE; + if (itemName.contains("Topaz Gemstone")) this.itemType = ItemType.TOPAZ_GEMSTONE; + if (itemName.contains("Gemstone Slot")) this.itemType = ItemType.GEMSTONE_SLOT; + if (this.itemName.contains(" Gemstone")) { + this.itemName = this.itemName.replace(" Gemstone", "").substring(2); + } else if (this.itemName.contains(" Experience Bottle")) { + this.itemName = this.itemName.replace("Experience Bottle", ""); + } else if (this.itemName.equals("Experience Bottle")) { + this.itemName = "Exp Bottle"; + } + if (isGemstone()) { + if (this.itemName.contains("Rough")) this.gemstoneLevel = 0; + if (this.itemName.contains("Flawed")) this.gemstoneLevel = 1; + if (this.itemName.contains("Fine")) this.gemstoneLevel = 2; + if (this.itemName.contains("Flawless")) this.gemstoneLevel = 3; + if (this.itemName.contains("Perfect")) this.gemstoneLevel = 4; + } + } + + public boolean isPowerScroll() { + return itemType == ItemType.RUBY_SCROLL || itemType == ItemType.SAPPHIRE_SCROLL || + itemType == ItemType.JASPER_SCROLL || itemType == ItemType.AMETHYST_SCROLL || + itemType == ItemType.AMBER_SCROLL || itemType == ItemType.OPAL_SCROLL; + } + + public boolean isDungeonStar() { + return itemType == ItemType.FIRST_STAR || itemType == ItemType.SECOND_STAR || + itemType == ItemType.THIRD_STAR || itemType == ItemType.FOURTH_STAR || + itemType == ItemType.FIFTH_STAR; + } + + public boolean isMasterStar() { + return itemType == ItemType.FIRST_MASTER_STAR || itemType == ItemType.SECOND_MASTER_STAR || + itemType == ItemType.THIRD_MASTER_STAR || itemType == ItemType.FOURTH_MASTER_STAR || + itemType == ItemType.FIFTH_MASTER_STAR; + } + + public String getReforge() { + JsonObject reforgeStones = Constants.REFORGESTONES; + if (reforgeStones != null && reforgeStones.has(this.itemId.toUpperCase())) { + JsonObject reforgeInfo = reforgeStones.get(this.itemId.toUpperCase()).getAsJsonObject(); + if (reforgeInfo != null) { + return Utils.getElementAsString(reforgeInfo.get("reforgeName"), ""); + } + + } + return ""; + } + + public int getPrice() { + if (this.itemType == ItemType.RANDOM_REFORGE) { + for (String string : displayLore) { + if (string.contains("Coins")) { + try { + price = Integer.parseInt(StringUtils + .stripControlCodes(string) + .replace(" Coins", "") + .replace(",", "") + .trim()); + } catch (NumberFormatException ignored) { + } + } + } + } + return price; + } + + public boolean isHypeScroll() { + return itemType == ItemType.IMPLOSION_SCROLL || itemType == ItemType.WITHER_SHIELD_SCROLL || + itemType == ItemType.SHADOW_WARP_SCROLL; + } + + public boolean isGemstone() { + return itemType == ItemType.RUBY_GEMSTONE || itemType == ItemType.AMETHYST_GEMSTONE || + itemType == ItemType.SAPPHIRE_GEMSTONE || itemType == ItemType.JASPER_GEMSTONE || + itemType == ItemType.JADE_GEMSTONE || itemType == ItemType.AMBER_GEMSTONE || + itemType == ItemType.OPAL_GEMSTONE || itemType == ItemType.TOPAZ_GEMSTONE; + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/ItemType.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/ItemType.java new file mode 100644 index 00000000..3b47a86d --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/ItemType.java @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.miscgui.hex; + +enum ItemType { + HOT_POTATO, + FUMING_POTATO, + BOOK_OF_STATS, + ART_OF_WAR, + ART_OF_PEACE, + FARMING_DUMMY, + RECOMB, + SILEX, + RUBY_SCROLL, + SAPPHIRE_SCROLL, + JASPER_SCROLL, + AMETHYST_SCROLL, + AMBER_SCROLL, + OPAL_SCROLL, + FIRST_STAR(1), + SECOND_STAR(2), + THIRD_STAR(3), + FOURTH_STAR(4), + FIFTH_STAR(5), + FIRST_MASTER_STAR(6), + SECOND_MASTER_STAR(7), + THIRD_MASTER_STAR(8), + FOURTH_MASTER_STAR(9), + FIFTH_MASTER_STAR(10), + WOOD_SINGULARITY, + IMPLOSION_SCROLL, + SHADOW_WARP_SCROLL, + WITHER_SHIELD_SCROLL, + TUNER, + REFORGE, + RANDOM_REFORGE, + MANA_DISINTEGRATOR, + HEX_ITEM, + TOTAL_UPGRADES, + RUBY_GEMSTONE, + AMETHYST_GEMSTONE, + SAPPHIRE_GEMSTONE, + JASPER_GEMSTONE, + JADE_GEMSTONE, + AMBER_GEMSTONE, + OPAL_GEMSTONE, + TOPAZ_GEMSTONE, + CONVERT_TO_DUNGEON, + GEMSTONE_SLOT, + EXPERIENCE_BOTTLE, + GRAND_EXPERIENCE_BOTTLE, + TITANIC_EXPERIENCE_BOTTLE, + COLOSSAL_EXPERIENCE_BOTTLE, + UNKNOWN; + + private int starLevel = -1; + + ItemType() {} + + ItemType(int starLevel) { + this.starLevel = starLevel; + } + + public int getStarLevel() { + return starLevel; + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/util/ExperienceOrb.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/util/ExperienceOrb.java new file mode 100644 index 00000000..9da4f553 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/util/ExperienceOrb.java @@ -0,0 +1,32 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.miscgui.util; + +import org.lwjgl.util.vector.Vector2f; + +public class ExperienceOrb { + public Vector2f position; + public Vector2f positionLast; + public Vector2f velocity; + public Vector2f target; + + public int type; + public int rotationDeg; +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/util/OrbDisplay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/util/OrbDisplay.java new file mode 100644 index 00000000..42e935f5 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/util/OrbDisplay.java @@ -0,0 +1,142 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.miscgui.util; + +import io.github.moulberry.notenoughupdates.core.util.lerp.LerpUtils; +import io.github.moulberry.notenoughupdates.util.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.util.ResourceLocation; +import org.lwjgl.opengl.GL11; +import org.lwjgl.util.vector.Vector2f; + +import java.util.ArrayList; +import java.util.List; +import java.util.ListIterator; +import java.util.Random; + +public class OrbDisplay { + private static final ResourceLocation TEXTURE = new ResourceLocation("notenoughupdates:custom_enchant_gui.png"); + private static final int DEFAULT_COUNT = 30; + + private final List experienceOrbList = new ArrayList<>(); + + public ExperienceOrb spawnExperienceOrb(Random random, Vector2f start, Vector2f target, int baseType) { + ExperienceOrb orb = new ExperienceOrb(); + orb.position = new Vector2f(start); + orb.positionLast = new Vector2f(orb.position); + orb.velocity = new Vector2f( + random.nextFloat() * 20 - 10, + random.nextFloat() * 20 - 10 + ); + orb.target = new Vector2f(target); + orb.type = baseType; + orb.rotationDeg = random.nextInt(4) * 90; + + float v = random.nextFloat(); + if (v > 0.6) { + orb.type += 1; + } + if (v > 0.9) { + orb.type += 1; + } + + experienceOrbList.add(orb); + + return orb; + } + + public void spawnExperienceOrbs(int startX, int startY, int targetX, int targetY, int baseType) { + spawnExperienceOrbs(new Random(),new Vector2f(startX, startY), new Vector2f(targetX, targetY), baseType, DEFAULT_COUNT); + } + + public void spawnExperienceOrbs(Random random, Vector2f start, Vector2f target, int baseType, int count) { + for (int i = 0; i < count; i++) { + spawnExperienceOrb(random, start, target, baseType); + } + } + + public void physicsTickOrbs() { + for (ListIterator it = experienceOrbList.listIterator(); it.hasNext(); ) { + ExperienceOrb orb = it.next(); + + Vector2f delta = Vector2f.sub(orb.target, orb.position, null); + float length = delta.length(); + + // Remove close Orbs + if (length < 8 && orb.velocity.lengthSquared() < 20) { + it.remove(); + continue; + } + + // Update velocity + Vector2f.add(orb.velocity, (Vector2f) delta.scale(2 / length), orb.velocity); + orb.velocity.scale(0.9F); + + // Update position + orb.positionLast.set(orb.position); + Vector2f.add(orb.position, orb.velocity, orb.position); + } + } + + public void renderOrbs(float partialTicks) { + Minecraft.getMinecraft().getTextureManager().bindTexture(TEXTURE); + GlStateManager.disableDepth(); + + for (ExperienceOrb orb : experienceOrbList) { + int orbX = Math.round(LerpUtils.lerp(orb.position.x, orb.positionLast.x, partialTicks)); + int orbY = Math.round(LerpUtils.lerp(orb.position.y, orb.positionLast.y, partialTicks)); + + GlStateManager.pushMatrix(); + + GlStateManager.translate(orbX, orbY, 0); + GlStateManager.rotate(orb.rotationDeg, 0, 0, 1); + + Vector2f delta = Vector2f.sub(orb.position, orb.target, null); + + float length = delta.length(); + float velocitySquared = orb.velocity.lengthSquared(); + float opacity = (float) Math.sqrt( + Math.min( + 1, + Math.min(2, Math.max(0.5F, length / 16)) + * Math.min(2, Math.max(0.5F, velocitySquared / 40)) + )); + GlStateManager.color(1, 1, 1, opacity); + + int orbU = (orb.type % 3) * 16; + int orbV = (orb.type / 3) * 16 + 217; + + Utils.drawTexturedRect( + -8, -8, 16, 16, + orbU / 512f, + (orbU + 16) / 512f, + orbV / 512f, + (orbV + 16) / 512f, + GL11.GL_NEAREST + ); + + GlStateManager.popMatrix(); + } + + GlStateManager.enableDepth(); + } + +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java index be36d0b4..7d17aa3e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java @@ -30,6 +30,7 @@ import io.github.moulberry.notenoughupdates.miscfeatures.EnchantingSolvers; import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking; import io.github.moulberry.notenoughupdates.miscgui.GuiCustomEnchant; +import io.github.moulberry.notenoughupdates.miscgui.hex.GuiCustomHex; import io.github.moulberry.notenoughupdates.miscgui.StorageOverlay; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; @@ -189,6 +190,7 @@ public abstract class MixinGuiContainer extends GuiScreen { public void isMouseOverSlot(Slot slotIn, int mouseX, int mouseY, CallbackInfoReturnable cir) { StorageOverlay.getInstance().overrideIsMouseOverSlot(slotIn, mouseX, mouseY, cir); GuiCustomEnchant.getInstance().overrideIsMouseOverSlot(slotIn, mouseX, mouseY, cir); + GuiCustomHex.getInstance().overrideIsMouseOverSlot(slotIn, mouseX, mouseY, cir); AuctionBINWarning.getInstance().overrideIsMouseOverSlot(slotIn, mouseX, mouseY, cir); AbiphoneWarning.getInstance().overrideIsMouseOverSlot(slotIn, mouseX, mouseY, cir); } -- cgit From 1aab0b30aaa7bf164e3ef84254c01519470dbd65 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 13 Sep 2022 18:58:42 +1000 Subject: Fixed experiment table timer in todo overlay (#267) --- .../github/moulberry/notenoughupdates/overlays/TimersOverlay.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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 86df47ff..4d82ebaf 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java @@ -660,7 +660,7 @@ public class TimersOverlay extends TextTabOverlay { 6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.verySoonColour] + - Utils.prettyTime(catacombsReset) + Utils.prettyTime(catacombsReset + 86400000 - currentTime) ); } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.experimentationDisplay >= DISPLAYTYPE.SOON.ordinal() && (hidden.experimentsCompleted < (midnightReset - TimeEnums.HOUR.time))) { @@ -668,7 +668,7 @@ public class TimersOverlay extends TextTabOverlay { 6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.soonColour] + - Utils.prettyTime(catacombsReset) + Utils.prettyTime(catacombsReset + 86400000 - currentTime) ); } else if ( NotEnoughUpdates.INSTANCE.config.miscOverlays.experimentationDisplay >= DISPLAYTYPE.KINDASOON.ordinal() && @@ -677,14 +677,14 @@ public class TimersOverlay extends TextTabOverlay { 6, DARK_AQUA + "Experiments: " + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.kindaSoonColour] + - Utils.prettyTime(catacombsReset) + Utils.prettyTime(catacombsReset + 86400000 - currentTime) ); } 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(catacombsReset) + Utils.prettyTime(catacombsReset + 86400000 - currentTime) ); } -- cgit From 4e04e197cf03a32518661c8142edbee35a6f67a6 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Wed, 14 Sep 2022 11:56:16 +0200 Subject: Fixed collection displaynames (#280) --- .../profileviewer/ProfileViewer.java | 28 +++++++++++----------- 1 file changed, 14 insertions(+), 14 deletions(-) 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 b6e56743..c9bd92a3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java @@ -282,10 +282,10 @@ public class ProfileViewer { put("SUGAR_CANE", Utils.createItemStack(Items.reeds, EnumChatFormatting.YELLOW + "Sugar Cane")); put("FEATHER", Utils.createItemStack(Items.feather, EnumChatFormatting.YELLOW + "Feather")); put("LEATHER", Utils.createItemStack(Items.leather, EnumChatFormatting.YELLOW + "Leather")); - put("PORK", Utils.createItemStack(Items.porkchop, EnumChatFormatting.YELLOW + "Porkchop")); - put("RAW_CHICKEN", Utils.createItemStack(Items.chicken, EnumChatFormatting.YELLOW + "Chicken")); + put("PORK", Utils.createItemStack(Items.porkchop, EnumChatFormatting.YELLOW + "Raw Porkchop")); + put("RAW_CHICKEN", Utils.createItemStack(Items.chicken, EnumChatFormatting.YELLOW + "Raw Chicken")); put("MUTTON", Utils.createItemStack(Items.mutton, EnumChatFormatting.YELLOW + "Mutton")); - put("RABBIT", Utils.createItemStack(Items.rabbit, EnumChatFormatting.YELLOW + "Rabbit")); + put("RABBIT", Utils.createItemStack(Items.rabbit, EnumChatFormatting.YELLOW + "Raw Rabbit")); put("NETHER_STALK", Utils.createItemStack(Items.nether_wart, EnumChatFormatting.YELLOW + "Nether Wart")); /* MINING COLLECTIONS */ @@ -299,7 +299,7 @@ public class ProfileViewer { put("REDSTONE", Utils.createItemStack(Items.redstone, EnumChatFormatting.GRAY + "Redstone")); put("QUARTZ", Utils.createItemStack(Items.quartz, EnumChatFormatting.GRAY + "Nether Quartz")); put("OBSIDIAN", Utils.createItemStack(Item.getItemFromBlock(Blocks.obsidian), EnumChatFormatting.GRAY + "Obsidian")); - put("GLOWSTONE_DUST", Utils.createItemStack(Items.glowstone_dust, EnumChatFormatting.GRAY + "Glowstone")); + put("GLOWSTONE_DUST", Utils.createItemStack(Items.glowstone_dust, EnumChatFormatting.GRAY + "Glowstone Dust")); put("GRAVEL", Utils.createItemStack(Item.getItemFromBlock(Blocks.gravel), EnumChatFormatting.GRAY + "Gravel")); put("ICE", Utils.createItemStack(Item.getItemFromBlock(Blocks.ice), EnumChatFormatting.GRAY + "Ice")); put("NETHERRACK", Utils.createItemStack(Item.getItemFromBlock(Blocks.netherrack), EnumChatFormatting.GRAY + "Netherrack")); @@ -340,23 +340,23 @@ public class ProfileViewer { ); /* FORAGING COLLECTIONS */ - put("LOG", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Oak")); - put("LOG:1", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Spruce", 1)); - put("LOG:2", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Birch", 2)); - put("LOG_2:1", Utils.createItemStack(Item.getItemFromBlock(Blocks.log2), EnumChatFormatting.DARK_GREEN + "Dark Oak", 1)); - put("LOG_2", Utils.createItemStack(Item.getItemFromBlock(Blocks.log2), EnumChatFormatting.DARK_GREEN + "Acacia")); - put("LOG:3", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Jungle", 3)); + put("LOG", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Oak Wood")); + put("LOG:1", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Spruce Wood", 1)); + put("LOG:2", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Birch Wood", 2)); + put("LOG_2:1", Utils.createItemStack(Item.getItemFromBlock(Blocks.log2), EnumChatFormatting.DARK_GREEN + "Dark Oak Wood", 1)); + put("LOG_2", Utils.createItemStack(Item.getItemFromBlock(Blocks.log2), EnumChatFormatting.DARK_GREEN + "Acacia Wood")); + put("LOG:3", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Jungle Wood", 3)); /* FISHING COLLECTIONS */ - put("RAW_FISH", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Fish")); - put("RAW_FISH:1", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Salmon", 1)); + put("RAW_FISH", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Raw Fish")); + put("RAW_FISH:1", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Raw Salmon", 1)); put("RAW_FISH:2", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Clownfish", 2)); put("RAW_FISH:3", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Pufferfish", 3)); put("PRISMARINE_SHARD", Utils.createItemStack(Items.prismarine_shard, EnumChatFormatting.AQUA + "Prismarine Shard")); put("PRISMARINE_CRYSTALS", Utils.createItemStack(Items.prismarine_crystals, EnumChatFormatting.AQUA + "Prismarine Crystals")); put("CLAY_BALL", Utils.createItemStack(Items.clay_ball, EnumChatFormatting.AQUA + "Clay")); - put("WATER_LILY", Utils.createItemStack(Item.getItemFromBlock(Blocks.waterlily), EnumChatFormatting.AQUA + "Lilypad")); - put("INK_SACK", Utils.createItemStack(Items.dye, EnumChatFormatting.AQUA + "Ink Sack")); + put("WATER_LILY", Utils.createItemStack(Item.getItemFromBlock(Blocks.waterlily), EnumChatFormatting.AQUA + "Lily Pad")); + put("INK_SACK", Utils.createItemStack(Items.dye, EnumChatFormatting.AQUA + "Ink Sac")); put("SPONGE", Utils.createItemStack(Item.getItemFromBlock(Blocks.sponge), EnumChatFormatting.AQUA + "Sponge")); put( "MAGMA_FISH", -- cgit From 5e1cfdc20fa2d07f9448d0c0eee54cce9f1878f6 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:29:29 +1000 Subject: Fixed expanded pet xp just running twice? (#270) --- .../listener/ItemTooltipListener.java | 70 ---------------------- 1 file changed, 70 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java index d4e0becd..1cd71eb6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java @@ -689,18 +689,6 @@ public class ItemTooltipListener { index++; } - for (int i = newTooltip.size() - 1; i >= 0; i--) { - String line = Utils.cleanColour(newTooltip.get(i)); - for (int i1 = 0; i1 < Utils.rarityArr.length; i1++) { - if (line.equals(Utils.rarityArr[i1])) { - if (i - 2 < 0) { - break; - } - newTooltip.addAll(i - 1, petToolTipXPExtend(event)); - break; - } - } - } pressedShiftLast = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); pressedArrowLast = Keyboard.isKeyDown(Keyboard.KEY_LEFT) || Keyboard.isKeyDown(Keyboard.KEY_RIGHT); @@ -718,64 +706,6 @@ public class ItemTooltipListener { } } - private List petToolTipXPExtend(ItemTooltipEvent event) { - List tooltipText = new ArrayList<>(); - if (NotEnoughUpdates.INSTANCE.config.tooltipTweaks.petExtendExp) { - if (event.itemStack.getTagCompound().hasKey("DisablePetExp")) { - if (event.itemStack.getTagCompound().getBoolean("DisablePetExp")) { - return tooltipText; - } - } - //7 is just a random number i chose, prob no pets with less lines than 7 - if (event.toolTip.size() > 7) { - if (Utils.cleanColour(event.toolTip.get(1)).matches(petToolTipRegex)) { - - GuiProfileViewer.PetLevel petlevel = null; - - //this is the item itself - NBTTagCompound tag = event.itemStack.getTagCompound(); - if (tag.hasKey("ExtraAttributes")) { - if (tag.getCompoundTag("ExtraAttributes").hasKey("petInfo")) { - JsonObject petInfo = NotEnoughUpdates.INSTANCE.manager.gson.fromJson(tag - .getCompoundTag("ExtraAttributes") - .getString("petInfo"), JsonObject.class); - if (petInfo.has("exp") && petInfo.get("exp").isJsonPrimitive()) { - JsonPrimitive exp = petInfo.getAsJsonPrimitive("exp"); - String petName = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(event.itemStack); - //Utils.getRarityFromInt(Utils.checkItemTypePet(event.toolTip))).getAsInt(); - petlevel = GuiProfileViewer.getPetLevel( - petName, - Utils.getRarityFromInt(Utils.checkItemTypePet(event.toolTip)), - exp.getAsLong() - ); - } - } - } - - if (petlevel != null) { - tooltipText.add(""); - if (petlevel.totalXp > petlevel.maxXP) { - tooltipText.add(EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "MAX LEVEL"); - } else { - tooltipText.add( - EnumChatFormatting.GRAY + "Progress to Level " + (int) Math.floor(petlevel.level + 1) + ": " + - EnumChatFormatting.YELLOW + Utils.round(petlevel.levelPercentage * 100, 1) + "%"); - int levelpercentage = Math.round(petlevel.levelPercentage * 20); - tooltipText.add( - EnumChatFormatting.DARK_GREEN + String.join("", Collections.nCopies(levelpercentage, "-")) + - EnumChatFormatting.WHITE + String.join("", Collections.nCopies(20 - levelpercentage, "-"))); - tooltipText.add( - EnumChatFormatting.GRAY + "EXP: " + EnumChatFormatting.YELLOW + myFormatter.format(petlevel.levelXp) + - EnumChatFormatting.GOLD + "/" + EnumChatFormatting.YELLOW + - myFormatter.format(petlevel.currentLevelRequirement) + " EXP"); - } - } - } - } - } - return tooltipText; - } - private void petToolTipXPExtendPetMenu(ItemTooltipEvent event) { if (NotEnoughUpdates.INSTANCE.config.tooltipTweaks.petExtendExp) { //7 is just a random number i chose, prob no pets with less lines than 7 -- cgit From 18255a0e473092d0f389507a19944a7ddfc8078d Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:30:25 +1000 Subject: Added chat message to let players turn on the storage gui if they accidentally turned it off (#273) * Added a chat message to turn the storage gui back on after turning it off in said storage gui * remove the skyclient mixin * map on by default --- .../notenoughupdates/commands/Commands.java | 2 ++ .../commands/dev/EnableStorageCommand.java | 39 ++++++++++++++++++++++ .../notenoughupdates/miscgui/StorageOverlay.java | 14 ++++++++ .../mixins/MixinSkyclientCosmetics.java | 39 ---------------------- .../options/seperateSections/DungeonMapConfig.java | 2 +- src/main/resources/mixins.notenoughupdates.json | 1 - 6 files changed, 56 insertions(+), 41 deletions(-) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/commands/dev/EnableStorageCommand.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinSkyclientCosmetics.java 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 fcb2aaf9..62981a30 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/Commands.java @@ -23,6 +23,7 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.commands.dev.DevTestCommand; import io.github.moulberry.notenoughupdates.commands.dev.DiagCommand; import io.github.moulberry.notenoughupdates.commands.dev.DungeonWinTestCommand; +import io.github.moulberry.notenoughupdates.commands.dev.EnableStorageCommand; import io.github.moulberry.notenoughupdates.commands.dev.NullzeeSphereCommand; import io.github.moulberry.notenoughupdates.commands.dev.PackDevCommand; import io.github.moulberry.notenoughupdates.commands.dev.ReloadRepoCommand; @@ -74,6 +75,7 @@ public class Commands { ClientCommandHandler.instance.registerCommand(new DiagCommand()); ClientCommandHandler.instance.registerCommand(new ReloadRepoCommand()); ClientCommandHandler.instance.registerCommand(new ResetRepoCommand()); + ClientCommandHandler.instance.registerCommand(new EnableStorageCommand()); // Profile Commands ClientCommandHandler.instance.registerCommand(new PeekCommand()); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/EnableStorageCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/EnableStorageCommand.java new file mode 100644 index 00000000..3415b030 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/EnableStorageCommand.java @@ -0,0 +1,39 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.commands.dev; + +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.commands.ClientCommandBase; +import net.minecraft.command.CommandException; +import net.minecraft.command.ICommandSender; + +public class EnableStorageCommand extends ClientCommandBase { + + public EnableStorageCommand() { + super("neuenablestorage"); + } + + @Override + public void processCommand(ICommandSender sender, String[] args) throws CommandException { + NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI3 = true; + NotEnoughUpdates.INSTANCE.saveConfig(); + } + +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java index 27fea377..8878c284 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/StorageOverlay.java @@ -45,13 +45,17 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.OpenGlHelper; import net.minecraft.client.renderer.entity.RenderItem; import net.minecraft.client.shader.Framebuffer; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.inventory.ContainerChest; import net.minecraft.inventory.Slot; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.ClientCommandHandler; import org.lwjgl.input.Keyboard; @@ -1966,6 +1970,16 @@ public class StorageOverlay extends GuiElement { switch (buttonIndex) { case 0: NotEnoughUpdates.INSTANCE.config.storageGUI.enableStorageGUI3 = false; + ChatComponentText storageMessage = new ChatComponentText( + EnumChatFormatting.YELLOW + "[NEU] " + EnumChatFormatting.YELLOW + + "You just disabled the custom storage gui, did you mean to do that? If not click this message to turn it back on."); + storageMessage.setChatStyle(Utils.createClickStyle(ClickEvent.Action.RUN_COMMAND, "/neuenablestorage")); + storageMessage.setChatStyle(storageMessage.getChatStyle().setChatHoverEvent( + new HoverEvent(HoverEvent.Action.SHOW_TEXT, + new ChatComponentText(EnumChatFormatting.YELLOW + "Click to enable the custom storage gui.")))); + ChatComponentText storageChatMessage = new ChatComponentText(""); + storageChatMessage.appendSibling(storageMessage); + Minecraft.getMinecraft().thePlayer.addChatMessage(storageChatMessage); break; case 1: int size = diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinSkyclientCosmetics.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinSkyclientCosmetics.java deleted file mode 100644 index 32c9f418..00000000 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinSkyclientCosmetics.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (C) 2022 NotEnoughUpdates contributors - * - * This file is part of NotEnoughUpdates. - * - * NotEnoughUpdates is free software: you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - * - * NotEnoughUpdates is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with NotEnoughUpdates. If not, see . - */ - -package io.github.moulberry.notenoughupdates.mixins; - -import net.minecraftforge.event.world.WorldEvent; -import org.spongepowered.asm.mixin.Dynamic; -import org.spongepowered.asm.mixin.Mixin; -import org.spongepowered.asm.mixin.Pseudo; -import org.spongepowered.asm.mixin.injection.At; -import org.spongepowered.asm.mixin.injection.Inject; -import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; - -@Pseudo -@Mixin(targets = "co.skyclient.scc.SkyclientCosmetics") -public class MixinSkyclientCosmetics { - - @Dynamic - @Inject(method = "onWorldLoad", at = @At("HEAD"), cancellable = true, remap = false) - public void onWorldLoad(WorldEvent.Load event, CallbackInfo ci) { - ci.cancel(); - } -} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java index 4397c02e..8e211bd6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java @@ -73,7 +73,7 @@ public class DungeonMapConfig { name = "Show Dungeon Map", desc = "Show/hide the NEU dungeon map" ) - public boolean dmEnable = false; + public boolean dmEnable = true; @Expose @ConfigOption( diff --git a/src/main/resources/mixins.notenoughupdates.json b/src/main/resources/mixins.notenoughupdates.json index 0a547b4b..ed1ba55a 100644 --- a/src/main/resources/mixins.notenoughupdates.json +++ b/src/main/resources/mixins.notenoughupdates.json @@ -40,7 +40,6 @@ "MixinRenderGlobal", "MixinRenderItem", "MixinRenderList", - "MixinSkyclientCosmetics", "MixinTextureManager", "MixinTileEntitySkullRenderer", "MixinTileEntitySpecialRenderer", -- cgit From c0eee7a5df9239a361d5e6363a172abe32fd0e84 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:31:02 +1000 Subject: added a setting to toggle hex separate from /et (#275) --- .../notenoughupdates/listener/ItemTooltipListener.java | 6 +----- .../moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java | 4 ++-- .../notenoughupdates/options/seperateSections/Enchanting.java | 11 ++++++++++- 3 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java index 1cd71eb6..5d6a2bdc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java @@ -836,15 +836,11 @@ public class ItemTooltipListener { boolean m = Keyboard.isKeyDown(Keyboard.KEY_M); boolean n = Keyboard.isKeyDown(Keyboard.KEY_N); boolean f = Keyboard.isKeyDown(Keyboard.KEY_F); - boolean l = Keyboard.isKeyDown(Keyboard.KEY_L); if (!copied && f && NotEnoughUpdates.INSTANCE.config.hidden.dev) { MiscUtils.copyToClipboard(NotEnoughUpdates.INSTANCE.manager.getSkullValueForItem(event.itemStack)); } - if (!copied && l) { - NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI = !NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI; - } event.toolTip.add( EnumChatFormatting.AQUA + "Internal Name: " + EnumChatFormatting.GRAY + internal + EnumChatFormatting.GOLD + @@ -883,7 +879,7 @@ public class ItemTooltipListener { } } - copied = k || m || n || f || l; + copied = k || m || n || f; } } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java index 39374f9d..c59a7003 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java @@ -243,7 +243,7 @@ public class GuiCustomHex extends Gui { searchField.setText(""); return false; } - boolean config = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI; + boolean config = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableHexGUI; final List gemList = new ArrayList<>(Arrays.asList( "\u2764", "\u2748", @@ -4334,7 +4334,7 @@ public class GuiCustomHex extends Gui { switch (index) { case 0: { - NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableTableGUI = false; + NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableHexGUI = false; break; } case 2: { 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 2f3ffa36..306629f7 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 @@ -28,7 +28,7 @@ import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigOption public class Enchanting { @ConfigOption( - name = "Enchant Table GUI", + name = "Enchant Table / Hex GUI", desc = "" ) @ConfigEditorAccordion(id = 1) @@ -43,6 +43,15 @@ public class Enchanting { @ConfigAccordionId(id = 1) public boolean enableTableGUI = true; + @Expose + @ConfigOption( + name = "Enable Hex GUI", + desc = "Show a custom GUI when using the Hex" + ) + @ConfigEditorBoolean + @ConfigAccordionId(id = 1) + public boolean enableHexGUI = true; + /*@Expose @ConfigOption( name = "Incompatible Enchants", -- cgit From 12fdc80608962c0ae70e0deb246076c1d40f7d8a Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:31:40 +1000 Subject: fix 9 and b getting overridden (#276) --- .../listener/ItemTooltipListener.java | 32 ++++++++++++---------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java index 5d6a2bdc..c522e70a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java @@ -382,6 +382,7 @@ public class ItemTooltipListener { } } if (hasEnchantments || hasAttributes) { + ArrayList addedEnchants = new ArrayList<>(); for (String op : NotEnoughUpdates.INSTANCE.config.hidden.enchantColours) { List colourOps = GuiEnchantColour.splitter.splitToList(op); String enchantName = GuiEnchantColour.getColourOpIndex(colourOps, 0); @@ -475,20 +476,22 @@ public class ItemTooltipListener { String extraMods = extraModifiersBuilder.toString(); if (!colourCode.equals("z")) { - line = line.replace("\u00A79" + enchantText, "\u00A7" + colourCode + extraMods + enchantText); - line = line.replace("\u00A7b" + enchantText, "\u00A7" + colourCode + extraMods + enchantText); - line = line.replace( - "\u00A79\u00A7d\u00A7l" + enchantText, - "\u00A7" + colourCode + extraMods + enchantText - ); - line = line.replace( - "\u00A7b\u00A7d\u00A7l" + enchantText, - "\u00A7" + colourCode + extraMods + enchantText - ); - line = line.replace( - "\u00A7l\u00A7d\u00A7l" + enchantText, - "\u00A7" + colourCode + extraMods + enchantText - ); + if (!addedEnchants.contains(enchantText)) { + line = line.replace("\u00A79" + enchantText, "\u00A7" + colourCode + extraMods + enchantText); + line = line.replace("\u00A7b" + enchantText, "\u00A7" + colourCode + extraMods + enchantText); + line = line.replace( + "\u00A79\u00A7d\u00A7l" + enchantText, + "\u00A7" + colourCode + extraMods + enchantText + ); + line = line.replace( + "\u00A7b\u00A7d\u00A7l" + enchantText, + "\u00A7" + colourCode + extraMods + enchantText + ); + line = line.replace( + "\u00A7l\u00A7d\u00A7l" + enchantText, + "\u00A7" + colourCode + extraMods + enchantText + ); + } } else { int offset = Minecraft.getMinecraft().fontRendererObj.getStringWidth(line.replaceAll( "\\u00A79" + enchantText + ".*", @@ -516,6 +519,7 @@ public class ItemTooltipListener { Utils.chromaString(enchantText, offset / 12f + index, true) ); } + addedEnchants.add(enchantText); } } } -- cgit From 989b633329f00d9dd0b02e2ffc4ccf2a5d18bd30 Mon Sep 17 00:00:00 2001 From: Lulonaut <67191924+Lulonaut@users.noreply.github.com> Date: Wed, 14 Sep 2022 14:33:04 +0200 Subject: Fix tab overlay rendering in some guis (#278) * Don't render overlays when pressing tab in some guis * Made it only show if no gui screen is open Co-authored-by: nopo --- .../notenoughupdates/overlays/TextTabOverlay.java | 25 ++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java index 69a0cd00..8073062c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java @@ -36,12 +36,29 @@ public abstract class TextTabOverlay extends TextOverlay { } private boolean lastTabState = false; + private boolean shouldUpdateOverlay = true; - public void realTick() { - boolean currentTabState = Keyboard.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode()); - if (lastTabState != currentTabState) { - lastTabState = currentTabState; + @Override + public void tick() { + if (shouldUpdateOverlay) { update(); } } + + public void realTick() { + shouldUpdateOverlay = shouldUpdate(); + if (shouldUpdateOverlay) { + boolean currentTabState = + Keyboard.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode()); + if (lastTabState != currentTabState) { + lastTabState = currentTabState; + update(); + } + } + } + + private boolean shouldUpdate() { + //prevent rendering unless no gui is open + return Minecraft.getMinecraft().currentScreen == null; + } } -- cgit From 66560fdfedb95dcceed64c5d093d4b3703059616 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 14 Sep 2022 22:36:46 +1000 Subject: show quiver even when inventory api is disabled (it shows selected arrow) (#277) --- .../profileviewer/InventoriesPage.java | 48 ++++++++++++---------- 1 file changed, 26 insertions(+), 22 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java index c98792ee..b4f1da30 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/InventoriesPage.java @@ -240,28 +240,6 @@ public class InventoriesPage extends GuiProfileViewerPage { if (currentInventoryIndex < 0) currentInventoryIndex = 0; ItemStack[][] inventory = inventories[currentInventoryIndex]; - if (inventory == null) { - if (selectedInventory.equalsIgnoreCase("personal_vault_contents")) { - Utils.drawStringCentered( - EnumChatFormatting.RED + "Personal Vault API not enabled!", - Minecraft.getMinecraft().fontRendererObj, - guiLeft + 317, - guiTop + 101, - true, - 0 - ); - } else { - Utils.drawStringCentered( - EnumChatFormatting.RED + "Inventory API not enabled!", - Minecraft.getMinecraft().fontRendererObj, - guiLeft + 317, - guiTop + 101, - true, - 0 - ); - } - return; - } if (bestWeapons == null) { bestWeapons = @@ -363,6 +341,32 @@ public class InventoriesPage extends GuiProfileViewerPage { } } + if (inventory == null) { + String strToRender = "Inventory API not enabled!"; + if (selectedInventory.equalsIgnoreCase("personal_vault_contents")) { + strToRender = "Personal Vault API not enabled!"; + } else if (selectedInventory.equalsIgnoreCase("backpack_contents")) { + strToRender = "Inventory API not enabled"; + Utils.drawStringCentered( + EnumChatFormatting.RED + "Or has no backpacks!", + Minecraft.getMinecraft().fontRendererObj, + guiLeft + 317, + guiTop + 112, + true, + 0 + ); + } + Utils.drawStringCentered( + EnumChatFormatting.RED + strToRender, + Minecraft.getMinecraft().fontRendererObj, + guiLeft + 317, + guiTop + 101, + true, + 0 + ); + return; + } + int inventoryRows = inventory.length; GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F); -- cgit From 2d8c295a9280337bace055fd2cedae8af17995ee Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Wed, 14 Sep 2022 07:38:35 -0500 Subject: Add Blaze to /peek (#279) * Add Blaze to /peek Add blaze slayer to /peek Add Carpentry to skill average in /peek Fix color of - in peek Add my IGN to DEV_TESTERS in DevTestCommand and actually commit it so I can stop manually re-adding myself to that list * Update 2.1.md Added changes to changelog * Update 2.1.md Changed formatting for readability --- Update Notes/2.1.md | 4 +++- .../notenoughupdates/commands/dev/DevTestCommand.java | 3 ++- .../notenoughupdates/commands/profile/PeekCommand.java | 15 ++++++++++++--- 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index 50e2d0e4..e6b2b472 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -7,7 +7,7 @@ - Added combat skill overlay - nopo - Added slayer overlay - nopo - Added blocking clicks back to the enchanting minigames (because apparently, it's not bannable?) -- [Donpireso replied to a sba dev's email about some of sba features, and it seems to imply that blocking clicks in guis aren't bannable](https://cdn.discordapp.com/attachments/823769568933576764/906101631861526559/unknown.png) + - [Donpireso replied to a sba dev's email about some of sba features, and it seems to imply that blocking clicks in guis aren't bannable](https://cdn.discordapp.com/attachments/823769568933576764/906101631861526559/unknown.png) - Made it if you hold shift in the enchant solvers it overrides prevent missclicks - nopo - Fixed pet overlay not updating when going into /pets - nopo - Fixed pet overlay randomly going to level 100 - nopo @@ -153,6 +153,8 @@ - Fixed priceless items showing first in the missing tab of the accessory bag overlay - nopo - Fixed clicking outside of experimentation game causing it to go count that as a valid click - nopo - Fixed storage gui when having locked backpack slots - nopo +- Fixed hyphens in /peek being the wrong color - whalker +- Fixed skill average calculation to include carpentry in /peek - whalker ### **Other:** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java index fdf59bb0..2a5e3305 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java @@ -57,7 +57,8 @@ public class DevTestCommand extends ClientCommandBase { "dediamondpro", "lulonaut", "craftyoldminer", - "eisengolem" + "eisengolem", + "whalker" ); private static final String[] DEV_FAIL_STRINGS = { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java index 421f7c10..75e779fc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java @@ -122,7 +122,7 @@ public class PeekCommand extends ClientCommandBase { float totalSkillLVL = 0; float totalSkillCount = 0; - List skills = Arrays.asList("taming", "mining", "foraging", "enchanting", "farming", "combat", "fishing", "alchemy"); + List skills = Arrays.asList("taming", "mining", "foraging", "enchanting", "farming", "combat", "fishing", "alchemy", "carpentry"); for (String skillName : skills) { totalSkillLVL += skyblockInfo.get(skillName).level; totalSkillCount++; @@ -133,6 +133,7 @@ public class PeekCommand extends ClientCommandBase { float spider = skyblockInfo.get("spider").level; float wolf = skyblockInfo.get("wolf").level; float enderman = skyblockInfo.get("enderman").level; + float blaze = skyblockInfo.get("blaze").level; float avgSkillLVL = totalSkillLVL / totalSkillCount; @@ -143,6 +144,7 @@ public class PeekCommand extends ClientCommandBase { spider = 1; wolf = 2; enderman = 0; + blaze = 0; } EnumChatFormatting combatPrefix = combat > 20 @@ -161,6 +163,11 @@ public class PeekCommand extends ClientCommandBase { ? EnumChatFormatting.GREEN : EnumChatFormatting.YELLOW) : EnumChatFormatting.RED; + EnumChatFormatting blazePrefix = blaze > 3 + ? (blaze > 6 + ? EnumChatFormatting.GREEN + : EnumChatFormatting.YELLOW) + : EnumChatFormatting.RED; EnumChatFormatting avgPrefix = avgSkillLVL > 20 ? (avgSkillLVL > 35 ? EnumChatFormatting.GREEN @@ -171,6 +178,7 @@ public class PeekCommand extends ClientCommandBase { overallScore += spider * spider / 81f; overallScore += wolf * wolf / 81f; overallScore += enderman * enderman / 81f; + overallScore += blaze * blaze / 81f; overallScore += avgSkillLVL / 20f; int cata = (int) skyblockInfo.get("catacombs").level; @@ -187,8 +195,9 @@ public class PeekCommand extends ClientCommandBase { 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) + "-" + - endermanPrefix + (int) Math.floor(enderman))); + wolfPrefix + (int) Math.floor(wolf) + g+ "-" + + endermanPrefix + (int) Math.floor(enderman) + g + "-" + + blazePrefix + (int) Math.floor(blaze))); } if (stats == null) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( -- cgit From 6e73b7b440b22c0e93cbe40d852cc609f7397509 Mon Sep 17 00:00:00 2001 From: Ascynx <78341107+Ascynx@users.noreply.github.com> Date: Thu, 15 Sep 2022 03:20:48 +0200 Subject: revert "Made it only show if no gui screen is open" (#284) --- .../notenoughupdates/overlays/TextTabOverlay.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java index 8073062c..03578c95 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java @@ -21,6 +21,7 @@ package io.github.moulberry.notenoughupdates.overlays; import io.github.moulberry.notenoughupdates.core.config.Position; import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiChat; import org.lwjgl.input.Keyboard; import java.util.List; @@ -58,7 +59,16 @@ public abstract class TextTabOverlay extends TextOverlay { } private boolean shouldUpdate() { - //prevent rendering unless no gui is open - return Minecraft.getMinecraft().currentScreen == null; + //prevent rendering when tab completing a command + if (Minecraft.getMinecraft().currentScreen instanceof GuiChat) { + return false; + } + + //prevent rendering when tab completing in ah search overlay + if (AuctionSearchOverlay.shouldReplace()) { + return false; + } + + return true; } } -- cgit From f270bf2074d3c10e6bfabc17b22df203aff12c2c Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 15 Sep 2022 18:27:28 +0200 Subject: Autopet rule detection (#286) * fixed autopet rule detection 'on island switch' * no unnecessary debug changes left --- .../moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 f58ced51..761c0695 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java @@ -32,7 +32,6 @@ import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpUtils; import io.github.moulberry.notenoughupdates.listener.RenderListener; import io.github.moulberry.notenoughupdates.options.NEUConfig; -import io.github.moulberry.notenoughupdates.overlays.EquipmentOverlay; import io.github.moulberry.notenoughupdates.overlays.TextOverlay; import io.github.moulberry.notenoughupdates.overlays.TextOverlayStyle; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; @@ -1044,8 +1043,7 @@ public class PetInfoOverlay extends TextOverlay { @SubscribeEvent(priority = EventPriority.HIGHEST) public void onChatReceived(ClientChatReceivedEvent event) { NEUConfig config = NotEnoughUpdates.INSTANCE.config; - if (NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() && - (config.petOverlay.enablePetInfo || config.itemOverlays.enableMonkeyCheck || config.petOverlay.petInvDisplay)) { + if (config.petOverlay.enablePetInfo || config.itemOverlays.enableMonkeyCheck || config.petOverlay.petInvDisplay) { if (event.type == 0) { String chatMessage = Utils.cleanColour(event.message.getUnformattedText()); -- cgit From d4350c2943dab39326ed268e859731649ba53f1b Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 16 Sep 2022 02:28:13 +1000 Subject: Fix a few bugs with et/hex overlay (#285) * Fix a few bugs with et/hex overlay * Moved fixEnchantId into ItemUtils Co-authored-by: Lorenz --- .../notenoughupdates/miscgui/GuiCustomEnchant.java | 25 ++++++++-------- .../notenoughupdates/miscgui/hex/GuiCustomHex.java | 33 +++++++++++++--------- .../moulberry/notenoughupdates/util/ItemUtils.java | 17 +++++++++++ 3 files changed, 49 insertions(+), 26 deletions(-) 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 cbf98290..748694cb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java @@ -32,6 +32,7 @@ import io.github.moulberry.notenoughupdates.miscgui.util.OrbDisplay; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; import io.github.moulberry.notenoughupdates.options.NEUConfig; import io.github.moulberry.notenoughupdates.util.Constants; +import io.github.moulberry.notenoughupdates.util.ItemUtils; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -106,10 +107,7 @@ public class GuiCustomEnchant extends Gui { this.enchId = enchId; this.displayLore = displayLore; this.level = level; - if (this.enchId.equals("prosecute")) { - this.enchId = "PROSECUTE"; - } - + this.enchId = ItemUtils.fixEnchantId(enchId, true); if (Constants.ENCHANTS != null) { if (checkConflicts && Constants.ENCHANTS.has("enchant_pools")) { @@ -143,12 +141,12 @@ public class GuiCustomEnchant extends Gui { maxLevel = Constants.ENCHANTS.getAsJsonObject("max_xp_table_levels"); } - if (allCosts.has(enchId)) { - JsonArray costs = allCosts.getAsJsonArray(enchId); + if (allCosts.has(this.enchId)) { + JsonArray costs = allCosts.getAsJsonArray(this.enchId); if (costs.size() >= 1) { if (useMaxLevelForCost) { - int cost = (maxLevel != null && maxLevel.has(enchId) ? maxLevel.get(enchId).getAsInt() : costs.size()); + int cost = (maxLevel != null && maxLevel.has(this.enchId) ? maxLevel.get(this.enchId).getAsInt() : costs.size()); this.xpCost = costs.get(cost - 1).getAsInt(); } else if (level - 1 < costs.size()) { this.xpCost = costs.get(level - 1).getAsInt(); @@ -242,7 +240,10 @@ public class GuiCustomEnchant extends Gui { GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); ContainerChest cc = (ContainerChest) chest.inventorySlots; ItemStack hexStack = cc.getLowerChestInventory().getStackInSlot(50); - if (hexStack != null && hexStack.getItem() == Items.experience_bottle) return false; + if (hexStack != null && hexStack.getItem() == Items.experience_bottle) { + shouldOverrideFast = false; + return false; + } return shouldOverrideFast; } @@ -456,9 +457,7 @@ public class GuiCustomEnchant extends Gui { .replace(" ", "_") .replace("-", "_"); if (enchId.equalsIgnoreCase("_")) continue; - if (enchId.equals("prosecute")) { - enchId = "PROSECUTE"; - } + enchId = ItemUtils.fixEnchantId(enchId, true); String name = Utils.cleanColour(book.getDisplayName()); if (searchField.getText().trim().isEmpty() || @@ -1071,7 +1070,9 @@ public class GuiCustomEnchant extends Gui { Minecraft.getMinecraft().fontRendererObj.drawString(levelStr, left + 8 - levelWidth / 2, top + 4, colour, false); //Enchant name - String name = WordUtils.capitalizeFully(enchanterCurrentEnch.enchId.replace("_", " ")); + String name = WordUtils.capitalizeFully(ItemUtils + .fixEnchantId(enchanterCurrentEnch.enchId, false) + .replace("_", " ")); if (name.equalsIgnoreCase("Bane of Arthropods")) { name = "Bane of Arth."; } else if (name.equalsIgnoreCase("Projectile Protection")) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java index c59a7003..c981f75c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java @@ -33,6 +33,7 @@ import io.github.moulberry.notenoughupdates.miscgui.util.OrbDisplay; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; import io.github.moulberry.notenoughupdates.options.NEUConfig; import io.github.moulberry.notenoughupdates.util.Constants; +import io.github.moulberry.notenoughupdates.util.ItemUtils; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.EntityPlayerSP; @@ -118,9 +119,7 @@ public class GuiCustomHex extends Gui { if (bazaarInfo != null && bazaarInfo.get("curr_buy") != null) { this.price = bazaarInfo.get("curr_buy").getAsInt(); } - if (this.enchId.equals("prosecute")) { - this.enchId = "PROSECUTE"; - } + this.enchId = ItemUtils.fixEnchantId(this.enchId, true); if (Constants.ENCHANTS != null) { if (checkConflicts && Constants.ENCHANTS.has("enchant_pools")) { @@ -134,7 +133,7 @@ public class GuiCustomHex extends Gui { for (int j = 0; j < pool.size(); j++) { String enchIdPoolElement = pool.get(j).getAsString(); - if (enchId.equalsIgnoreCase(enchIdPoolElement)) { + if (this.enchId.equalsIgnoreCase(enchIdPoolElement)) { hasThis = true; } else if (playerEnchantIds.containsKey(enchIdPoolElement)) { hasApplied = true; @@ -149,8 +148,8 @@ public class GuiCustomHex extends Gui { if (level >= 1 && Constants.ENCHANTS.has("enchants_xp_cost")) { JsonObject allCosts = Constants.ENCHANTS.getAsJsonObject("enchants_xp_cost"); - if (allCosts.has(enchId)) { - JsonArray costs = allCosts.getAsJsonArray(enchId); + if (allCosts.has(this.enchId)) { + JsonArray costs = allCosts.getAsJsonArray(this.enchId); if (costs.size() >= 1) { if (useMaxLevelForCost) { @@ -279,12 +278,16 @@ public class GuiCustomHex extends Gui { } shouldOverrideXp = config && - (containerName.length() >= 21 && Objects.equals("Bottles of Enchanting", containerName.substring(0, "Bottles of Enchanting".length()))) && + (containerName.length() >= 21 && Objects.equals( + "Bottles of Enchanting", + containerName.substring(0, "Bottles of Enchanting".length()) + )) && NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard(); GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); ContainerChest cc = (ContainerChest) chest.inventorySlots; ItemStack hexStack = cc.getLowerChestInventory().getStackInSlot(50); - CalendarOverlay.ableToClickCalendar = !(shouldOverrideET || shouldOverrideFast || shouldOverrideGemstones || shouldOverrideXp); + CalendarOverlay.ableToClickCalendar = + !(shouldOverrideET || shouldOverrideFast || shouldOverrideGemstones || shouldOverrideXp); if (hexStack != null && hexStack.getItem() == Items.experience_bottle) return (shouldOverrideET || shouldOverrideFast); if (!shouldOverrideFast && !shouldOverrideET && !shouldOverrideGemstones && !shouldOverrideXp) { @@ -564,9 +567,7 @@ public class GuiCustomHex extends Gui { .replace(" ", "_") .replace("-", "_"); if (enchId.equalsIgnoreCase("_")) continue; - if (enchId.equals("prosecute")) { - enchId = "PROSECUTE"; - } + enchId = ItemUtils.fixEnchantId(enchId, true); String name = Utils.cleanColour(book.getDisplayName()); if (searchField.getText().trim().isEmpty() || @@ -1233,7 +1234,8 @@ public class GuiCustomHex extends Gui { renderHex(partialTicks); } else if (containerName.contains("Enchant Item")) { renderEnchantment(partialTicks); - } else if (containerName.contains("Books") || containerName.contains("Modifiers") || containerName.contains("Bottles of Enchanting")) { + } else if (containerName.contains("Books") || containerName.contains("Modifiers") || containerName.contains( + "Bottles of Enchanting")) { renderBooks(partialTicks); } else if (containerName.contains("Gemstones")) { renderGemstones(partialTicks); @@ -1638,7 +1640,9 @@ public class GuiCustomHex extends Gui { Minecraft.getMinecraft().fontRendererObj.drawString(levelStr, left + 8 - levelWidth / 2, top + 4, colour, false); //Enchant name - String name = WordUtils.capitalizeFully(enchanterCurrentEnch.enchId.replace("_", " ")); + String name = WordUtils.capitalizeFully(ItemUtils + .fixEnchantId(enchanterCurrentEnch.enchId, false) + .replace("_", " ")); if (name.equalsIgnoreCase("Bane of Arthropods")) { name = "Bane of Arth."; } else if (name.equalsIgnoreCase("Projectile Protection")) { @@ -3770,7 +3774,8 @@ public class GuiCustomHex extends Gui { } public void overrideIsMouseOverSlot(Slot slot, int mouseX, int mouseY, CallbackInfoReturnable cir) { - if ((shouldOverrideFast || shouldOverrideGemstones || shouldOverrideXp) && currentState != EnchantState.ADDING_ENCHANT) { + if ((shouldOverrideFast || shouldOverrideGemstones || shouldOverrideXp) && + currentState != EnchantState.ADDING_ENCHANT) { boolean playerInv = slot.inventory == Minecraft.getMinecraft().thePlayer.inventory; int slotId = slot.getSlotIndex(); if (playerInv && slotId < 36) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java index ad8a6c98..adf09161 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java @@ -19,6 +19,7 @@ package io.github.moulberry.notenoughupdates.util; +import com.google.gson.JsonArray; import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; @@ -103,4 +104,20 @@ public class ItemUtils { return string; } + public static String fixEnchantId(String enchId, boolean useId) { + if (Constants.ENCHANTS != null && Constants.ENCHANTS.has("enchant_mapping_id") && + Constants.ENCHANTS.has("enchant_mapping_item")) { + JsonArray mappingFrom = Constants.ENCHANTS.getAsJsonArray("enchant_mapping_" + (useId ? "id" : "item")); + JsonArray mappingTo = Constants.ENCHANTS.getAsJsonArray("enchant_mapping_" + (useId ? "item" : "id")); + + for (int i = 0; i < mappingFrom.size(); i++) { + if (mappingFrom.get(i).getAsString().equals(enchId)) { + return mappingTo.get(i).getAsString(); + } + } + + } + return enchId; + } + } -- cgit From ff5b80cd0f2068077d3343aa4e479e6284b41276 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 16 Sep 2022 02:52:31 +1000 Subject: fix dungeon profit if no one is selling the book (#282) --- .../github/moulberry/notenoughupdates/listener/RenderListener.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java index c822a51d..6f4167f2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -45,17 +45,17 @@ import io.github.moulberry.notenoughupdates.miscfeatures.StorageManager; import io.github.moulberry.notenoughupdates.miscgui.AccessoryBagOverlay; import io.github.moulberry.notenoughupdates.miscgui.CalendarOverlay; import io.github.moulberry.notenoughupdates.miscgui.GuiCustomEnchant; -import io.github.moulberry.notenoughupdates.miscgui.hex.GuiCustomHex; import io.github.moulberry.notenoughupdates.miscgui.GuiInvButtonEditor; import io.github.moulberry.notenoughupdates.miscgui.GuiItemRecipe; import io.github.moulberry.notenoughupdates.miscgui.StorageOverlay; import io.github.moulberry.notenoughupdates.miscgui.TradeWindow; import io.github.moulberry.notenoughupdates.miscgui.TrophyRewardOverlay; +import io.github.moulberry.notenoughupdates.miscgui.hex.GuiCustomHex; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; import io.github.moulberry.notenoughupdates.options.NEUConfig; import io.github.moulberry.notenoughupdates.overlays.AuctionSearchOverlay; -import io.github.moulberry.notenoughupdates.overlays.EquipmentOverlay; import io.github.moulberry.notenoughupdates.overlays.BazaarSearchOverlay; +import io.github.moulberry.notenoughupdates.overlays.EquipmentOverlay; import io.github.moulberry.notenoughupdates.overlays.OverlayManager; import io.github.moulberry.notenoughupdates.overlays.RancherBootOverlay; import io.github.moulberry.notenoughupdates.overlays.TextOverlay; @@ -792,6 +792,8 @@ public class RenderListener { JsonObject bazaarInfo = neu.manager.auctionManager.getBazaarInfo(internal); if (bazaarInfo != null && bazaarInfo.has("curr_sell")) { bazaarPrice = bazaarInfo.get("curr_sell").getAsFloat(); + } else if (bazaarInfo != null) { + bazaarPrice = 0; } if (bazaarPrice < 5000000 && internal.equals("RECOMBOBULATOR_3000")) bazaarPrice = 5000000; -- cgit From 53cc06e8badfc34ee5c54062ed24639fb4c88886 Mon Sep 17 00:00:00 2001 From: Ascynx <78341107+Ascynx@users.noreply.github.com> Date: Fri, 16 Sep 2022 17:25:28 +0200 Subject: petHud/EquipmentHud preview render fix (#293) --- .../miscgui/GuiInvButtonEditor.java | 9 +++++ .../overlays/EquipmentOverlay.java | 40 ++++++++++------------ 2 files changed, 28 insertions(+), 21 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java index 4d18ea18..7aa0d2ec 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiInvButtonEditor.java @@ -85,6 +85,15 @@ public class GuiInvButtonEditor extends GuiScreen { private int guiLeft; private int guiTop; + //region getGuiCoordinates + public int getGuiLeft() { + return this.guiLeft; + } + public int getGuiTop() { + return this.guiTop; + } + //endregion + private static final int BACKGROUND_TYPES = 5; private static final int ICON_TYPES = 3; private int iconTypeIndex = 0; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java index ea440396..2d3175b5 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java @@ -26,6 +26,7 @@ import io.github.moulberry.notenoughupdates.NEUManager; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.events.GuiInventoryBackgroundDrawnEvent; import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; +import io.github.moulberry.notenoughupdates.miscgui.GuiInvButtonEditor; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; import io.github.moulberry.notenoughupdates.options.NEUConfig; import io.github.moulberry.notenoughupdates.util.ItemUtils; @@ -134,6 +135,8 @@ public class EquipmentOverlay { public static final int ARMOR_OVERLAY_OVERHAND_WIDTH = 24; public static final int ARMOR_OVERLAY_HEIGHT = 86; public static final int ARMOR_OVERLAY_WIDTH = 31; + final static int PET_OVERLAY_HEIGHT = 32; + final static int PET_OVERLAY_WIDTH = 31; public static final int PET_OVERLAY_OFFSET_Y = ARMOR_OVERLAY_HEIGHT - 14 /* overlaying pixels */; // @@ -259,7 +262,7 @@ public class EquipmentOverlay { if (screen instanceof GuiChest) { petStack = getRepoPetStack(); } - if (!(screen instanceof GuiInventory) + if ((!(screen instanceof GuiInventory) && !(screen instanceof GuiInvButtonEditor)) || !NotEnoughUpdates.INSTANCE.config.misc.hidePotionEffect || !NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) { shouldRenderPets = shouldRenderArmorHud = false; @@ -299,7 +302,7 @@ public class EquipmentOverlay { int overlayLeft = container.getGuiLeft() - ARMOR_OVERLAY_OVERHAND_WIDTH; int overlayTop = container.getGuiTop() + PET_OVERLAY_OFFSET_Y; - Utils.drawTexturedRect(overlayLeft, overlayTop, 31, 32, GL11.GL_NEAREST); + Utils.drawTexturedRect(overlayLeft, overlayTop, PET_OVERLAY_WIDTH, PET_OVERLAY_HEIGHT, GL11.GL_NEAREST); GlStateManager.bindTexture(0); Utils.drawItemStack(petInfo, overlayLeft + 8, overlayTop + 8, true); @@ -423,33 +426,28 @@ public class EquipmentOverlay { } public void renderPreviewArmorHud() { - if (!NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud) return; + if (!NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud || !(Minecraft.getMinecraft().currentScreen instanceof GuiInvButtonEditor)) return; + GuiInvButtonEditor container = (GuiInvButtonEditor) Minecraft.getMinecraft().currentScreen; - int width = Utils.peekGuiScale().getScaledWidth(); - int height = Utils.peekGuiScale().getScaledHeight(); + int overlayLeft = container.getGuiLeft() - ARMOR_OVERLAY_OVERHAND_WIDTH; + int overlayTop = container.getGuiTop(); - Minecraft.getMinecraft().getTextureManager().bindTexture(getCustomEquipmentTexture(NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay)); + ResourceLocation equipmentTexture = getCustomEquipmentTexture(shouldRenderPets); + Minecraft.getMinecraft().getTextureManager().bindTexture(equipmentTexture); - GlStateManager.color(1, 1, 1, 1); - GL11.glTranslatef(0, 0, 401); - float yNumber = (float) (height - 167) / 2f; - Utils.drawTexturedRect((float) ((width - 224.1) / 2f), yNumber, 31, 86, GL11.GL_NEAREST); - GlStateManager.bindTexture(0); + Utils.drawTexturedRect(overlayLeft, overlayTop, ARMOR_OVERLAY_WIDTH, ARMOR_OVERLAY_HEIGHT, GL11.GL_NEAREST); } public void renderPreviewPetInvHud() { - if (!NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay) return; - - int width = Utils.peekGuiScale().getScaledWidth(); - int height = Utils.peekGuiScale().getScaledHeight(); + if (!NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay || !(Minecraft.getMinecraft().currentScreen instanceof GuiInvButtonEditor)) return; + GuiInvButtonEditor container = (GuiInvButtonEditor) Minecraft.getMinecraft().currentScreen; + int overlayLeft = container.getGuiLeft() - ARMOR_OVERLAY_OVERHAND_WIDTH; + int overlayTop = container.getGuiTop() + PET_OVERLAY_OFFSET_Y; - Minecraft.getMinecraft().getTextureManager().bindTexture(getCustomPetTexture(NotEnoughUpdates.INSTANCE.config.customArmour.enableArmourHud)); + ResourceLocation petHudTexture = getCustomPetTexture(shouldRenderArmorHud); + Minecraft.getMinecraft().getTextureManager().bindTexture(petHudTexture); - GlStateManager.color(1, 1, 1, 1); - GL11.glTranslatef(0, 0, 401); - float yNumber = (float) (height - 23) / 2f; - Utils.drawTexturedRect((float) ((width - 224.1) / 2f), yNumber, 31, 32, GL11.GL_NEAREST); - GlStateManager.bindTexture(0); + Utils.drawTexturedRect(overlayLeft, overlayTop, PET_OVERLAY_WIDTH, PET_OVERLAY_HEIGHT, GL11.GL_NEAREST); } public ItemStack slot1 = null; -- cgit From 844555116cf61e7062e31b0432533c985a19abc7 Mon Sep 17 00:00:00 2001 From: Ascynx <78341107+Ascynx@users.noreply.github.com> Date: Sat, 17 Sep 2022 08:30:37 +0200 Subject: Show own head as marker fix (#283) Now when active (with head icons on) will always show own head as a marker --- .../java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java index d4a728be..a4c5a60a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/DungeonMap.java @@ -726,7 +726,7 @@ public class DungeonMap { } GlStateManager.color(1, 1, 1, 1); if ((!NotEnoughUpdates.INSTANCE.config.dungeons.showOwnHeadAsMarker || - playerMarkerMapPositions.size() <= 1 || minU != 1 / 4f) && + playerMarkerMapPositions.size() < 1 || minU != 1 / 4f) && NotEnoughUpdates.INSTANCE.config.dungeonMap.dmPlayerHeads >= 1 && playerSkinMap.containsKey(entry.getKey())) { Minecraft.getMinecraft().getTextureManager().bindTexture(playerSkinMap.get(entry.getKey())); -- cgit From fc949693dac0acb9521867476605d98ff5bde5ec Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 23 Sep 2022 01:44:20 +1000 Subject: remove skyblock check so streamer mode applies instantly (#298) --- .../io/github/moulberry/notenoughupdates/listener/ChatListener.java | 2 +- .../io/github/moulberry/notenoughupdates/mixins/MixinGuiIngame.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java index b59eaf17..de37b976 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java @@ -238,7 +238,7 @@ public class ChatListener { } missingRecipe.set(true); } - if (unformatted.startsWith("Sending to server") && neu.isOnSkyblock() && + if (unformatted.startsWith("Sending to server") && NotEnoughUpdates.INSTANCE.config.misc.streamerMode && e.message instanceof ChatComponentText) { String m = e.message.getFormattedText(); String m2 = StreamerMode.filterChat(e.message.getFormattedText()); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiIngame.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiIngame.java index 3856e2d5..381f5934 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiIngame.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiIngame.java @@ -43,7 +43,7 @@ public class MixinGuiIngame { @Redirect(method = "renderScoreboard", at = @At(value = "INVOKE", target = TARGET)) public String renderScoreboard_formatPlayerName(Team team, String name) { - if (NotEnoughUpdates.INSTANCE.isOnSkyblock() && NotEnoughUpdates.INSTANCE.config.misc.streamerMode) { + if (NotEnoughUpdates.INSTANCE.config.misc.streamerMode) { return StreamerMode.filterScoreboard(ScorePlayerTeam.formatPlayerName(team, name)); } return ScorePlayerTeam.formatPlayerName(team, name); -- cgit From c055595e0a35accf1a8a4742286a7b267037ac45 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 22 Sep 2022 17:47:39 +0200 Subject: Coop Soulbound kuudra drops (#299) --- .../moulberry/notenoughupdates/listener/RenderListener.java | 11 +++++++---- .../io/github/moulberry/notenoughupdates/util/ItemUtils.java | 4 ++++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java index 6f4167f2..6460e1ed 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -60,6 +60,7 @@ 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.ItemUtils; import io.github.moulberry.notenoughupdates.util.NotificationHandler; import io.github.moulberry.notenoughupdates.util.RequestFocusListener; import io.github.moulberry.notenoughupdates.util.SBInfo; @@ -408,7 +409,7 @@ public class RenderListener { GL11.glTranslatef(0, 0, 10); } if (hoverInv) { - renderDungeonChestOverlay(event.gui); + renderDungKuudraChestOverlay(event.gui); if (NotEnoughUpdates.INSTANCE.config.accessoryBag.enableOverlay) { AccessoryBagOverlay.renderOverlay(); } @@ -625,7 +626,7 @@ public class RenderListener { } if (NotificationHandler.shouldRenderOverlay(event.gui) && neu.isOnSkyblock() && !hoverInv) { - renderDungeonChestOverlay(event.gui); + renderDungKuudraChestOverlay(event.gui); if (NotEnoughUpdates.INSTANCE.config.accessoryBag.enableOverlay) { AccessoryBagOverlay.renderOverlay(); } @@ -734,7 +735,7 @@ public class RenderListener { } } - private void renderDungeonChestOverlay(GuiScreen gui) { + private void renderDungKuudraChestOverlay(GuiScreen gui) { if (NotEnoughUpdates.INSTANCE.config.dungeons.profitDisplayLoc == 3) return; if (gui instanceof GuiChest && NotEnoughUpdates.INSTANCE.config.dungeons.profitDisplayLoc != 2) { try { @@ -771,7 +772,9 @@ public class RenderListener { HashMap itemValues = new HashMap<>(); for (int i = 0; i < 5; i++) { ItemStack item = lower.getStackInSlot(11 + i); - String internal = neu.manager.getInternalNameForItem(item); + if (ItemUtils.isSoulbound(item)) continue; + + String internal = neu.manager.createItemResolutionQuery().withItemStack(item).resolveInternalName(); String displayName = item.getDisplayName(); Matcher matcher = ESSENCE_PATTERN.matcher(displayName); if (neu.config.dungeons.useEssenceCostFromBazaar && matcher.matches()) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java index adf09161..c7c7d4b6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java @@ -120,4 +120,8 @@ public class ItemUtils { return enchId; } + public static boolean isSoulbound(ItemStack item) { + return ItemUtils.getLore(item).stream() + .anyMatch(line -> line.equals("§8§l* §8Co-op Soulbound §8§l*") || line.equals("§8§l* Soulbound §8§l*")); + } } -- cgit From b932226747a1e53d3818a54a0cff358664ea1190 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 23 Sep 2022 01:48:20 +1000 Subject: make rune not show in dev pane (#297) --- .../java/io/github/moulberry/notenoughupdates/infopanes/DevInfoPane.java | 1 + 1 file changed, 1 insertion(+) 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 a449919e..0b1963d6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/infopanes/DevInfoPane.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/infopanes/DevInfoPane.java @@ -81,6 +81,7 @@ public class DevInfoPane extends TextInfoPane { for (String internalname : manager.auctionManager.getItemAuctionInfoKeySet()) { if (internalname.matches("^.*-[0-9]{1,3}$")) continue; if (!manager.getItemInformation().containsKey(internalname)) { + if (internalname.equals("RUNE") || internalname.contains("PARTY_HAT_CRAB")) continue; text += internalname + "\n"; } } -- cgit From 90b552d27cd52d045fa6b5243d014ce1f917cd78 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 23 Sep 2022 01:51:29 +1000 Subject: anti coop add button in profile viewer (#296) --- .../notenoughupdates/miscfeatures/AntiCoopAdd.java | 62 ++++++++++++++++++++++ .../notenoughupdates/mixins/MixinGuiContainer.java | 8 ++- .../options/seperateSections/Misc.java | 8 +++ 3 files changed, 77 insertions(+), 1 deletion(-) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AntiCoopAdd.java diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AntiCoopAdd.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AntiCoopAdd.java new file mode 100644 index 00000000..25aaaa0a --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AntiCoopAdd.java @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.miscfeatures; + +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.util.Utils; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.event.ClickEvent; +import net.minecraft.event.HoverEvent; +import net.minecraft.init.Items; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.ChatComponentText; +import net.minecraft.util.EnumChatFormatting; + +public class AntiCoopAdd { + + public static boolean onMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType) { + if (!NotEnoughUpdates.INSTANCE.config.misc.coopWarning) return false; + if (slotId == -999) return false; + if (!Utils.getOpenChestName().contains("Profile")) return false; + + GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; + + ItemStack stack = chest.inventorySlots.getSlot(slotId).getStack(); + if (stack == null) return false; + if (stack.getItem() == Items.diamond && stack.getDisplayName() != null && stack.getDisplayName().contains("Co-op Request")) { + String ign = Utils.getOpenChestName().split("'s Profile")[0]; + ChatComponentText storageMessage = new ChatComponentText( + EnumChatFormatting.YELLOW + "[NEU] " + EnumChatFormatting.YELLOW + + "You just clicked on the Co-op add button. If you want to coop add this person, click this chat message"); + storageMessage.setChatStyle(Utils.createClickStyle(ClickEvent.Action.RUN_COMMAND, "/coopadd " + ign)); + storageMessage.setChatStyle(storageMessage.getChatStyle().setChatHoverEvent( + new HoverEvent(HoverEvent.Action.SHOW_TEXT, + new ChatComponentText(EnumChatFormatting.YELLOW + "Click to add " + ign + " to your coop")))); + ChatComponentText storageChatMessage = new ChatComponentText(""); + storageChatMessage.appendSibling(storageMessage); + Minecraft.getMinecraft().thePlayer.addChatMessage(storageChatMessage); + return true; + } + + return false; + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java index 7d17aa3e..ee14452d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java @@ -23,6 +23,7 @@ import io.github.moulberry.notenoughupdates.NEUOverlay; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.listener.RenderListener; import io.github.moulberry.notenoughupdates.miscfeatures.AbiphoneWarning; +import io.github.moulberry.notenoughupdates.miscfeatures.AntiCoopAdd; import io.github.moulberry.notenoughupdates.miscfeatures.AuctionBINWarning; import io.github.moulberry.notenoughupdates.miscfeatures.AuctionSortModeWarning; import io.github.moulberry.notenoughupdates.miscfeatures.BetterContainers; @@ -30,8 +31,8 @@ import io.github.moulberry.notenoughupdates.miscfeatures.EnchantingSolvers; import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking; import io.github.moulberry.notenoughupdates.miscgui.GuiCustomEnchant; -import io.github.moulberry.notenoughupdates.miscgui.hex.GuiCustomHex; import io.github.moulberry.notenoughupdates.miscgui.StorageOverlay; +import io.github.moulberry.notenoughupdates.miscgui.hex.GuiCustomHex; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; @@ -314,6 +315,11 @@ public abstract class MixinGuiContainer extends GuiScreen { return; } + if (AntiCoopAdd.onMouseClick(slotIn, slotId, clickedButton, clickType)) { + ci.cancel(); + return; + } + AtomicBoolean ret = new AtomicBoolean(false); SlotLocking.getInstance().onWindowClick(slotIn, slotId, clickedButton, clickType, (tuple) -> { ci.cancel(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java index 84e2322e..c6f00182 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java @@ -229,4 +229,12 @@ public class Misc { @ConfigEditorBoolean public boolean abiphoneWarning = true; + @Expose + @ConfigOption( + name = "Enable Coop Warning", + desc = "Asks for confirmation when clicking the coop diamond in profile menu" + ) + @ConfigEditorBoolean + public boolean coopWarning = true; + } -- cgit From 6520c42697fe929316e93e42e8b070e6241cff0e Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 23 Sep 2022 01:52:00 +1000 Subject: fix pv button not showing on nons (#294) --- .../io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java index ee14452d..f708fb5f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java @@ -98,7 +98,7 @@ public abstract class MixinGuiContainer extends GuiScreen { if (tag.hasKey("SkullOwner") && tag.getCompoundTag("SkullOwner").hasKey("Name")) { String tagName = tag.getCompoundTag("SkullOwner").getString("Name"); String displayName = Utils.cleanColour(cc.inventorySlots.get(22).getStack().getDisplayName()); - if (displayName.length() - tagName.length() > 0 && tagName.equals(displayName.substring(displayName.length() - tagName.length()))) { + if (displayName.length() - tagName.length() >= 0 && tagName.equals(displayName.substring(displayName.length() - tagName.length()))) { ci.cancel(); this.zLevel = 100.0F; -- cgit From 5b3d6154a53599d37aa9c98e89b942f70fbce2cb Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 23 Sep 2022 01:56:53 +1000 Subject: fix pet middle clicking (#287) --- Update Notes/2.1.md | 2 ++ src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java | 4 +++- .../moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index e6b2b472..99b2eef0 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -155,6 +155,8 @@ - Fixed storage gui when having locked backpack slots - nopo - Fixed hyphens in /peek being the wrong color - whalker - Fixed skill average calculation to include carpentry in /peek - whalker +- Fixed middle clicking on pets not registering pet swap - nopo +- Fixed middle clicking on an item with no id searching for it - nopo ### **Other:** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index 308bd63e..dbff2be2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -753,7 +753,9 @@ public class NEUOverlay extends Gui { if (slot != null) { ItemStack hover = slot.getStack(); if (hover != null) { - textField.setText("id:" + manager.getInternalNameForItem(hover)); + if (manager.getInternalNameForItem(hover) != null) { + textField.setText("id:" + manager.getInternalNameForItem(hover)); + } itemPaneOpen = true; updateSearch(); } 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 761c0695..14a136a2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java @@ -859,8 +859,7 @@ public class PetInfoOverlay extends TextOverlay { ); public static void onStackClick(ItemStack stack, int windowId, int slotId, int mouseButtonClicked, int mode) { - if (mode != 0) return; - if (mouseButtonClicked != 0 && mouseButtonClicked != 1) return; + if (mouseButtonClicked != 0 && mouseButtonClicked != 1 && mouseButtonClicked != 2) return; int slotIdMod = (slotId - 10) % 9; if (slotId >= 10 && slotId <= 43 && slotIdMod >= 0 && slotIdMod <= 6 && -- cgit From eeaf4c2a30ef7ca6bba067bbfc48ece0ad93f55b Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 23 Sep 2022 04:50:33 +1000 Subject: made combat overlay show with only champion (#291) --- .../moulberry/notenoughupdates/overlays/CombatSkillOverlay.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java index 4ad6767d..bf106eed 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java @@ -91,6 +91,7 @@ public class CombatSkillOverlay championXpLast = championXp; xpGainHourLast = xpGainHour; kill = -1; + championXp = -1; if (Minecraft.getMinecraft().thePlayer == null) return; @@ -216,7 +217,7 @@ public class CombatSkillOverlay killQueue.removeLast(); } - if (kill != -1) { + if (kill != -1 || championXp != -1) { overlayStrings = new ArrayList<>(); } else { overlayStrings = null; @@ -228,7 +229,7 @@ public class CombatSkillOverlay public void updateFrequent() { super.updateFrequent(); - if ((kill < 0 || championXp < 0) && !NotEnoughUpdates.INSTANCE.config.skillOverlays.alwaysShowCombatOverlay) { + if ((kill < 0 && championXp < 0) && !NotEnoughUpdates.INSTANCE.config.skillOverlays.alwaysShowCombatOverlay) { overlayStrings = null; } else { HashMap lineMap = new HashMap<>(); -- cgit From e5f1c29a9266fde6f1a558639bedc6437dffe7cb Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Thu, 22 Sep 2022 20:51:20 +0200 Subject: fixed error when reading mining api data (#301) --- .../io/github/moulberry/notenoughupdates/util/HotmInformation.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/HotmInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/util/HotmInformation.java index 5d7bfa6d..c97a37d9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/HotmInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/HotmInformation.java @@ -195,7 +195,10 @@ public class HotmInformation { Tree tree = new Tree(); JsonObject nodes = miningCore.getAsJsonObject("nodes"); for (Map.Entry node : nodes.entrySet()) { - tree.levels.put(node.getKey(), node.getValue().getAsInt()); + String key = node.getKey(); + if (!key.startsWith("toggle_")) { + tree.levels.put(key, node.getValue().getAsInt()); + } } if (miningCore.has("powder_mithril_total")) { tree.totalMithrilPowder = miningCore.get("powder_mithril_total").getAsInt(); -- cgit From 2d9bf47ca3a61fee56d3a52f56ee0daca626a9c8 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 23 Sep 2022 04:53:29 +1000 Subject: Added price display to books in hex (#292) --- .../notenoughupdates/miscgui/GuiCustomEnchant.java | 13 ++- .../notenoughupdates/miscgui/hex/GuiCustomHex.java | 106 +++++++++++++++++++-- .../options/seperateSections/Enchanting.java | 9 ++ 3 files changed, 113 insertions(+), 15 deletions(-) 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 748694cb..6f190ada 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiCustomEnchant.java @@ -377,10 +377,12 @@ public class GuiCustomEnchant extends Gui { if (ea != null) { NBTTagCompound enchantments = ea.getCompoundTag("enchantments"); if (enchantments != null) { - String enchId = Utils.cleanColour(book.getDisplayName()).toLowerCase().replace(" ", "_").replace( - "-", - "_" - ); + String enchId = Utils + .cleanColour(book.getDisplayName()) + .toLowerCase() + .replace(" ", "_") + .replace("-", "_") + .replaceAll("[^a-z_]", ""); String name = Utils.cleanColour(book.getDisplayName()); int enchLevel = -1; if (name.equalsIgnoreCase("Bane of Arthropods")) { @@ -455,7 +457,8 @@ public class GuiCustomEnchant extends Gui { .cleanColour(book.getDisplayName()) .toLowerCase() .replace(" ", "_") - .replace("-", "_"); + .replace("-", "_") + .replaceAll("[^a-z_]", ""); if (enchId.equalsIgnoreCase("_")) continue; enchId = ItemUtils.fixEnchantId(enchId, true); String name = Utils.cleanColour(book.getDisplayName()); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java index c981f75c..5361ae89 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/hex/GuiCustomHex.java @@ -148,12 +148,20 @@ public class GuiCustomHex extends Gui { if (level >= 1 && Constants.ENCHANTS.has("enchants_xp_cost")) { JsonObject allCosts = Constants.ENCHANTS.getAsJsonObject("enchants_xp_cost"); + JsonObject maxLevel = null; + if (NotEnoughUpdates.INSTANCE.config.enchantingSolvers.maxEnchLevel && Constants.ENCHANTS.has( + "max_xp_table_levels")) { + maxLevel = Constants.ENCHANTS.getAsJsonObject("max_xp_table_levels"); + } + if (allCosts.has(this.enchId)) { JsonArray costs = allCosts.getAsJsonArray(this.enchId); if (costs.size() >= 1) { if (useMaxLevelForCost) { - this.xpCost = costs.get(costs.size() - 1).getAsInt(); + int cost = + (maxLevel != null && maxLevel.has(this.enchId) ? maxLevel.get(this.enchId).getAsInt() : costs.size()); + this.xpCost = costs.get(cost - 1).getAsInt(); } else if (level - 1 < costs.size()) { this.xpCost = costs.get(level - 1).getAsInt(); } else { @@ -442,7 +450,7 @@ public class GuiCustomHex extends Gui { ItemStack book = cc.getLowerChestInventory().getStackInSlot(slotIndex); ItemStack xpBottle = cc.getLowerChestInventory().getStackInSlot(50); if (!hasXpBottle && xpBottle != null && - xpBottle.getItem() == Items.experience_bottle) { //Make show when in dungeon screen + xpBottle.getItem() == Items.experience_bottle) { String name = "Buy Xp Bottles"; String id = "XP_BOTTLE"; Enchantment xpBottleEnch = new Enchantment(50, name, id, @@ -465,10 +473,12 @@ public class GuiCustomHex extends Gui { if (ea != null) { NBTTagCompound enchantments = ea.getCompoundTag("enchantments"); if (enchantments != null) { - String enchId = Utils.cleanColour(book.getDisplayName()).toLowerCase().replace(" ", "_").replace( - "-", - "_" - ); + String enchId = Utils + .cleanColour(book.getDisplayName()) + .toLowerCase() + .replace(" ", "_") + .replace("-", "_") + .replaceAll("[^a-z_]", ""); String name = Utils.cleanColour(book.getDisplayName()); int enchLevel = -1; if (name.equalsIgnoreCase("Bane of Arthropods")) { @@ -494,6 +504,13 @@ public class GuiCustomHex extends Gui { String price = numberFormat.format(enchantment.price); enchantment.displayLore.set(index, "\u00a76" + price + ".0 Coins"); } + if (lore.contains("Loading...")) { + if (enchantment.price > 0) { + enchantment.displayLore.set(index, "\u00a7eClick to buy on the Bazaar!"); + } else { + enchantment.displayLore.set(index, "\u00a7cNot enough supply on the Bazaar!"); + } + } index++; } enchantment.displayLore.remove(0); @@ -506,10 +523,23 @@ public class GuiCustomHex extends Gui { continue; } + boolean aboveMaxLevelFromEt = false; + if (NotEnoughUpdates.INSTANCE.config.enchantingSolvers.maxEnchLevel && Constants.ENCHANTS != null) { + JsonObject maxLevel = null; + if (Constants.ENCHANTS.has("max_xp_table_levels")) { + maxLevel = Constants.ENCHANTS.getAsJsonObject("max_xp_table_levels"); + } + if (maxLevel != null && maxLevel.has(enchId)) { + if (enchantment.level > maxLevel.get(enchId).getAsInt()) { + aboveMaxLevelFromEt = true; + } + } + } + if (enchanterCurrentEnch == null) { enchanterCurrentEnch = enchantment; } else if (updateLevel) { - if (removingEnchantPlayerLevel < 0 && enchantment.level > enchanterCurrentEnch.level) { + if (removingEnchantPlayerLevel < 0 && enchantment.level > enchanterCurrentEnch.level && !aboveMaxLevelFromEt) { enchanterCurrentEnch = enchantment; } else if (removingEnchantPlayerLevel >= 0 && enchantment.level < enchanterCurrentEnch.level) { enchanterCurrentEnch = enchantment; @@ -545,7 +575,7 @@ public class GuiCustomHex extends Gui { ItemStack book = cc.getLowerChestInventory().getStackInSlot(slotIndex); ItemStack xpBottle = cc.getLowerChestInventory().getStackInSlot(50); if (!hasXpBottle && xpBottle != null && - xpBottle.getItem() == Items.experience_bottle) { //Make show when in dungeon screen + xpBottle.getItem() == Items.experience_bottle) { String name = "Buy Xp Bottles"; String id = "XP_BOTTLE"; Enchantment xpBottleEnch = new Enchantment(50, name, id, @@ -565,7 +595,8 @@ public class GuiCustomHex extends Gui { .cleanColour(book.getDisplayName()) .toLowerCase() .replace(" ", "_") - .replace("-", "_"); + .replace("-", "_") + .replaceAll("[^a-z_]", ""); if (enchId.equalsIgnoreCase("_")) continue; enchId = ItemUtils.fixEnchantId(enchId, true); String name = Utils.cleanColour(book.getDisplayName()); @@ -702,7 +733,7 @@ public class GuiCustomHex extends Gui { ItemStack book = cc.getLowerChestInventory().getStackInSlot(slotIndex); ItemStack randomReforge = cc.getLowerChestInventory().getStackInSlot(48); if (!hasRandomReforge && randomReforge != null && - randomReforge.getItem() == Item.getItemFromBlock(Blocks.anvil)) { //Make show when in dungeon screen + randomReforge.getItem() == Item.getItemFromBlock(Blocks.anvil)) { String name = Utils.cleanColour(randomReforge.getDisplayName()); String id = Utils.cleanColour(randomReforge.getDisplayName()); if (name.equals("Convert to Dungeon Item")) { @@ -1639,6 +1670,48 @@ public class GuiCustomHex extends Gui { ); Minecraft.getMinecraft().fontRendererObj.drawString(levelStr, left + 8 - levelWidth / 2, top + 4, colour, false); + String priceStr = "" + numberFormat.format(enchanterCurrentEnch.price) + " Coins"; + if (enchanterCurrentEnch.price < 0) priceStr = ""; + int priceWidth = Minecraft.getMinecraft().fontRendererObj.getStringWidth(priceStr); + int priceTop = guiTop + 16; + int x = 180; + int color = 0x2d2102; + Minecraft.getMinecraft().fontRendererObj.drawString( + priceStr, + guiLeft + x - priceWidth / 2 - 1, + priceTop + 4, + color, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + priceStr, + guiLeft + x - priceWidth / 2 + 1, + priceTop + 4, + color, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + priceStr, + guiLeft + x - priceWidth / 2, + priceTop + 4 - 1, + color, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + priceStr, + guiLeft + x - priceWidth / 2, + priceTop + 4 + 1, + color, + false + ); + Minecraft.getMinecraft().fontRendererObj.drawString( + priceStr, + guiLeft + x - priceWidth / 2, + priceTop + 4, + 0xfcba03, + false + ); + //Enchant name String name = WordUtils.capitalizeFully(ItemUtils .fixEnchantId(enchanterCurrentEnch.enchId, false) @@ -3572,6 +3645,15 @@ public class GuiCustomHex 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: + Gui.drawRect(guiLeft + 295 + 18, guiTop + 147, guiLeft + 295 + 16 + 18, guiTop + 147 + 16, 0x80ffffff); + tooltipToDisplay = createTooltip("Max Level", + (NotEnoughUpdates.INSTANCE.config.enchantingSolvers.maxEnchLevel ? 0 : 1), + "Enabled", "Disabled"); + tooltipToDisplay.add(1, EnumChatFormatting.GRAY + "Show max level of enchant"); + tooltipToDisplay.add(2, EnumChatFormatting.GRAY + "from either hex or enchantment table"); + tooltipToDisplay.add(3, EnumChatFormatting.GRAY + "max level"); + break; case 2: Gui.drawRect(guiLeft + 295, guiTop + 147 + 18, guiLeft + 295 + 16, guiTop + 147 + 16 + 18, 0x80ffffff); tooltipToDisplay = createTooltip("Sort enchants...", @@ -4342,6 +4424,10 @@ public class GuiCustomHex extends Gui { NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableHexGUI = false; break; } + case 1: { + NotEnoughUpdates.INSTANCE.config.enchantingSolvers.maxEnchLevel = !NotEnoughUpdates.INSTANCE.config.enchantingSolvers.maxEnchLevel; + break; + } case 2: { int val = NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enchantSorting; val += direction; 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 306629f7..2990498f 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 @@ -85,6 +85,15 @@ public class Enchanting { @ConfigAccordionId(id = 1) public int enchantOrdering = 0; + @Expose + @ConfigOption( + name = "Use highest level from /et in /hex", + desc = "Show max level from /et in hex instead of highest possible" + ) + @ConfigEditorBoolean() + @ConfigAccordionId(id = 1) + public boolean maxEnchLevel = false; + @ConfigOption( name = "Enchanting Solvers", desc = "" -- cgit From 005f9ef89baa3bde63fcfc188359034606506550 Mon Sep 17 00:00:00 2001 From: Ascynx <78341107+Ascynx@users.noreply.github.com> Date: Thu, 22 Sep 2022 20:56:44 +0200 Subject: Fixed searchString issue (#289) Co-authored-by: nea Co-authored-by: Roman / Nea --- .../moulberry/notenoughupdates/NEUManager.java | 86 +++++++++++++++++++--- .../notenoughupdates/NotEnoughUpdates.java | 4 + .../commands/dev/DevTestCommand.java | 3 +- .../notenoughupdates/commands/dev/DiagCommand.java | 15 ++-- .../miscfeatures/CrystalMetalDetectorSolver.java | 2 +- .../miscfeatures/CrystalWishingCompassSolver.java | 2 +- .../options/customtypes/NEUDebugFlag.java | 52 +++++++++++-- 7 files changed, 140 insertions(+), 24 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java index 5d65d07e..92e2cfd6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -29,6 +29,7 @@ import io.github.moulberry.notenoughupdates.auction.APIManager; import io.github.moulberry.notenoughupdates.events.RepositoryReloadEvent; import io.github.moulberry.notenoughupdates.miscgui.GuiItemRecipe; import io.github.moulberry.notenoughupdates.miscgui.KatSitterOverlay; +import io.github.moulberry.notenoughupdates.options.customtypes.NEUDebugFlag; import io.github.moulberry.notenoughupdates.recipes.CraftingOverlay; import io.github.moulberry.notenoughupdates.recipes.CraftingRecipe; import io.github.moulberry.notenoughupdates.recipes.Ingredient; @@ -394,31 +395,94 @@ public class NEUManager { return getUsagesFor(internalname).stream().filter(NeuRecipe::isAvailable).collect(Collectors.toList()); } + private static class DebugMatch { + int index; + String match; + + DebugMatch(int index, String match) { + this.index = index; + this.match = match; + } + } + + + private String searchDebug(String[] searchArray, ArrayList debugMatches) { + //splitToSearch, debugMatches and query + final String ANSI_RED = "\u001B[31m"; + final String ANSI_RESET = "\u001B[0m"; + final String ANSI_YELLOW = "\u001B[33m"; + + //create debug message + StringBuilder debugBuilder = new StringBuilder(); + for (int i = 0; i < searchArray.length; i++) { + final int fi = i; + Object[] matches = debugMatches.stream().filter((d) -> d.index == fi).toArray(); + + if (matches.length > 0) { + debugBuilder.append(ANSI_YELLOW + "[").append(((DebugMatch) matches[0]).match).append("]"); + debugBuilder.append(ANSI_RED + "[").append(searchArray[i]).append("]").append(ANSI_RESET).append(" "); + } else { + debugBuilder.append(searchArray[i]).append(" "); + } + } + + //yellow = query match and red = string match + return debugBuilder.toString(); + } + /** * Searches a string for a query. This method is used to mimic the behaviour of the more complex map-based search * function. This method is used for the chest-item-search feature. */ public boolean searchString(String toSearch, String query) { - int lastQueryMatched = -1; + final String ANSI_RESET = "\u001B[0m"; + final String ANSI_YELLOW = "\u001B[33m"; + + int lastStringMatch = -1; + ArrayList debugMatches = new ArrayList<>(); toSearch = clean(toSearch).toLowerCase(); query = clean(query).toLowerCase(); String[] splitToSearch = toSearch.split(" "); String[] queryArray = query.split(" "); - out: - for (int j = 0; j < queryArray.length; j++) { - for (int i = 0; i < splitToSearch.length; i++) { - if ((queryArray.length - (lastQueryMatched != -1 ? lastQueryMatched : 0)) > (splitToSearch.length - i)) continue; - if (splitToSearch[i].startsWith(queryArray[j])) { - lastQueryMatched = j; - continue out; + { + String currentSearch = queryArray[0]; + int queryIndex = 0; + boolean matchedLastQueryItem = false; + + for (int k = 0; k < splitToSearch.length; k++) { + if (queryIndex - 1 != -1 && (queryArray.length - queryIndex) > (splitToSearch.length - k)) continue; + if (splitToSearch[k].startsWith(currentSearch)) { + if (((lastStringMatch != -1 ? lastStringMatch : k-1) == k-1)) { + debugMatches.add(new DebugMatch(k, currentSearch)); + lastStringMatch = k; + if (queryIndex+1 != queryArray.length) { + queryIndex++; + currentSearch = queryArray[queryIndex]; + } else { + matchedLastQueryItem = true; + } + } + } else if (queryIndex != 0) { + queryIndex = 0; + currentSearch = queryArray[queryIndex]; + lastStringMatch = -1; } } - return false; - } - return true; + if (matchedLastQueryItem) { + if (NEUDebugFlag.SEARCH.isSet()) { + NotEnoughUpdates.LOGGER.info("Found match for \"" + ANSI_YELLOW + query + ANSI_RESET + "\":\n\t" + searchDebug(splitToSearch, debugMatches)); + } + } else { + if (NEUDebugFlag.SEARCH.isSet() && lastStringMatch != -1) { + NotEnoughUpdates.LOGGER.info("Found partial match for \"" + ANSI_YELLOW + query + ANSI_RESET + "\":\n\t" + searchDebug(splitToSearch, debugMatches)); + } + } + + return matchedLastQueryItem; + } } /** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index c4b1bd77..b06f2ab2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -99,6 +99,8 @@ import net.minecraftforge.fml.common.Mod.EventHandler; import net.minecraftforge.fml.common.event.FMLPreInitializationEvent; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import net.minecraftforge.fml.common.gameevent.TickEvent; +import org.apache.logging.log4j.LogManager; +import org.apache.logging.log4j.Logger; import java.awt.*; import java.io.BufferedReader; @@ -119,6 +121,8 @@ public class NotEnoughUpdates { public static final int VERSION_ID = 20100; public static final int PRE_VERSION_ID = 0; public static final int HOTFIX_VERSION_ID = 0; + + public static final Logger LOGGER = LogManager.getLogger("NotEnoughUpdates"); /** * Registers the biomes for the crystal hollows here so optifine knows they exists */ diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java index 2a5e3305..972557c8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java @@ -58,7 +58,8 @@ public class DevTestCommand extends ClientCommandBase { "lulonaut", "craftyoldminer", "eisengolem", - "whalker" + "whalker", + "ascynx" ); private static final String[] DEV_FAIL_STRINGS = { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DiagCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DiagCommand.java index 326c00b4..fb546efb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DiagCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DiagCommand.java @@ -41,7 +41,8 @@ public class DiagCommand extends ClientCommandBase { " center= Disable / enable using center\n" + "/neudiag wishing Wishing Compass Solver diagnostics\n" + "/neudiag debug\n" + - " Show current flags\n" + + " Show all enabled flags\n" + + " Show all flags\n"+ " Enable/disable flag\n"; private void showUsage(ICommandSender sender) { @@ -86,6 +87,10 @@ public class DiagCommand extends ClientCommandBase { boolean enablingFlag = true; String action = args[1]; switch (action) { + case "list": + sender.addChatMessage(new ChatComponentText( + EnumChatFormatting.YELLOW + "Here are all flags:\n" + NEUDebugFlag.getFlagList())); + return; case "disable": enablingFlag = false; // falls through @@ -93,7 +98,7 @@ public class DiagCommand extends ClientCommandBase { if (args.length != 3) { sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + "You must specify a flag:\n" + - NEUDebugFlag.FLAG_LIST)); + NEUDebugFlag.getFlagList())); return; } @@ -108,7 +113,7 @@ public class DiagCommand extends ClientCommandBase { } catch (IllegalArgumentException e) { sender.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + flagName + " is invalid. Valid flags are:\n" + - NEUDebugFlag.FLAG_LIST)); + NEUDebugFlag.getFlagList())); return; } break; @@ -118,8 +123,8 @@ public class DiagCommand extends ClientCommandBase { } } - sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Effective debug flags: " + - NotEnoughUpdates.INSTANCE.config.hidden.debugFlags.toString())); + sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Effective debug flags: \n" + + NEUDebugFlag.getEnabledFlags())); break; default: showUsage(sender); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java index 167b6a2f..ab9345cb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalMetalDetectorSolver.java @@ -170,7 +170,7 @@ public class CrystalMetalDetectorSolver { // falls through case FOUND: mc.thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "[NEU] Found solution.")); - if (NotEnoughUpdates.INSTANCE.config.hidden.debugFlags.contains(NEUDebugFlag.METAL) && + if (NEUDebugFlag.METAL.isSet() && (previousState == SolutionState.INVALID || previousState == SolutionState.FAILED)) { NEUDebugLogger.log( NEUDebugFlag.METAL, diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java index 19cf9c09..07f19a60 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java @@ -923,7 +923,7 @@ public class CrystalWishingCompassSolver { return; } - boolean wishingDebugFlagSet = NotEnoughUpdates.INSTANCE.config.hidden.debugFlags.contains(NEUDebugFlag.WISHING); + boolean wishingDebugFlagSet = NEUDebugFlag.WISHING.isSet(); if (outputAlways || wishingDebugFlagSet) { NEUDebugLogger.logAlways(getDiagnosticMessage()); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/customtypes/NEUDebugFlag.java b/src/main/java/io/github/moulberry/notenoughupdates/options/customtypes/NEUDebugFlag.java index 8e0e4c11..50f459c0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/customtypes/NEUDebugFlag.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/customtypes/NEUDebugFlag.java @@ -19,13 +19,55 @@ package io.github.moulberry.notenoughupdates.options.customtypes; +import io.github.moulberry.notenoughupdates.util.NEUDebugLogger; + +import java.util.Arrays; +import java.util.List; +import java.util.stream.Collectors; + public enum NEUDebugFlag { // NOTE: Removing enum values causes gson to remove all debugFlags on load if any removed value is present - METAL, - WISHING, + METAL("Metal Detector Solver"), + WISHING("Wishing Compass Solver"), + MAP("Dungeon Map Player Information"), + SEARCH("SearchString Matches"), ; - public static final String FLAG_LIST = - "METAL - Metal Detector Solver\n" + - "WISHING - Wishing Compass Solver"; + private final String description; + + NEUDebugFlag(String description) { + this.description = description; + } + + public String getDescription() { + return description; + } + + public boolean isSet() { + return NEUDebugLogger.isFlagEnabled(this); + } + + public static String getFlagList() { + return renderFlagInformation(Arrays.asList(values())); + } + + public static String getEnabledFlags() { + return renderFlagInformation(Arrays.stream(values()) + .filter(NEUDebugFlag::isSet) + .collect(Collectors.toList())); + } + + public static String renderFlagInformation(List flags) { + int maxNameLength = flags.stream() + .mapToInt(it -> it.name().length()) + .max() + .orElse(0); + return flags.stream() + .map(it -> (CharSequence) String.format( + "%-" + maxNameLength + "s" + " - %s", + it.name(), + it.getDescription() + )) + .collect(Collectors.joining("\n")); + } } -- cgit From 21a353f09edc1623d339dd9f7eea639b35891d57 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Fri, 23 Sep 2022 15:08:16 +0200 Subject: probably game changing rng meter changes (#295) * probably game changing rng meter changes * Updating the rng score with data from repo. This is needed since hypixel doesn't show the exact values for selected items. (Only 3k instead of 3,100) --- .../listener/ItemTooltipRngListener.java | 71 +++++++++++++++++++--- .../moulberry/notenoughupdates/util/Constants.java | 2 + .../notenoughupdates/util/ItemResolutionQuery.java | 38 +++++++++++- 3 files changed, 103 insertions(+), 8 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java index bbbb9049..fdae53ea 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipRngListener.java @@ -27,6 +27,8 @@ import io.github.moulberry.notenoughupdates.events.RepositoryReloadEvent; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.util.Calculator; import io.github.moulberry.notenoughupdates.util.Constants; +import io.github.moulberry.notenoughupdates.util.ItemResolutionQuery; +import io.github.moulberry.notenoughupdates.util.ItemUtils; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.item.ItemStack; import net.minecraftforge.event.entity.player.ItemTooltipEvent; @@ -135,14 +137,18 @@ public class ItemTooltipRngListener { event.toolTip.addAll(newToolTip); } - private String getFormatCoinsPer(ItemStack stack, int needed, int multiplier, String name) { - String internalName = neu.manager.getInternalNameForItem(stack); - double bin = neu.manager.auctionManager.getBazaarOrBin(internalName); - if (bin <= 0) return null; + private String getFormatCoinsPer(ItemStack stack, int needed, int multiplier, String label) { + String internalName = neu.manager.createItemResolutionQuery().withItemStack(stack).resolveInternalName(); + double profit = neu.manager.auctionManager.getBazaarOrBin(internalName); + if (profit <= 0) return null; - double coinsPer = (bin / needed) * multiplier; + //ask hypixel nicely to release a 'chest price api' with 4 dimensions for us. the 4 dimensions needed are: item name, floor, normal/mm, s/s+ +// double chestPrice = grabChestPrice(stack, internalName); +// profit -= chestPrice; + + double coinsPer = (profit / needed) * multiplier; String format = StringUtils.shortNumberFormat(coinsPer); - return "§7Coins per " + name + ": §6" + format + " coins"; + return "§7Coins per " + label + ": §6" + format + " coins"; } private void fractionDisplay(List newToolTip, String line) { @@ -256,10 +262,12 @@ public class ItemTooltipRngListener { Map runsData; String labelPlural; String labelSingular; + String repoCategory; if (openChestName.contains("Catacombs")) { runsData = dungeonData; labelPlural = "Runs"; labelSingular = "Run"; + repoCategory = "catacombs"; } else { // Slayer Matcher matcher = SLAYER_INVENTORY_TITLE_PATTERN.matcher(openChestName); if (!matcher.matches()) { @@ -271,6 +279,12 @@ public class ItemTooltipRngListener { runsData = slayerData.get(slayerName); labelPlural = "Bosses"; labelSingular = "Boss"; + repoCategory = "slayer"; + } + + int repoScore = getRepoScore(stack, repoCategory); + if (repoScore != -1) { + needed = repoScore; } handleArrowKeys(runsData); @@ -282,7 +296,7 @@ public class ItemTooltipRngListener { String name = (String) runsData.keySet().toArray()[currentSelected]; int gainPerRun = runsData.get(name); - int runsNeeded = needed / gainPerRun; + int runsNeeded = (int) Math.floor((double) needed / (double) gainPerRun); int runsHaving = having / gainPerRun; String runsNeededFormat = GuiProfileViewer.numberFormat.format(runsNeeded); String runsHavingFormat = GuiProfileViewer.numberFormat.format(runsHaving); @@ -309,6 +323,49 @@ public class ItemTooltipRngListener { } } + private int getRepoScore(ItemStack stack, String repoCategory) { + ItemResolutionQuery query = + NotEnoughUpdates.INSTANCE.manager.createItemResolutionQuery().withItemStack(stack).withCurrentGuiContext(); + String internalName = query.resolveInternalName(); + + JsonObject jsonObject = Constants.RNGSCORE; + if (jsonObject == null) { + Utils.showOutdatedRepoNotification(); + return -1; + } + + String repoType = grabRepoType(stack); + if (!jsonObject.has(repoCategory)) return -1; + + JsonObject category = jsonObject.get(repoCategory).getAsJsonObject(); + if (!category.has(repoType)) return -1; + + JsonObject typeObject = category.get(repoType).getAsJsonObject(); + if (!typeObject.has(internalName)) return -1; + + return typeObject.get(internalName).getAsInt(); + } + + // Determines the floor or the slayer type from where the item can be obtained. E.g. F7, M3, Revenant Horror or Sven Packmaster + private String grabRepoType(ItemStack stack) { + String openChestName = Utils.getOpenChestName(); + if (openChestName.contains("Catacombs")) { + if (openChestName.equals("Catacombs RNG Meter")) { + List list = ItemUtils.getLore(stack); + String line = list.get(4); + return line.substring(26, 28); + } else { + // supporting more pages (f7/m7) + if (openChestName.contains("(")) { + return openChestName.substring(17, 19); + } + return openChestName.substring(11, 13); + } + } else { + return openChestName.substring(0, openChestName.length() - 9); + } + } + private void handleArrowKeys(Map runsData) { boolean left = Keyboard.isKeyDown(Keyboard.KEY_LEFT); boolean right = Keyboard.isKeyDown(Keyboard.KEY_RIGHT); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java index 1d226dc8..ef030367 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Constants.java @@ -71,6 +71,7 @@ public class Constants { public static JsonObject REFORGESTONES; public static JsonObject TROPHYFISH; public static JsonObject WEIGHT; + public static JsonObject RNGSCORE; private static final ReentrantLock lock = new ReentrantLock(); @@ -92,6 +93,7 @@ public class Constants { REFORGESTONES = Utils.getConstant("reforgestones", gson); TROPHYFISH = Utils.getConstant("trophyfish", gson); WEIGHT = Utils.getConstant("weight", gson); + RNGSCORE = Utils.getConstant("rngscore", gson); } catch (Exception ex) { ex.printStackTrace(); } finally { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java index 48eb6fad..75086b1f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java @@ -19,10 +19,11 @@ package io.github.moulberry.notenoughupdates.util; -import com.google.common.collect.Iterables; import com.google.gson.JsonObject; import com.google.gson.JsonParseException; import io.github.moulberry.notenoughupdates.NEUManager; +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.core.util.StringUtils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; import net.minecraft.client.gui.inventory.GuiChest; @@ -37,6 +38,7 @@ import javax.annotation.Nullable; import java.util.Arrays; import java.util.List; import java.util.Locale; +import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -170,6 +172,40 @@ public class ItemResolutionQuery { } return null; } + if (guiName.equals("Catacombs RNG Meter")) { + return resolveItemInCatacombsRngMeter(); + } + return null; + } + + private String resolveItemInCatacombsRngMeter() { + List lore = ItemUtils.getLore(compound); + if (lore.size() > 16) { + String s = lore.get(15); + if (s.equals("§7Selected Drop")) { + String displayName = lore.get(16); + return getInternalNameByDisplayName(displayName); + } + } + + return null; + } + + private String getInternalNameByDisplayName(String displayName) { + String cleanDisplayName = StringUtils.cleanColour(displayName); + for (Map.Entry entry : NotEnoughUpdates.INSTANCE.manager + .getItemInformation() + .entrySet()) { + + JsonObject object = entry.getValue(); + if (object.has("displayname")) { + String name = object.get("displayname").getAsString(); + if (StringUtils.cleanColour(name).equals(cleanDisplayName)) { + return entry.getKey(); + } + } + } + return null; } -- cgit From 61c53c0054431e75826d071dfb363406b5763195 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 23 Sep 2022 23:33:16 +1000 Subject: Pet overlay fixes (#290) * fixed pet overlay going to level 100 * fixed transparent pet and equip overlay not using the special texture fixed pet overlay showing a pet when you remove your pet * made pet overlay show the current stats of your pet * Fixed pet overlay showing Until level 100.0 * Fixed pet stats not showing decimal * Made pet overlay show xp to next level * 2.1.md slight smile * Try to generify pet lore replacements a tiny bit Also move pets page to use the same code as the pet overlay Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Co-authored-by: nea --- Update Notes/2.1.md | 1 + .../moulberry/notenoughupdates/NEUManager.java | 3 +- .../listener/ItemTooltipListener.java | 72 +++--- .../miscfeatures/PetInfoOverlay.java | 9 +- .../overlays/EquipmentOverlay.java | 11 +- .../notenoughupdates/profileviewer/PetsPage.java | 266 ++----------------- .../notenoughupdates/util/ItemResolutionQuery.java | 7 + .../moulberry/notenoughupdates/util/ItemUtils.java | 284 ++++++++++++++++++++- 8 files changed, 368 insertions(+), 285 deletions(-) diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index 99b2eef0..1c623928 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -157,6 +157,7 @@ - Fixed skill average calculation to include carpentry in /peek - whalker - Fixed middle clicking on pets not registering pet swap - nopo - Fixed middle clicking on an item with no id searching for it - nopo +- Fixed pets with decimal stats not showing in pv - nopo ### **Other:** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java index 92e2cfd6..62b24111 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -1380,7 +1380,7 @@ public class NEUManager { float statMax = entry.getValue().getAsFloat(); float statMin = min.get("statNums").getAsJsonObject().get(entry.getKey()).getAsFloat(); float val = statMin * minMix + statMax * maxMix; - String statStr = (statMin > 0 ? "+" : "") + (int) Math.floor(val); + String statStr = (statMin > 0 ? "+" : "") + removeUnusedDecimal(Math.floor(val * 10) / 10); replacements.put(entry.getKey(), statStr); } } @@ -1457,6 +1457,7 @@ public class NEUManager { } public ItemStack jsonToStack(JsonObject json, boolean useCache, boolean useReplacements, boolean copyStack) { + if (useReplacements) useCache = false; if (json == null) return new ItemStack(Items.painting, 1, 10); String internalname = json.get("internalname").getAsString(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java index c522e70a..d89e886f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ItemTooltipListener.java @@ -55,7 +55,6 @@ import java.awt.datatransfer.StringSelection; import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.ArrayList; -import java.util.Collections; import java.util.HashMap; import java.util.HashSet; import java.util.List; @@ -67,7 +66,7 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; public class ItemTooltipListener { - private static final String petToolTipRegex = + public static final String petToolTipRegex = "((Farming)|(Combat)|(Fishing)|(Mining)|(Foraging)|(Enchanting)|(Alchemy)) ((Mount)|(Pet)|(Morph)).*"; private final NotEnoughUpdates neu; private final Pattern xpLevelPattern = Pattern.compile("(.*) (\\xA7e(.*)\\xA76/\\xA7e(.*))"); @@ -711,45 +710,44 @@ public class ItemTooltipListener { } private void petToolTipXPExtendPetMenu(ItemTooltipEvent event) { - if (NotEnoughUpdates.INSTANCE.config.tooltipTweaks.petExtendExp) { - //7 is just a random number i chose, prob no pets with less lines than 7 - if (event.toolTip.size() > 7) { - if (Utils.cleanColour(event.toolTip.get(1)).matches(petToolTipRegex)) { - GuiProfileViewer.PetLevel petLevel; - - int xpLine = -1; - for (int i = event.toolTip.size() - 1; i >= 0; i--) { - Matcher matcher = xpLevelPattern.matcher(event.toolTip.get(i)); - if (matcher.matches()) { - xpLine = i; - event.toolTip.set(xpLine, matcher.group(1)); - break; - } else if (event.toolTip.get(i).matches("MAX LEVEL")) { - return; - } - } + if (!NotEnoughUpdates.INSTANCE.config.tooltipTweaks.petExtendExp) return; + //7 is just a random number i chose, prob no pets with less lines than 7 + if (event.toolTip.size() < 7) return; + if (event.itemStack.getTagCompound().hasKey("NEUHIDEPETTOOLTIP")) return; + if (Utils.cleanColour(event.toolTip.get(1)).matches(petToolTipRegex)) { + GuiProfileViewer.PetLevel petLevel; + + int xpLine = -1; + for (int i = event.toolTip.size() - 1; i >= 0; i--) { + Matcher matcher = xpLevelPattern.matcher(event.toolTip.get(i)); + if (matcher.matches()) { + xpLine = i; + event.toolTip.set(xpLine, matcher.group(1)); + break; + } else if (event.toolTip.get(i).matches("MAX LEVEL")) { + return; + } + } - PetInfoOverlay.Pet pet = PetInfoOverlay.getPetFromStack( - event.itemStack.getTagCompound() - ); - if (pet == null) { - return; - } - petLevel = pet.petLevel; + PetInfoOverlay.Pet pet = PetInfoOverlay.getPetFromStack( + event.itemStack.getTagCompound() + ); + if (pet == null) { + return; + } + petLevel = pet.petLevel; - if (petLevel == null || xpLine == -1) { - return; - } + if (petLevel == null || xpLine == -1) { + return; + } - event.toolTip.add( - xpLine + 1, - EnumChatFormatting.GRAY + "EXP: " + EnumChatFormatting.YELLOW + myFormatter.format(petLevel.levelXp) + - EnumChatFormatting.GOLD + "/" + EnumChatFormatting.YELLOW + - myFormatter.format(petLevel.currentLevelRequirement) - ); + event.toolTip.add( + xpLine + 1, + EnumChatFormatting.GRAY + "EXP: " + EnumChatFormatting.YELLOW + myFormatter.format(petLevel.levelXp) + + EnumChatFormatting.GOLD + "/" + EnumChatFormatting.YELLOW + + myFormatter.format(petLevel.currentLevelRequirement) + ); - } - } } } 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 14a136a2..499448fa 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java @@ -133,10 +133,11 @@ public class PetInfoOverlay extends TextOverlay { public String petXpType; public String petItem; public String skin; + public int candyUsed; public String getPetId(boolean withoutBoost) { - return petType + ";" + (withoutBoost ? rarity.petId - 1 : rarity.petId); - + boolean shouldDecreaseRarity = withoutBoost && "PET_ITEM_TIER_BOOST".equals(petItem); + return petType + ";" + (shouldDecreaseRarity ? rarity.petId - 1 : rarity.petId); } } @@ -466,10 +467,10 @@ public class PetInfoOverlay extends TextOverlay { float remainingMax = currentPet.petLevel.maxXP - currentPet.petLevel.totalXp; if (remaining > 0) { if (xpGain < 1000) { - etaMaxStr = EnumChatFormatting.AQUA + "Until L" + currentPet.petLevel.maxLevel + ": " + + etaMaxStr = EnumChatFormatting.AQUA + "Until L" + (int) currentPet.petLevel.maxLevel + ": " + EnumChatFormatting.YELLOW + "N/A"; } else { - etaMaxStr = EnumChatFormatting.AQUA + "Until L" + currentPet.petLevel.maxLevel + ": " + + etaMaxStr = EnumChatFormatting.AQUA + "Until L" + (int) currentPet.petLevel.maxLevel + ": " + EnumChatFormatting.YELLOW + Utils.prettyTime((long) (remainingMax) * 1000 * 60 * 60 / (long) xpGain); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java index 2d3175b5..d64dbe01 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java @@ -106,7 +106,7 @@ public class EquipmentOverlay { case 2: return ARMOR_DISPLAY_DARK; case 3: - return isPetRendering ? ARMOR_DISPLAY_TRANSPARENT_PET : ARMOR_DISPLAY_TRANSPARENT; + return NotEnoughUpdates.INSTANCE.config.petOverlay.colourStyle == 3 && isPetRendering ? ARMOR_DISPLAY_TRANSPARENT_PET : ARMOR_DISPLAY_TRANSPARENT; case 4: return ARMOR_DISPLAY_FSR; } @@ -191,7 +191,7 @@ public class EquipmentOverlay { int overlayLeft = container.getGuiLeft() - ARMOR_OVERLAY_OVERHAND_WIDTH; int overlayTop = container.getGuiTop(); - ResourceLocation equipmentTexture = getCustomEquipmentTexture(isRenderingPet); + ResourceLocation equipmentTexture = getCustomEquipmentTexture(shouldRenderPets); Minecraft.getMinecraft().getTextureManager().bindTexture(equipmentTexture); Utils.drawTexturedRect(overlayLeft, overlayTop, ARMOR_OVERLAY_WIDTH, ARMOR_OVERLAY_HEIGHT, GL11.GL_NEAREST); @@ -243,7 +243,10 @@ public class EquipmentOverlay { NEUManager manager = NotEnoughUpdates.INSTANCE.manager; PetInfoOverlay.Pet currentPet = PetInfoOverlay.getCurrentPet(); if (currentPet == null) return null; - ItemStack item = manager.createItem(currentPet.getPetId(false)); + + ItemStack item = ItemUtils.createPetItemstackFromPetInfo(currentPet); + item = ItemUtils.petToolTipXPExtendPetOverlay(item); + if (item != null) { return item; } @@ -259,7 +262,7 @@ public class EquipmentOverlay { slot4 = getWardrobeSlot(37); } - if (screen instanceof GuiChest) { + if (screen instanceof GuiChest || screen instanceof GuiInventory) { petStack = getRepoPetStack(); } if ((!(screen instanceof GuiInventory) && !(screen instanceof GuiInvButtonEditor)) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PetsPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PetsPage.java index 25751ab8..cb85bf79 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PetsPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/PetsPage.java @@ -22,22 +22,17 @@ package io.github.moulberry.notenoughupdates.profileviewer; import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParser; -import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.util.StringUtils; +import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; import io.github.moulberry.notenoughupdates.util.Constants; +import io.github.moulberry.notenoughupdates.util.ItemUtils; import io.github.moulberry.notenoughupdates.util.SBInfo; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.client.renderer.GlStateManager; -import net.minecraft.init.Items; import net.minecraft.item.ItemStack; -import net.minecraft.nbt.JsonToNBT; -import net.minecraft.nbt.NBTException; import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.nbt.NBTTagString; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import org.lwjgl.input.Mouse; @@ -46,11 +41,7 @@ import org.lwjgl.opengl.GL11; import java.awt.*; import java.io.IOException; import java.util.ArrayList; -import java.util.Base64; -import java.util.HashMap; import java.util.List; -import java.util.Map; -import java.util.UUID; public class PetsPage extends GuiProfileViewerPage { @@ -91,7 +82,8 @@ public class PetsPage extends GuiProfileViewerPage { String panoramaIdentifier = "day"; if (SBInfo.getInstance().currentTimeDate != null) { - if (SBInfo.getInstance().currentTimeDate.getHours() <= 6 || SBInfo.getInstance().currentTimeDate.getHours() >= 20) { + if (SBInfo.getInstance().currentTimeDate.getHours() <= 6 || + SBInfo.getInstance().currentTimeDate.getHours() >= 20) { panoramaIdentifier = "night"; } } @@ -123,201 +115,22 @@ public class PetsPage extends GuiProfileViewerPage { } }); for (JsonObject pet : sortedPets) { - String petname = pet.get("type").getAsString(); - String tier = pet.get("tier").getAsString(); - String heldItem = Utils.getElementAsString(pet.get("heldItem"), null); - String skin = Utils.getElementAsString(pet.get("skin"), null); - int candy = pet.get("candyUsed").getAsInt(); - JsonObject heldItemJson = heldItem == null ? null : NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(heldItem); - String tierNum = GuiProfileViewer.MINION_RARITY_TO_NUM.get(tier); - float exp = pet.get("exp").getAsFloat(); - if (tierNum == null) continue; - - if ( - pet.has("heldItem") && - !pet.get("heldItem").isJsonNull() && - pet.get("heldItem").getAsString().equals("PET_ITEM_TIER_BOOST") - ) { - tierNum = "" + (Integer.parseInt(tierNum) + 1); - } - - GuiProfileViewer.PetLevel levelObj = GuiProfileViewer.getPetLevel(petname, tier, exp); - - float level = levelObj.level; - float currentLevelRequirement = levelObj.currentLevelRequirement; - float maxXP = levelObj.maxXP; - pet.addProperty("level", level); - pet.addProperty("currentLevelRequirement", currentLevelRequirement); - pet.addProperty("maxXP", maxXP); - - JsonObject petItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(petname + ";" + tierNum); - ItemStack stack; - if (petItem == null) { - stack = getQuestionmarkSkull(); - NBTTagCompound display = new NBTTagCompound(); - if (stack.getTagCompound() != null && stack.getTagCompound().hasKey("display")) { - display = stack.getTagCompound().getCompoundTag("display"); - } - NBTTagList lore = new NBTTagList(); - lore.appendTag(new NBTTagString(EnumChatFormatting.RED + "This pet is not saved in the repository")); - lore.appendTag(new NBTTagString("")); - lore.appendTag(new NBTTagString(EnumChatFormatting.RED + "If you expected it to be there please send a message in")); - lore.appendTag( - new NBTTagString( - EnumChatFormatting.RED.toString() + - EnumChatFormatting.BOLD + - "#neu-support " + - EnumChatFormatting.RESET + - EnumChatFormatting.RED + - "on " + - EnumChatFormatting.BOLD + - "discord.gg/moulberry" - ) - ); - - display.setTag("Lore", lore); - NBTTagCompound tag = stack.getTagCompound() != null ? stack.getTagCompound() : new NBTTagCompound(); - tag.setTag("display", display); - stack.setTagCompound(tag); - } else { - stack = NotEnoughUpdates.INSTANCE.manager.jsonToStack(petItem, false, false); - HashMap replacements = NotEnoughUpdates.INSTANCE.manager.getLoreReplacements( - petname, - tier, - (int) Math.floor(level) - ); - - if (heldItem != null) { - HashMap petStatBoots = GuiProfileViewer.PET_STAT_BOOSTS.get(heldItem); - HashMap petStatBootsMult = GuiProfileViewer.PET_STAT_BOOSTS_MULT.get(heldItem); - if (petStatBoots != null) { - for (Map.Entry entryBoost : petStatBoots.entrySet()) { - try { - float value = Float.parseFloat(replacements.get(entryBoost.getKey())); - replacements.put(entryBoost.getKey(), String.valueOf((int) Math.floor(value + entryBoost.getValue()))); - } catch (Exception ignored) {} - } - } - if (petStatBootsMult != null) { - for (Map.Entry entryBoost : petStatBootsMult.entrySet()) { - try { - float value = Float.parseFloat(replacements.get(entryBoost.getKey())); - replacements.put(entryBoost.getKey(), String.valueOf((int) Math.floor(value * entryBoost.getValue()))); - } catch (Exception ignored) {} - } - } - } - - NBTTagCompound tag = stack.getTagCompound() == null ? new NBTTagCompound() : stack.getTagCompound(); - if (tag.hasKey("display", 10)) { - NBTTagCompound display = tag.getCompoundTag("display"); - if (display.hasKey("Lore", 9)) { - NBTTagList newLore = new NBTTagList(); - NBTTagList lore = display.getTagList("Lore", 8); - HashMap blankLocations = new HashMap<>(); - for (int j = 0; j < lore.tagCount(); j++) { - String line = lore.getStringTagAt(j); - if (line.trim().isEmpty()) { - blankLocations.put(blankLocations.size(), j); - } - for (Map.Entry replacement : replacements.entrySet()) { - line = line.replace("{" + replacement.getKey() + "}", replacement.getValue()); - } - newLore.appendTag(new NBTTagString(line)); - } - Integer secondLastBlank = blankLocations.get(blankLocations.size() - 2); - if (skin != null) { - JsonObject petSkin = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get("PET_SKIN_" + skin); - if (petSkin != null) { - try { - NBTTagCompound nbt = JsonToNBT.getTagFromJson(petSkin.get("nbttag").getAsString()); - tag.setTag("SkullOwner", nbt.getTag("SkullOwner")); - String name = petSkin.get("displayname").getAsString(); - if (name != null) { - name = Utils.cleanColour(name); - newLore.set(0, new NBTTagString(newLore.get(0).toString().replace("\"", "") + ", " + name)); - } - } catch (NBTException e) { - e.printStackTrace(); - } - } - } - for (int i = 0; i < newLore.tagCount(); i++) { - String cleaned = Utils.cleanColour(newLore.get(i).toString()); - if (cleaned.equals("\"Right-click to add this pet to\"")) { - newLore.removeTag(i + 1); - newLore.removeTag(i); - secondLastBlank = i - 1; - break; - } - } - NBTTagList temp = new NBTTagList(); - for (int i = 0; i < newLore.tagCount(); i++) { - temp.appendTag(newLore.get(i)); - if (secondLastBlank != null && i == secondLastBlank) { - if (heldItem != null) { - temp.appendTag( - new NBTTagString( - EnumChatFormatting.GOLD + "Held Item: " + heldItemJson.get("displayname").getAsString() - ) - ); - int blanks = 0; - JsonArray heldItemLore = heldItemJson.get("lore").getAsJsonArray(); - for (int k = 0; k < heldItemLore.size(); k++) { - String heldItemLine = heldItemLore.get(k).getAsString(); - if (heldItemLine.trim().isEmpty()) { - blanks++; - } else if (blanks == 2) { - temp.appendTag(new NBTTagString(heldItemLine)); - } else if (blanks > 2) { - break; - } - } - temp.appendTag(new NBTTagString()); - } - if (candy != 0) { - temp.appendTag(new NBTTagString(EnumChatFormatting.GREEN + "(" + candy + "/10) Pet Candy Used")); - temp.appendTag(new NBTTagString()); - } - temp.removeTag(temp.tagCount() - 1); - } - } - newLore = temp; - display.setTag("Lore", newLore); - } - if (display.hasKey("Name", 8)) { - String displayName = display.getString("Name"); - for (Map.Entry replacement : replacements.entrySet()) { - displayName = displayName.replace("{" + replacement.getKey() + "}", replacement.getValue()); - } - display.setTag("Name", new NBTTagString(displayName)); - } - tag.setTag("display", display); - } - - // Adds the missing pet fields to the tag - NBTTagCompound extraAttributes = new NBTTagCompound(); - JsonObject petInfo = new JsonObject(); - if(tag.hasKey("ExtraAttributes", 10)) { - extraAttributes = tag.getCompoundTag("ExtraAttributes"); - if (extraAttributes.hasKey("petInfo", 8)) { - petInfo = new JsonParser().parse(extraAttributes.getString("petInfo")).getAsJsonObject(); - } - } - petInfo.addProperty("exp", exp); - petInfo.addProperty("tier", tier); - petInfo.addProperty("type", petname); - if (heldItem != null) { - petInfo.addProperty("heldItem", heldItem); - } - if (skin != null) { - petInfo.addProperty("skin", skin); - } - extraAttributes.setString("petInfo", petInfo.toString()); - tag.setTag("ExtraAttributes", extraAttributes); - stack.setTagCompound(tag); - } - sortedPetsStack.add(stack); + PetInfoOverlay.Pet parsedPet = new PetInfoOverlay.Pet(); + parsedPet.petType = pet.get("type").getAsString(); + parsedPet.rarity = PetInfoOverlay.Rarity.valueOf(pet.get("tier").getAsString()); + parsedPet.petLevel = GuiProfileViewer.getPetLevel( + parsedPet.petType, + parsedPet.rarity.name(), + pet.get("exp").getAsFloat() + ); + parsedPet.petXpType = "unknown"; + parsedPet.petItem = Utils.getElementAsString(pet.get("heldItem"), null); + parsedPet.skin = Utils.getElementAsString(pet.get("skin"), null); + parsedPet.candyUsed = pet.get("candyUsed").getAsInt(); + sortedPetsStack.add(ItemUtils.createPetItemstackFromPetInfo(parsedPet)); + pet.addProperty("level", parsedPet.petLevel.level); + pet.addProperty("currentLevelRequirement", parsedPet.petLevel.currentLevelRequirement); + pet.addProperty("maxXP", parsedPet.petLevel.maxXP); } } @@ -396,7 +209,11 @@ public class PetsPage extends GuiProfileViewerPage { ); } - for (int i = petsPage * 20; i < Math.min(petsPage * 20 + 20, Math.min(sortedPetsStack.size(), sortedPets.size())); i++) { + for ( + int i = petsPage * 20; + i < Math.min(petsPage * 20 + 20, Math.min(sortedPetsStack.size(), sortedPets.size())); + i++ + ) { JsonObject pet = sortedPets.get(i); ItemStack stack = sortedPetsStack.get(i); @@ -433,7 +250,7 @@ public class PetsPage extends GuiProfileViewerPage { if (selectedPet >= 0) { ItemStack petStack; if (sortedPetsStack.size() <= selectedPet) { - petStack = getQuestionmarkSkull(); + petStack = ItemUtils.createQuestionMarkSkull("§cInvalid pet selection"); } else { petStack = sortedPetsStack.get(selectedPet); } @@ -441,7 +258,8 @@ public class PetsPage extends GuiProfileViewerPage { JsonObject pet = sortedPets.get(selectedPet); int x = guiLeft + 280; - float y = guiTop + 67 + 15 * (float) Math.sin(((getInstance().currentTime - getInstance().startTime) / 800f) % (2 * Math.PI)); + float y = guiTop + 67 + 15 * (float) Math.sin( + ((getInstance().currentTime - getInstance().startTime) / 800f) % (2 * Math.PI)); int displayLen = Minecraft.getMinecraft().fontRendererObj.getStringWidth(display); int halfDisplayLen = displayLen / 2; @@ -568,32 +386,4 @@ public class PetsPage extends GuiProfileViewerPage { sortedPetsStack = null; selectedPet = -1; } - - private ItemStack getQuestionmarkSkull() { - String textureLink = "bc8ea1f51f253ff5142ca11ae45193a4ad8c3ab5e9c6eec8ba7a4fcb7bac40"; - - String b64Decoded = "{\"textures\":{\"SKIN\":{\"url\":\"http://textures.minecraft.net/texture/" + textureLink + "\"}}}"; - String b64Encoded = new String(Base64.getEncoder().encode(b64Decoded.getBytes())); - - ItemStack stack = new ItemStack(Items.skull, 1, 3); - NBTTagCompound nbt = new NBTTagCompound(); - NBTTagCompound skullOwner = new NBTTagCompound(); - NBTTagCompound properties = new NBTTagCompound(); - NBTTagList textures = new NBTTagList(); - NBTTagCompound textures_0 = new NBTTagCompound(); - - String uuid = UUID.nameUUIDFromBytes(b64Encoded.getBytes()).toString(); - skullOwner.setString("Id", uuid); - skullOwner.setString("Name", uuid); - - textures_0.setString("Value", b64Encoded); - textures.appendTag(textures_0); - - properties.setTag("textures", textures); - skullOwner.setTag("Properties", properties); - nbt.setTag("SkullOwner", skullOwner); - stack.setTagCompound(nbt); - stack.setStackDisplayName(EnumChatFormatting.RED + "Unknown Pet"); - return stack; - } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java index 75086b1f..4d3b4645 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java @@ -138,6 +138,13 @@ public class ItemResolutionQuery { return manager.jsonToStack(jsonObject); } + @Nullable + public ItemStack resolveToItemStack(boolean useReplacements) { + JsonObject jsonObject = resolveToItemListJson(); + if (jsonObject == null) return null; + return manager.jsonToStack(jsonObject, false, useReplacements); + } + // private boolean isBazaar(IInventory chest) { if (chest.getDisplayName().getFormattedText().startsWith("Bazaar ➜ ")) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java index c7c7d4b6..a8f6e960 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java @@ -20,16 +20,31 @@ package io.github.moulberry.notenoughupdates.util; import com.google.gson.JsonArray; +import com.google.gson.JsonElement; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.listener.ItemTooltipListener; +import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; +import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import net.minecraft.item.ItemStack; +import net.minecraft.nbt.JsonToNBT; +import net.minecraft.nbt.NBTException; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.nbt.NBTTagList; import net.minecraft.nbt.NBTTagString; +import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.MathHelper; +import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.ArrayList; +import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Locale; +import java.util.Map; +import java.util.function.BiFunction; public class ItemUtils { @@ -58,6 +73,14 @@ public class ItemUtils { return skull; } + public static ItemStack createQuestionMarkSkull(String label) { + return Utils.createSkull( + label, + "00000000-0000-0000-0000-000000000000", + "bc8ea1f51f253ff5142ca11ae45193a4ad8c3ab5e9c6eec8ba7a4fcb7bac40" + ); + } + public static NBTTagCompound getOrCreateTag(ItemStack is) { if (is.hasTagCompound()) return is.getTagCompound(); NBTTagCompound nbtTagCompound = new NBTTagCompound(); @@ -120,8 +143,267 @@ public class ItemUtils { return enchId; } + /** + * Mutates baseValues + */ + public static void modifyReplacement( + Map baseValues, + Map modifiers, + BiFunction mapper + ) { + if (modifiers == null || baseValues == null) return; + for (Map.Entry modifier : modifiers.entrySet()) { + String baseValue = baseValues.get(modifier.getKey()); + if (baseValue == null) continue; + try { + baseValues.put(modifier.getKey(), mapper.apply(baseValue, modifier.getValue())); + } catch (Exception e) { + System.out.println("Exception during replacement mapping: "); + e.printStackTrace(); + } + } + } + + public static String applyReplacements(Map replacements, String text) { + for (Map.Entry replacement : replacements.entrySet()) { + String search = "{" + replacement.getKey() + "}"; + text = text.replace(search, replacement.getValue()); + } + return text; + } + + public static ItemStack createPetItemstackFromPetInfo(PetInfoOverlay.Pet currentPet) { + JsonObject pet = NotEnoughUpdates.INSTANCE.manager.getJsonForItem(NotEnoughUpdates.INSTANCE.manager.createItem( + currentPet.getPetId(false))); + String petname = currentPet.petType; + String tier = Utils.getRarityFromInt(currentPet.rarity.petId).toUpperCase(); + String heldItem = currentPet.petItem; + String skin = currentPet.skin; + JsonObject heldItemJson = heldItem == null ? null : NotEnoughUpdates.INSTANCE.manager.getItemInformation().get( + heldItem); + String petId = currentPet.getPetId(false); + float exp = currentPet.petLevel.totalXp; + + GuiProfileViewer.PetLevel levelObj = GuiProfileViewer.getPetLevel(petname, tier, exp); + + float level = levelObj.level; + float currentLevelRequirement = levelObj.currentLevelRequirement; + float maxXP = levelObj.maxXP; + pet.addProperty("level", level); + pet.addProperty("currentLevelRequirement", currentLevelRequirement); + pet.addProperty("maxXP", maxXP); + + ItemStack petItemstack = NotEnoughUpdates.INSTANCE.manager + .createItemResolutionQuery() + .withKnownInternalName(petId) + .resolveToItemStack(false); + if (petItemstack == null) { + petItemstack = ItemUtils.createQuestionMarkSkull(EnumChatFormatting.RED + "Unknown Pet"); + appendLore(petItemstack, Arrays.asList( + "§cThis pet is not saved in the repository", + "", + "§cIf you expected it to be there please send a message in", + "§c§l#neu-support §r§con §ldiscord.gg/moulberry" + )); + } + Map replacements = NotEnoughUpdates.INSTANCE.manager.getLoreReplacements( + petname, + tier, + MathHelper.floor_float(level) + ); + + if (heldItem != null) { + modifyReplacement(replacements, GuiProfileViewer.PET_STAT_BOOSTS.get(heldItem), (original, modifier) -> + "" + MathHelper.floor_float(Float.parseFloat(original) + modifier)); + modifyReplacement(replacements, GuiProfileViewer.PET_STAT_BOOSTS_MULT.get(heldItem), (original, modifier) -> + "" + MathHelper.floor_float(Float.parseFloat(original) * modifier)); + } + + NBTTagCompound tag = getOrCreateTag(petItemstack); + if (tag.hasKey("display", 10)) { + NBTTagCompound displayTag = tag.getCompoundTag("display"); + if (displayTag.hasKey("Lore", 9)) { + List newLore = new ArrayList<>(); + NBTTagList lore = displayTag.getTagList("Lore", 8); + int secondLastBlankLine = -1, lastBlankLine = -1; + for (int j = 0; j < lore.tagCount(); j++) { + String line = lore.getStringTagAt(j); + if (line.trim().isEmpty()) { + secondLastBlankLine = lastBlankLine; + lastBlankLine = j; + } + line = applyReplacements(replacements, line); + newLore.add(line); + } + if (skin != null) { + JsonObject petSkin = NotEnoughUpdates.INSTANCE.manager + .createItemResolutionQuery() + .withKnownInternalName("PET_SKIN_" + skin) + .resolveToItemListJson(); + if (petSkin != null) { + try { + NBTTagCompound nbt = JsonToNBT.getTagFromJson(petSkin.get("nbttag").getAsString()); + tag.setTag("SkullOwner", nbt.getTag("SkullOwner")); + String name = petSkin.get("displayname").getAsString(); + if (name != null) { + name = Utils.cleanColour(name); + newLore.set(0, newLore.get(0) + ", " + name); + } + } catch (NBTException e) { + e.printStackTrace(); + } + } + } + for (int i = 0; i < newLore.size(); i++) { + String cleaned = Utils.cleanColour(newLore.get(i)); + if (cleaned.equals("Right-click to add this pet to")) { + newLore.remove(i + 1); + newLore.remove(i); + secondLastBlankLine = i - 1; + break; + } + } + if (secondLastBlankLine != -1) { + List petItemLore = new ArrayList<>(); + if (heldItem != null) { + petItemLore.add(EnumChatFormatting.GOLD + "Held Item: " + heldItemJson.get("displayname").getAsString()); + List heldItemLore = JsonUtils.getJsonArrayOrEmpty(heldItemJson, "lore", JsonElement::getAsString); + int blanks = 0; + for (String heldItemLoreLine : heldItemLore) { + if (heldItemLoreLine.trim().isEmpty()) { + blanks++; + } else if (blanks == 2) { + petItemLore.add(heldItemLoreLine); + } else if (blanks > 2) { + break; + } + } + } + if (currentPet.candyUsed > 0) { + if (petItemLore.size() > 0) { + petItemLore.add(""); + } + petItemLore.add("§a(" + currentPet.candyUsed + "/10) Pet Candy Used"); + } + newLore.addAll(secondLastBlankLine + 1, petItemLore); + } + NBTTagList temp = new NBTTagList(); + for (String loreLine : newLore) { + temp.appendTag(new NBTTagString(loreLine)); + } + displayTag.setTag("Lore", temp); + } + + if (displayTag.hasKey("Name", 8)) { + String displayName = displayTag.getString("Name"); + displayName = applyReplacements(replacements, displayName); + displayTag.setTag("Name", new NBTTagString(displayName)); + } + tag.setTag("display", displayTag); + } + + // Adds the missing pet fields to the tag + NBTTagCompound extraAttributes = new NBTTagCompound(); + JsonObject petInfo = new JsonObject(); + if (tag.hasKey("ExtraAttributes", 10)) { + extraAttributes = tag.getCompoundTag("ExtraAttributes"); + if (extraAttributes.hasKey("petInfo", 8)) { + petInfo = new JsonParser().parse(extraAttributes.getString("petInfo")).getAsJsonObject(); + } + } + petInfo.addProperty("exp", exp); + petInfo.addProperty("tier", tier); + petInfo.addProperty("type", petname); + if (heldItem != null) { + petInfo.addProperty("heldItem", heldItem); + } + if (skin != null) { + petInfo.addProperty("skin", skin); + } + extraAttributes.setString("petInfo", petInfo.toString()); + tag.setTag("ExtraAttributes", extraAttributes); + petItemstack.setTagCompound(tag); + return petItemstack; + } + + private static final DecimalFormat decimalFormatter = new DecimalFormat("#,###,###.###"); + + public static ItemStack petToolTipXPExtendPetOverlay(ItemStack stack) { + NBTTagCompound tag = stack.getTagCompound() == null ? new NBTTagCompound() : stack.getTagCompound(); + if (tag.hasKey("display", 10)) { + NBTTagCompound display = tag.getCompoundTag("display"); + if (display.hasKey("Lore", 9)) { + NBTTagList lore = display.getTagList("Lore", 8); + if (Utils.cleanColour(lore.getStringTagAt(0)).matches(ItemTooltipListener.petToolTipRegex) && + lore.tagCount() > 7) { + + GuiProfileViewer.PetLevel petLevel; + + PetInfoOverlay.Pet pet = PetInfoOverlay.getPetFromStack( + stack.getTagCompound() + ); + if (pet == null) return stack; + petLevel = pet.petLevel; + if (petLevel == null) return stack; + + NBTTagList newLore = new NBTTagList(); + int maxLvl = 100; + if (Constants.PETS != null && Constants.PETS.has("custom_pet_leveling") && + Constants.PETS.getAsJsonObject("custom_pet_leveling").has(pet.petType.toUpperCase()) && + Constants.PETS.getAsJsonObject("custom_pet_leveling").getAsJsonObject(pet.petType.toUpperCase()).has( + "max_level")) { + maxLvl = + Constants.PETS + .getAsJsonObject("custom_pet_leveling") + .getAsJsonObject(pet.petType.toUpperCase()) + .get("max_level") + .getAsInt(); + } + for (int i = 0; i < lore.tagCount(); i++) { + if (i == lore.tagCount() - 2) { + newLore.appendTag(new NBTTagString("")); + if (petLevel.level >= maxLvl) { + newLore.appendTag(new NBTTagString( + EnumChatFormatting.AQUA + "" + EnumChatFormatting.BOLD + "MAX LEVEL")); + } else { + double levelPercent = (Math.round(petLevel.levelPercentage * 1000) / 10.0); + newLore.appendTag(new NBTTagString( + EnumChatFormatting.GRAY + "Progress to Level " + (int) (petLevel.level + 1) + ": " + + EnumChatFormatting.YELLOW + levelPercent + "%")); + StringBuilder sb = new StringBuilder(); + + for (int j = 0; j < 20; j++) { + if (j < (levelPercent / 5)) { + sb.append(EnumChatFormatting.DARK_GREEN); + } else { + sb.append(EnumChatFormatting.GRAY); + } + sb.append("-"); + } + newLore.appendTag(new NBTTagString(sb.toString())); + newLore.appendTag(new NBTTagString( + EnumChatFormatting.GRAY + "EXP: " + EnumChatFormatting.YELLOW + + decimalFormatter.format(petLevel.levelXp) + + EnumChatFormatting.GOLD + "/" + EnumChatFormatting.YELLOW + + decimalFormatter.format(petLevel.currentLevelRequirement) + )); + } + } + newLore.appendTag(lore.get(i)); + } + display.setTag("Lore", newLore); + tag.setTag("display", display); + } + } + } + stack.setTagCompound(tag); + return stack; + } + public static boolean isSoulbound(ItemStack item) { return ItemUtils.getLore(item).stream() - .anyMatch(line -> line.equals("§8§l* §8Co-op Soulbound §8§l*") || line.equals("§8§l* Soulbound §8§l*")); + .anyMatch(line -> line.equals("§8§l* §8Co-op Soulbound §8§l*") || + line.equals("§8§l* Soulbound §8§l*")); } + } -- cgit From ed610c9c1aa705e064638fc532a8447ae550e0b6 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sat, 24 Sep 2022 00:14:51 +1000 Subject: Fixed combat overlay always showing if you have champion enchant (#304) --- .../github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java index bf106eed..d73b5eb2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java @@ -82,6 +82,7 @@ public class CombatSkillOverlay public void update() { if (!NotEnoughUpdates.INSTANCE.config.skillOverlays.combatSkillOverlay) { kill = -1; + championXp = -1; overlayStrings = null; return; } -- cgit From 9a0db0280a0863ca6bfd372bd2305ff9e4d81978 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Sat, 24 Sep 2022 13:15:07 +0200 Subject: Fixed Typo, fixed Seasoned Mineman perk in pv and added text that it requires preenabled stuff (#307) --- .../notenoughupdates/options/seperateSections/CustomArmour.java | 3 ++- .../notenoughupdates/options/seperateSections/Enchanting.java | 2 +- .../github/moulberry/notenoughupdates/profileviewer/MiningPage.java | 6 ++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/CustomArmour.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/CustomArmour.java index 6c47b7a6..d7f82a66 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/CustomArmour.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/CustomArmour.java @@ -29,7 +29,8 @@ public class CustomArmour { @Expose @ConfigOption( name = "Enable Equipment Hud", - desc = "Shows an overlay in your inventory showing your 4 extra armour slots" + desc = "Shows an overlay in your inventory showing your 4 extra armour slots" + + "\u00A7cRequires Hide Potion Effects to be enabled" ) @ConfigEditorBoolean public boolean enableArmourHud = true; 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 2990498f..b596d180 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 @@ -132,7 +132,7 @@ public class Enchanting { @Expose @ConfigOption( name = "Ultrasequencer Numbers", - desc = "Replace the items in the supersequencer with only numbers" + desc = "Replace the items in the Ultrasequencer with only numbers" ) @ConfigEditorBoolean @ConfigAccordionId(id = 0) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java index c32310b7..94dbdc1e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java @@ -868,8 +868,7 @@ public class MiningPage extends GuiProfileViewerPage { "Seasoned Mineman", "§7Level " + seasonMine + "§8/100", "", - "§7Increases your Mining", - "§7experience gain by " + EnumChatFormatting.GREEN + seasonMineStat + "%§7.", + "§7Grants §3+" + EnumChatFormatting.DARK_AQUA + seasonMineStat + "☯ Mining Wisdom§7.", "", EnumChatFormatting.GRAY + "Cost", EnumChatFormatting.DARK_GREEN + @@ -881,8 +880,7 @@ public class MiningPage extends GuiProfileViewerPage { "Seasoned Mineman", "§7Level " + seasonMine + "§8/100", "", - "§7Increases your Mining", - "§7experience gain by " + EnumChatFormatting.GREEN + seasonMineStat + "%§7." + "§7Grants §3+" + EnumChatFormatting.DARK_AQUA + seasonMineStat + "☯ Mining Wisdom§7." ), 100 ); -- cgit From 1e71e3e515fc17034e2e73a9b5e6012637204453 Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Sat, 24 Sep 2022 13:17:00 +0200 Subject: Fix missing repo crash in PetInvOverlay (#305) * Fix missing repo crash in PetInvOverlay * Add 2.1.md to *not* *satisfy* erymanthus (*not* RayDeezNuts) --- Update Notes/2.1.md | 1 + .../java/io/github/moulberry/notenoughupdates/NEUManager.java | 8 ++++---- .../moulberry/notenoughupdates/overlays/EquipmentOverlay.java | 2 +- .../io/github/moulberry/notenoughupdates/util/ItemUtils.java | 9 +-------- 4 files changed, 7 insertions(+), 13 deletions(-) diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index 1c623928..89f56293 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -42,6 +42,7 @@ - Added carpentry skill to skill average - hannibal2 - Fixed sort order of fishing rods in profile viewer page - hannibal2 - Changing sort logic from strength plus damage to bin price for best weapons in pv inventory page - hannibal2 + - Added pronouns to /pv - nea89 ### **Minor Changes:** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java index 62b24111..7a2389d4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -1267,7 +1267,7 @@ public class NEUManager { } } - public HashMap getLoreReplacements(String petname, String tier, int level) { + public HashMap getPetLoreReplacements(String petname, String tier, int level) { JsonObject petnums = null; if (petname != null && tier != null) { petnums = Constants.PETNUMS; @@ -1392,7 +1392,7 @@ public class NEUManager { return replacements; } - public HashMap getLoreReplacements(NBTTagCompound tag, int level) { + public HashMap getPetLoreReplacements(NBTTagCompound tag, int level) { String petname = null; String tier = null; if (tag != null && tag.hasKey("ExtraAttributes")) { @@ -1426,7 +1426,7 @@ public class NEUManager { } } } - return getLoreReplacements(petname, tier, level); + return getPetLoreReplacements(petname, tier, level); } public NBTTagList processLore(JsonArray lore, HashMap replacements) { @@ -1497,7 +1497,7 @@ public class NEUManager { HashMap replacements = new HashMap<>(); if (useReplacements) { - replacements = getLoreReplacements(stack.getTagCompound(), -1); + replacements = getPetLoreReplacements(stack.getTagCompound(), -1); String displayName = json.get("displayname").getAsString(); for (Map.Entry entry : replacements.entrySet()) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java index d64dbe01..e6e8cb3b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java @@ -262,7 +262,7 @@ public class EquipmentOverlay { slot4 = getWardrobeSlot(37); } - if (screen instanceof GuiChest || screen instanceof GuiInventory) { + if ((screen instanceof GuiChest || screen instanceof GuiInventory) && NotEnoughUpdates.INSTANCE.config.petOverlay.petInvDisplay){ petStack = getRepoPetStack(); } if ((!(screen instanceof GuiInventory) && !(screen instanceof GuiInvButtonEditor)) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java index a8f6e960..c6bc7538 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java @@ -173,8 +173,6 @@ public class ItemUtils { } public static ItemStack createPetItemstackFromPetInfo(PetInfoOverlay.Pet currentPet) { - JsonObject pet = NotEnoughUpdates.INSTANCE.manager.getJsonForItem(NotEnoughUpdates.INSTANCE.manager.createItem( - currentPet.getPetId(false))); String petname = currentPet.petType; String tier = Utils.getRarityFromInt(currentPet.rarity.petId).toUpperCase(); String heldItem = currentPet.petItem; @@ -187,11 +185,6 @@ public class ItemUtils { GuiProfileViewer.PetLevel levelObj = GuiProfileViewer.getPetLevel(petname, tier, exp); float level = levelObj.level; - float currentLevelRequirement = levelObj.currentLevelRequirement; - float maxXP = levelObj.maxXP; - pet.addProperty("level", level); - pet.addProperty("currentLevelRequirement", currentLevelRequirement); - pet.addProperty("maxXP", maxXP); ItemStack petItemstack = NotEnoughUpdates.INSTANCE.manager .createItemResolutionQuery() @@ -206,7 +199,7 @@ public class ItemUtils { "§c§l#neu-support §r§con §ldiscord.gg/moulberry" )); } - Map replacements = NotEnoughUpdates.INSTANCE.manager.getLoreReplacements( + Map replacements = NotEnoughUpdates.INSTANCE.manager.getPetLoreReplacements( petname, tier, MathHelper.floor_float(level) -- cgit From 29bc3371a62a74d2eab4fe9b6d5c820d52dbbac4 Mon Sep 17 00:00:00 2001 From: Lulonaut Date: Mon, 26 Sep 2022 08:42:51 +0200 Subject: Fix TextTabOverlay crash (#308) --- .../moulberry/notenoughupdates/overlays/TextTabOverlay.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java index 03578c95..fa263db7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TextTabOverlay.java @@ -49,8 +49,13 @@ public abstract class TextTabOverlay extends TextOverlay { public void realTick() { shouldUpdateOverlay = shouldUpdate(); if (shouldUpdateOverlay) { - boolean currentTabState = - Keyboard.isKeyDown(Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode()); + int keycode = Minecraft.getMinecraft().gameSettings.keyBindPlayerList.getKeyCode(); + boolean currentTabState; + if (keycode > 0) { + currentTabState = Keyboard.isKeyDown(keycode); + } else { + currentTabState = false; + } if (lastTabState != currentTabState) { lastTabState = currentTabState; update(); -- cgit From c231bdc6e3079a8455b9b7c4173528c1c1ecf42e Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 27 Sep 2022 12:16:35 +1000 Subject: the people in #general said this would fix a crash (#317) --- src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index dbff2be2..14078069 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -1460,7 +1460,7 @@ public class NEUOverlay extends Gui { if (index < getSlotsXSize() * getSlotsYSize()) { int actualIndex = index + getSlotsXSize() * getSlotsYSize() * page; List searchedItems = getSearchedItems(); - if (actualIndex < searchedItems.size()) { + if (0 <= actualIndex && actualIndex < searchedItems.size()) { return searchedItems.get(actualIndex); } else { return null; -- cgit From 0fffb5028d34dcc5a669055a7a507134ca466128 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 27 Sep 2022 12:36:40 +1000 Subject: Update build.yml (#312) --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4d6c2b23..639d3965 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,6 +9,7 @@ on: - "COPYING" - "COPYING.LESSER" - ".gitignore" + - "Update Notes" pull_request: branches: - "*" @@ -17,6 +18,7 @@ on: - "COPYING" - "COPYING.LESSER" - ".gitignore" + - "Update Notes" workflow_dispatch: jobs: build: -- cgit From 66a24df5731ad31ea9cbee5e80879e4169009ae7 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Thu, 29 Sep 2022 03:18:18 +0200 Subject: HOTFIX Custom Storage (#319) Co-authored-by: efefury <69400149+efefury@users.noreply.github.com> --- .../github/moulberry/notenoughupdates/miscfeatures/StorageManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java index 93e9f516..bef07399 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StorageManager.java @@ -294,7 +294,7 @@ public class StorageManager { private boolean shouldRenderStorageOverlayCached = false; - private static final Pattern WINDOW_REGEX = Pattern.compile(".+ Backpack (?:\u2726 )?\\((\\d+)/(\\d+)\\)"); + private static final Pattern WINDOW_REGEX = Pattern.compile(".+ Backpack (?:✦ )?\\(Slot #(\\d+)\\)"); private static final Pattern ECHEST_WINDOW_REGEX = Pattern.compile("Ender Chest \\((\\d+)/(\\d+)\\)"); public void loadConfig(File file) { -- cgit From cbcc4c3b4004cbf3f86aeab515ea94a93b4efd1e Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 30 Sep 2022 01:25:12 +1000 Subject: Fix for that 1 human who has gui scale 5 (#323) --- .../moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) 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 8576f141..83d8fab9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -55,7 +55,6 @@ import org.lwjgl.opengl.GL14; import org.lwjgl.opengl.GL20; import java.awt.*; -import java.io.File; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; @@ -458,7 +457,7 @@ public class GuiProfileViewer extends GuiScreen { new Color(63, 224, 208, 255).getRGB() ); - if (profileDropdownSelected && !profile.getProfileNames().isEmpty() && scaledResolution.getScaleFactor() != 4) { + if (profileDropdownSelected && !profile.getProfileNames().isEmpty() && scaledResolution.getScaleFactor() < 4) { int dropdownOptionSize = scaledResolution.getScaleFactor() == 3 ? 10 : 20; int numProfiles = profile.getProfileNames().size(); @@ -912,7 +911,7 @@ public class GuiProfileViewer extends GuiScreen { if (mouseX > guiLeft && mouseX < guiLeft + 100 && profile != null && !profile.getProfileNames().isEmpty()) { ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); if (mouseY > guiTop + sizeY + 3 && mouseY < guiTop + sizeY + 23) { - if (scaledResolution.getScaleFactor() == 4) { + if (scaledResolution.getScaleFactor() >= 4) { profileDropdownSelected = false; int profileNum = 0; for (int index = 0; index < profile.getProfileNames().size(); index++) { @@ -937,7 +936,7 @@ public class GuiProfileViewer extends GuiScreen { } else { profileDropdownSelected = !profileDropdownSelected; } - } else if (scaledResolution.getScaleFactor() != 4 && profileDropdownSelected) { + } else if (scaledResolution.getScaleFactor() < 4 && profileDropdownSelected) { int dropdownOptionSize = scaledResolution.getScaleFactor() == 3 ? 10 : 20; int extraY = mouseY - (guiTop + sizeY + 23); int index = extraY / dropdownOptionSize; -- cgit From 2dd4a2b36211c380c0bf4e231859dfafd3c04a5b Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Thu, 29 Sep 2022 17:25:37 +0200 Subject: Add custom keystore and refactor HypixelApi.java (#318) * Add custom keystore and refactor HypixelApi.java * Fix inputstream leak (+ less console spam) * Fix HOTM crash * Use api selected variable to find best profile * Number formatting * Make old profiles show again Co-authored-by: nopo --- .../moulberry/notenoughupdates/NEUManager.java | 6 +- .../notenoughupdates/auction/APIManager.java | 113 +-- .../commands/misc/PronounsCommand.java | 8 +- .../notenoughupdates/cosmetics/CapeManager.java | 71 +- .../notenoughupdates/cosmetics/GuiCosmetics.java | 23 +- .../notenoughupdates/profileviewer/BingoPage.java | 97 ++- .../profileviewer/GuiProfileViewer.java | 4 +- .../notenoughupdates/profileviewer/MiningPage.java | 658 +++++++++------- .../profileviewer/ProfileViewer.java | 844 +++++++++++---------- .../moulberry/notenoughupdates/util/ApiUtil.java | 203 +++++ .../notenoughupdates/util/HotmInformation.java | 12 +- .../notenoughupdates/util/HypixelApi.java | 174 ----- .../moulberry/notenoughupdates/util/PronounDB.java | 81 +- .../moulberry/notenoughupdates/util/SBInfo.java | 11 +- src/main/resources/neukeystore.jks | Bin 0 -> 101958 bytes src/main/resources/neukeystore.txt | 17 + src/main/resources/pronoundb.jks | Bin 1457 -> 0 bytes 17 files changed, 1262 insertions(+), 1060 deletions(-) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/util/HypixelApi.java create mode 100644 src/main/resources/neukeystore.jks create mode 100644 src/main/resources/neukeystore.txt delete mode 100644 src/main/resources/pronoundb.jks diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java index 7a2389d4..598ecc2e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -36,7 +36,7 @@ import io.github.moulberry.notenoughupdates.recipes.Ingredient; import io.github.moulberry.notenoughupdates.recipes.NeuRecipe; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.HotmInformation; -import io.github.moulberry.notenoughupdates.util.HypixelApi; +import io.github.moulberry.notenoughupdates.util.ApiUtil; import io.github.moulberry.notenoughupdates.util.ItemResolutionQuery; import io.github.moulberry.notenoughupdates.util.ItemUtils; import io.github.moulberry.notenoughupdates.util.SBInfo; @@ -124,9 +124,7 @@ public class NEUManager { public String viewItemAttemptID = null; public long viewItemAttemptTime = 0; - private final String currentProfile = ""; - private final String currentProfileBackup = ""; - public final HypixelApi hypixelApi = new HypixelApi(); + public final ApiUtil apiUtils = new ApiUtil(); private final Map itemstackCache = new HashMap<>(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java b/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java index 2dc02b7e..1b6896db 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/auction/APIManager.java @@ -287,23 +287,26 @@ public class APIManager { } public void updateLowestBin() { - manager.hypixelApi.getMyApiGZIPAsync("lowestbin.json.gz", (jsonObject) -> { - if (lowestBins == null) { - lowestBins = new JsonObject(); - } - if (!jsonObject.entrySet().isEmpty()) { - lastLowestBinUpdate = System.currentTimeMillis(); - } - for (Map.Entry entry : jsonObject.entrySet()) { - lowestBins.add(entry.getKey(), entry.getValue()); - } - if (!didFirstUpdate) { - ItemPriceInformation.updateAuctionableItemsList(); - didFirstUpdate = true; - } - GuiPriceGraph.addToCache(lowestBins, false); - }, () -> { - }); + manager.apiUtils + .newMoulberryRequest("lowestbin.json.gz") + .gunzip() + .requestJson() + .thenAccept(jsonObject -> { + if (lowestBins == null) { + lowestBins = new JsonObject(); + } + if (!jsonObject.entrySet().isEmpty()) { + lastLowestBinUpdate = System.currentTimeMillis(); + } + for (Map.Entry entry : jsonObject.entrySet()) { + lowestBins.add(entry.getKey(), entry.getValue()); + } + if (!didFirstUpdate) { + ItemPriceInformation.updateAuctionableItemsList(); + didFirstUpdate = true; + } + GuiPriceGraph.addToCache(lowestBins, false); + }); } private void ahNotification() { @@ -460,20 +463,23 @@ public class APIManager { } }; - manager.hypixelApi.getMyApiGZIPAsync("auctionLast.json.gz", process, () -> - System.out.println("Error downloading auction from Moulberry's jank API. :(")); + manager.apiUtils.newMoulberryRequest("auctionLast.json.gz") + .gunzip().requestJson().thenAccept(process); - manager.hypixelApi.getMyApiGZIPAsync("auction.json.gz", jsonObject -> { - if (jsonObject.get("success").getAsBoolean()) { - long apiUpdate = (long) jsonObject.get("time").getAsFloat(); - if (lastApiUpdate == apiUpdate) { - lastAuctionUpdate -= 30 * 1000; - } - lastApiUpdate = apiUpdate; + manager.apiUtils + .newMoulberryRequest("auction.json.gz") + .gunzip().requestJson() + .thenAccept(jsonObject -> { + if (jsonObject.get("success").getAsBoolean()) { + long apiUpdate = (long) jsonObject.get("time").getAsFloat(); + if (lastApiUpdate == apiUpdate) { + lastAuctionUpdate -= 30 * 1000; + } + lastApiUpdate = apiUpdate; - process.accept(jsonObject); - } - }, () -> System.out.println("Error downloading auction from Moulberry's jank API. :(")); + process.accept(jsonObject); + } + }); } @@ -673,8 +679,10 @@ public class APIManager { //System.out.println("Trying to update page: " + page); HashMap args = new HashMap<>(); args.put("page", "" + page); - manager.hypixelApi.getHypixelApiAsync(null, "skyblock/auctions", - args, jsonObject -> { + manager.apiUtils + .newAnonymousHypixelApiRequest("skyblock/auctions") + .requestJson() + .thenAccept(jsonObject -> { if (jsonObject == null) return; if (jsonObject.get("success").getAsBoolean()) { @@ -701,8 +709,13 @@ public class APIManager { } else { pagesToDownload.addLast(page); } - }, () -> pagesToDownload.addLast(page) - ); + }) + .handle((ignored, ex) -> { + if (ex != null) { + pagesToDownload.addLast(page); + } + return null; + }); } private static final Pattern BAZAAR_ENCHANTMENT_PATTERN = Pattern.compile("ENCHANTMENT_(\\D*)_(\\d+)"); @@ -716,11 +729,10 @@ public class APIManager { } public void updateBazaar() { - manager.hypixelApi.getHypixelApiAsync( - NotEnoughUpdates.INSTANCE.config.apiData.apiKey, - "skyblock/bazaar", - new HashMap<>(), - (jsonObject) -> { + manager.apiUtils + .newHypixelApiRequest("skyblock/bazaar") + .requestJson() + .thenAccept(jsonObject -> { if (!jsonObject.get("success").getAsBoolean()) return; craftCost.clear(); @@ -755,20 +767,23 @@ public class APIManager { } } GuiPriceGraph.addToCache(bazaarJson, true); - } - ); + }); } public void updateAvgPrices() { - manager.hypixelApi.getMyApiGZIPAsync("auction_averages/3day.json.gz", (jsonObject) -> { - craftCost.clear(); - auctionPricesJson = jsonObject; - lastAuctionAvgUpdate = System.currentTimeMillis(); - }, () -> { - }); - manager.hypixelApi.getMyApiGZIPAsync("auction_averages_lbin/1day.json.gz", (jsonObject) -> - auctionPricesAvgLowestBinJson = jsonObject, () -> { - }); + manager.apiUtils + .newMoulberryRequest("auction_averages/3day.json.gz") + .gunzip().requestJson().thenAccept((jsonObject) -> { + craftCost.clear(); + auctionPricesJson = jsonObject; + lastAuctionAvgUpdate = System.currentTimeMillis(); + }); + manager.apiUtils + .newMoulberryRequest("auction_averages_lbin/1day.json.gz") + .gunzip().requestJson() + .thenAccept((jsonObject) -> { + auctionPricesAvgLowestBinJson = jsonObject; + }); } public Set getItemAuctionInfoKeySet() { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/PronounsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/PronounsCommand.java index 6d0ee88d..5a4f1400 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/PronounsCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/PronounsCommand.java @@ -25,7 +25,6 @@ import io.github.moulberry.notenoughupdates.util.MinecraftExecutor; import io.github.moulberry.notenoughupdates.util.PronounDB; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; -import net.minecraft.client.entity.EntityPlayerSP; import net.minecraft.client.gui.GuiNewChat; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; @@ -75,9 +74,9 @@ public class PronounsCommand extends ClientCommandBase { c.complete(Utils.parseDashlessUUID(uuidString)); } }); - pronouns = c.thenApplyAsync(PronounDB::getPronounsFor); + pronouns = c.thenCompose(PronounDB::getPronounsFor); } else { - pronouns = CompletableFuture.supplyAsync(() -> PronounDB.getPronounsFor(platform, user)); + pronouns = PronounDB.getPronounsFor(platform, user); } pronouns.handleAsync((pronounChoice, throwable) -> { if (throwable != null || !pronounChoice.isPresent()) { @@ -85,7 +84,8 @@ public class PronounsCommand extends ClientCommandBase { return null; } PronounDB.PronounChoice betterPronounChoice = pronounChoice.get(); - nc.printChatMessageWithOptionalDeletion(new ChatComponentText("§e[NEU] Pronouns for §b" + user + " §eon §b" + platform + "§e:"), id); + nc.printChatMessageWithOptionalDeletion(new ChatComponentText( + "§e[NEU] Pronouns for §b" + user + " §eon §b" + platform + "§e:"), id); betterPronounChoice.render().forEach(it -> nc.printChatMessage(new ChatComponentText("§e[NEU] §a" + it))); return null; }, MinecraftExecutor.INSTANCE); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java index 293535e7..7a609a2a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/CapeManager.java @@ -145,46 +145,53 @@ public class CapeManager { } private void updateCapes() { - NotEnoughUpdates.INSTANCE.manager.hypixelApi.getMyApiAsync("activecapes.json", (jsonObject) -> { - if (jsonObject.get("success").getAsBoolean()) { - lastJsonSync = jsonObject; - - lastCapeSynced = System.currentTimeMillis(); - capeMap.clear(); - for (JsonElement active : jsonObject.get("active").getAsJsonArray()) { - if (active.isJsonObject()) { - JsonObject activeObj = (JsonObject) active; - setCape(activeObj.get("_id").getAsString(), activeObj.get("capeType").getAsString(), false); + NotEnoughUpdates.INSTANCE.manager.apiUtils + .newMoulberryRequest("activecapes.json") + .requestJson() + .thenAccept(jsonObject -> { + if (jsonObject.get("success").getAsBoolean()) { + lastJsonSync = jsonObject; + + lastCapeSynced = System.currentTimeMillis(); + capeMap.clear(); + for (JsonElement active : jsonObject.get("active").getAsJsonArray()) { + if (active.isJsonObject()) { + JsonObject activeObj = (JsonObject) active; + setCape(activeObj.get("_id").getAsString(), activeObj.get("capeType").getAsString(), false); + } } } - } - }, () -> System.out.println("[MBAPI] Update capes errored")); + }); if (Minecraft.getMinecraft().thePlayer != null && permSyncTries > 0) { String uuid = Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", ""); permSyncTries--; - NotEnoughUpdates.INSTANCE.manager.hypixelApi.getMyApiAsync("permscapes.json", (jsonObject) -> { - if (!jsonObject.get("success").getAsBoolean()) return; - - permSyncTries = 0; - availableCapes.clear(); - for (JsonElement permPlayer : jsonObject.get("perms").getAsJsonArray()) { - if (!permPlayer.isJsonObject()) continue; - String playerUuid = permPlayer.getAsJsonObject().get("_id").getAsString(); - if (!(playerUuid != null && playerUuid.equals(uuid))) continue; - for (JsonElement perm : permPlayer.getAsJsonObject().get("perms").getAsJsonArray()) { - if (!perm.isJsonPrimitive()) continue; - String cape = perm.getAsString(); - if (cape.equals("*")) { - allAvailable = true; - } else { - availableCapes.add(cape); - } + NotEnoughUpdates.INSTANCE.manager.apiUtils + .newMoulberryRequest("permscapes.json") + .requestJson() + .thenAccept(jsonObject -> { + if (!jsonObject.get("success").getAsBoolean()) return; + + permSyncTries = 0; + availableCapes.clear(); + for (JsonElement permPlayer : jsonObject.get("perms").getAsJsonArray()) { + if (!permPlayer.isJsonObject()) continue; + String playerUuid = permPlayer.getAsJsonObject().get("_id").getAsString(); + if (!(playerUuid != null && playerUuid.equals(uuid))) continue; + for (JsonElement perm : permPlayer.getAsJsonObject().get("perms").getAsJsonArray()) { + if (!perm.isJsonPrimitive()) continue; + String cape = perm.getAsString(); + if (cape.equals("*")) { + allAvailable = true; + } else { + availableCapes.add(cape); + } + } + return; } - return; - } - }, () -> System.out.println("[MBAPI] Update capes errored - perms")); + + }); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/GuiCosmetics.java b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/GuiCosmetics.java index 0e37bed3..12d8c92d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/GuiCosmetics.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/cosmetics/GuiCosmetics.java @@ -404,21 +404,14 @@ public class GuiCosmetics extends GuiScreen { .getSession() .getProfile(), accessToken, serverId); - if (wantToEquipCape == null) { - NotEnoughUpdates.INSTANCE.manager.hypixelApi.getMyApiAsync( - "cgi-bin/changecape.py?capeType=null&serverId=" + - serverId + "&username=" + userName, - System.out::println, - () -> System.out.println("Change cape error") - ); - } else { - NotEnoughUpdates.INSTANCE.manager.hypixelApi.getMyApiAsync( - "cgi-bin/changecape.py?capeType=" + wantToEquipCape + "&serverId=" + - serverId + "&username=" + userName, - System.out::println, - () -> System.out.println("Change cape error") - ); - } + String toEquipName = wantToEquipCape == null ? "null" : wantToEquipCape; + NotEnoughUpdates.INSTANCE.manager.apiUtils + .newMoulberryRequest("cgi-bin/changecape.py") + .queryArgument("capeType", toEquipName) + .queryArgument("serverId", serverId) + .queryArgument("username", userName) + .requestString() + .thenAccept(System.out::println); } catch (Exception e) { System.out.println("Exception while generating mojang shared secret"); e.printStackTrace(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BingoPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BingoPage.java index 27b9b363..ab80afab 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BingoPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BingoPage.java @@ -24,9 +24,6 @@ import com.google.gson.JsonElement; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.util.Utils; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; @@ -39,6 +36,9 @@ import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import org.lwjgl.opengl.GL11; +import java.util.ArrayList; +import java.util.List; + public class BingoPage extends GuiProfileViewerPage { private static final ResourceLocation BINGO_GUI_TEXTURE = new ResourceLocation("notenoughupdates:pv_bingo_tab.png"); @@ -153,16 +153,23 @@ public class BingoPage extends GuiProfileViewerPage { } else { personalGoalsString = EnumChatFormatting.AQUA + - "Personal Goals: " + - EnumChatFormatting.WHITE + - completedGoals.size() + - EnumChatFormatting.GOLD + - "/" + - EnumChatFormatting.WHITE + - 20; + "Personal Goals: " + + EnumChatFormatting.WHITE + + completedGoals.size() + + EnumChatFormatting.GOLD + + "/" + + EnumChatFormatting.WHITE + + 20; } Utils.drawStringF(totalPointsString, Minecraft.getMinecraft().fontRendererObj, guiLeft + 22, guiTop + 19, true, 0); - Utils.drawStringF(personalGoalsString, Minecraft.getMinecraft().fontRendererObj, guiLeft + 22, guiTop + 31, true, 0); + Utils.drawStringF( + personalGoalsString, + Minecraft.getMinecraft().fontRendererObj, + guiLeft + 22, + guiTop + 31, + true, + 0 + ); GlStateManager.enableLighting(); } @@ -218,7 +225,9 @@ public class BingoPage extends GuiProfileViewerPage { } finalTier++; } - double nextTier = finalTier < totalTiers ? tiers.get(totalTiers - 1).getAsLong() : tiers.get(finalTier - 1).getAsLong(); + double nextTier = finalTier < totalTiers ? tiers.get(totalTiers - 1).getAsLong() : tiers + .get(finalTier - 1) + .getAsLong(); int progressToNextTier = (int) Math.round(progress / nextTier * 100); if (progressToNextTier > 100) progressToNextTier = 100; String progressBar = generateProgressIndicator(progress, nextTier); @@ -232,34 +241,37 @@ public class BingoPage extends GuiProfileViewerPage { tooltip.add(""); tooltip.add( EnumChatFormatting.GRAY + - "Progress to " + - name + - " " + - nextTierNum + - ": " + - EnumChatFormatting.YELLOW + - progressToNextTier + - EnumChatFormatting.GOLD + - "%" + "Progress to " + + name + + " " + + nextTierNum + + ": " + + EnumChatFormatting.YELLOW + + progressToNextTier + + EnumChatFormatting.GOLD + + "%" ); tooltip.add( progressBar + - EnumChatFormatting.YELLOW + - " " + - progressString + - EnumChatFormatting.GOLD + - "/" + - EnumChatFormatting.YELLOW + - nextTierString + EnumChatFormatting.YELLOW + + " " + + progressString + + EnumChatFormatting.GOLD + + "/" + + EnumChatFormatting.YELLOW + + nextTierString ); tooltip.add(""); tooltip.add(EnumChatFormatting.DARK_GRAY.toString() + EnumChatFormatting.ITALIC + "Community Goals are"); - tooltip.add(EnumChatFormatting.DARK_GRAY.toString() + EnumChatFormatting.ITALIC + "collaborative - anyone with a"); - tooltip.add(EnumChatFormatting.DARK_GRAY.toString() + EnumChatFormatting.ITALIC + "Bingo profile can help to reach"); + tooltip.add( + EnumChatFormatting.DARK_GRAY.toString() + EnumChatFormatting.ITALIC + "collaborative - anyone with a"); + tooltip.add( + EnumChatFormatting.DARK_GRAY.toString() + EnumChatFormatting.ITALIC + "Bingo profile can help to reach"); tooltip.add(EnumChatFormatting.DARK_GRAY.toString() + EnumChatFormatting.ITALIC + "the goal!"); tooltip.add(""); tooltip.add(EnumChatFormatting.DARK_GRAY.toString() + EnumChatFormatting.ITALIC + "The more you contribute"); - tooltip.add(EnumChatFormatting.DARK_GRAY.toString() + EnumChatFormatting.ITALIC + "towards the goal, the more you"); + tooltip.add( + EnumChatFormatting.DARK_GRAY.toString() + EnumChatFormatting.ITALIC + "towards the goal, the more you"); tooltip.add(EnumChatFormatting.DARK_GRAY.toString() + EnumChatFormatting.ITALIC + "will be rewarded"); if (finalTier == totalTiers) { @@ -287,7 +299,14 @@ public class BingoPage extends GuiProfileViewerPage { private void showMissingDataMessage(int guiLeft, int guiTop) { String message = EnumChatFormatting.RED + "No Bingo data for current event!"; - Utils.drawStringCentered(message, Minecraft.getMinecraft().fontRendererObj, guiLeft + 431 / 2f, guiTop + 101, true, 0); + Utils.drawStringCentered( + message, + Minecraft.getMinecraft().fontRendererObj, + guiLeft + 431 / 2f, + guiTop + 101, + true, + 0 + ); } private List jsonArrayToStringList(JsonArray completedGoals) { @@ -314,18 +333,14 @@ public class BingoPage extends GuiProfileViewerPage { if (currentTime - lastResourceRequest < 120 * 1000 && bingoGoals != null) return; lastResourceRequest = currentTime; - HashMap args = new HashMap<>(); - NotEnoughUpdates.INSTANCE.manager.hypixelApi.getHypixelApiAsync( - NotEnoughUpdates.INSTANCE.config.apiData.apiKey, - "resources/skyblock/bingo", - args, - jsonObject -> { + NotEnoughUpdates.INSTANCE.manager.apiUtils + .newAnonymousHypixelApiRequest("resources/skyblock/bingo") + .requestJson() + .thenAccept(jsonObject -> { if (jsonObject.has("success") && jsonObject.get("success").getAsBoolean()) { bingoGoals = jsonArrayToJsonObjectList(jsonObject.get("goals").getAsJsonArray()); currentEventId = jsonObject.get("id").getAsInt(); } - }, - () -> {} - ); + }); } } 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 83d8fab9..094f3892 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -165,7 +165,9 @@ public class GuiProfileViewer extends GuiScreen { NotEnoughUpdates.INSTANCE.config.profileViewer.showPronounsInPv ? Optional.ofNullable(profile).map(it -> Utils.parseDashlessUUID(it.getUuid())) : Optional.empty(), - uuid -> CompletableFuture.supplyAsync(() -> uuid.flatMap(PronounDB::getPronounsFor)) + uuid -> uuid.isPresent() + ? PronounDB.getPronounsFor(uuid.get()) + : CompletableFuture.completedFuture(Optional.empty()) ); public final GuiElementTextField playerNameTextField; public final GuiElementTextField inventoryTextField = new GuiElementTextField("", GuiElementTextField.SCALE_TEXT); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java index 94dbdc1e..d3b43e20 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/MiningPage.java @@ -75,7 +75,12 @@ public class MiningPage extends GuiProfileViewerPage { if (levelObjhotm == null) { float hotmXp = Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.experience"), 0); levelObjhotm = - ProfileViewer.getLevel(Utils.getElementOrDefault(leveling, "HOTM", new JsonArray()).getAsJsonArray(), hotmXp, 7, false); + ProfileViewer.getLevel( + Utils.getElementOrDefault(leveling, "HOTM", new JsonArray()).getAsJsonArray(), + hotmXp, + 7, + false + ); levelObjhotms.put(profileId, levelObjhotm); } @@ -83,37 +88,63 @@ public class MiningPage extends GuiProfileViewerPage { //The stats that show float mithrilPowder = Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.powder_mithril"), 0); float gemstonePowder = Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.powder_gemstone"), 0); - float mithrilPowderTotal = Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.powder_spent_mithril"), 0); - float gemstonePowderTotal = (Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.powder_spent_gemstone"), 0)); + float mithrilPowderTotal = Utils.getElementAsFloat(Utils.getElement( + profileInfo, + "mining_core.powder_spent_mithril" + ), 0); + float gemstonePowderTotal = (Utils.getElementAsFloat(Utils.getElement( + profileInfo, + "mining_core.powder_spent_gemstone" + ), 0)); String jadeCrystal = (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.jade_crystal.state"), "Not Found")); float crystalPlacedAmount = (Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.crystals.jade_crystal.total_placed"), 0)); String jadeCrystalString = "§c✖"; String amethystCrystal = - (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.amethyst_crystal.state"), "Not Found")); + (Utils.getElementAsString( + Utils.getElement(profileInfo, "mining_core.crystals.amethyst_crystal.state"), + "Not Found" + )); String amethystCrystalString = "§c✖"; String amberCrystal = - (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.amber_crystal.state"), "Not Found")); + (Utils.getElementAsString( + Utils.getElement(profileInfo, "mining_core.crystals.amber_crystal.state"), + "Not Found" + )); String amberCrystalString = "§c✖"; String sapphireCrystal = - (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.sapphire_crystal.state"), "Not Found")); + (Utils.getElementAsString( + Utils.getElement(profileInfo, "mining_core.crystals.sapphire_crystal.state"), + "Not Found" + )); String sapphireCrystalString = "§c✖"; String topazCrystal = - (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.topaz_crystal.state"), "Not Found")); + (Utils.getElementAsString( + Utils.getElement(profileInfo, "mining_core.crystals.topaz_crystal.state"), + "Not Found" + )); String topazCrystalString = "§c✖"; String jasperCrystal = - (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.jasper_crystal.state"), "Not Found")); + (Utils.getElementAsString( + Utils.getElement(profileInfo, "mining_core.crystals.jasper_crystal.state"), + "Not Found" + )); String jasperCrystalString = "§c✖"; String rubyCrystal = (Utils.getElementAsString(Utils.getElement(profileInfo, "mining_core.crystals.ruby_crystal.state"), "Not Found")); String rubyCrystalString = "§c✖"; int miningFortune = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_fortune"), 0))); - int miningFortuneStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_fortune"), 0)) * 5); + int miningFortuneStat = ((Utils.getElementAsInt( + Utils.getElement(profileInfo, "mining_core.nodes.mining_fortune"), + 0 + )) * 5); int miningSpeed = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_speed"), 0))); - int miningSpeedStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_speed"), 0)) * 20); + int miningSpeedStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_speed"), 0)) * + 20); int dailyPowder = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.daily_powder"), 0))); - int dailyPowderStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.daily_powder"), 0)) * 36 + 364); + int dailyPowderStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.daily_powder"), 0)) * + 36 + 364); int effMiner = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.efficient_miner"), 0))); float effMinerStat = (float) ( (Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.efficient_miner"), 0)) * 0.4 + 10.4 @@ -121,7 +152,10 @@ public class MiningPage extends GuiProfileViewerPage { float effMinerStat2 = (float) ( (Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.efficient_miner"), 0)) * .06 + 0.31 ); - int tittyInsane = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.titanium_insanium"), 0))); + int tittyInsane = ((Utils.getElementAsInt( + Utils.getElement(profileInfo, "mining_core.nodes.titanium_insanium"), + 0 + ))); float tittyInsaneStat = (float) ( (Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.titanium_insanium"), 0)) * .1 + 2 ); @@ -143,23 +177,48 @@ public class MiningPage extends GuiProfileViewerPage { float orbitStat = (float) ( (Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.experience_orbs"), 0)) * .01 + 0.2 ); - int crystallized = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.fallen_star_bonus"), 0))); - int crystallizedStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.fallen_star_bonus"), 0)) * 6 + 14); + int crystallized = ((Utils.getElementAsInt( + Utils.getElement(profileInfo, "mining_core.nodes.fallen_star_bonus"), + 0 + ))); + int crystallizedStat = ((Utils.getElementAsInt( + Utils.getElement(profileInfo, "mining_core.nodes.fallen_star_bonus"), + 0 + )) * 6 + 14); int professional = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.professional"), 0))); - int professionalStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.professional"), 0)) * 5 + 50); + int professionalStat = ((Utils.getElementAsInt( + Utils.getElement(profileInfo, "mining_core.nodes.professional"), + 0 + )) * 5 + 50); int greatExplorer = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.great_explorer"), 0))); - int greatExplorerStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.great_explorer"), 0)) * 4 + 16); + int greatExplorerStat = ((Utils.getElementAsInt( + Utils.getElement(profileInfo, "mining_core.nodes.great_explorer"), + 0 + )) * 4 + 16); int fortunate = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.fortunate"), 0))); - int fortunateStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.fortunate"), 0)) * 4 + 20); + int fortunateStat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.fortunate"), 0)) * 4 + + 20); int lonesomeMiner = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.lonesome_miner"), 0))); float lonesomeMinerStat = (float) ( (Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.lonesome_miner"), 0)) * .5 + 5 ); - int miningFortune2 = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_fortune_2"), 0))); - int miningFortune2Stat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_fortune_2"), 0)) * 5); + int miningFortune2 = ((Utils.getElementAsInt( + Utils.getElement(profileInfo, "mining_core.nodes.mining_fortune_2"), + 0 + ))); + int miningFortune2Stat = ((Utils.getElementAsInt(Utils.getElement( + profileInfo, + "mining_core.nodes.mining_fortune_2" + ), 0)) * 5); int miningSpeed2 = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_speed_2"), 0))); - int miningSpeed2Stat = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_speed_2"), 0)) * 40); - int miningSpeedBoost = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mining_speed_boost"), 0))); + int miningSpeed2Stat = ((Utils.getElementAsInt( + Utils.getElement(profileInfo, "mining_core.nodes.mining_speed_2"), + 0 + )) * 40); + int miningSpeedBoost = ((Utils.getElementAsInt(Utils.getElement( + profileInfo, + "mining_core.nodes.mining_speed_boost" + ), 0))); int veinSeeker = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.vein_seeker"), 0))); int powderBuff = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.powder_buff"), 0))); int potm = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.special_0"), 0))); @@ -172,7 +231,8 @@ public class MiningPage extends GuiProfileViewerPage { effMinerStat2 = 1; } int mole = ((Utils.getElementAsInt(Utils.getElement(profileInfo, "mining_core.nodes.mole"), 0))); - float moleStat = (float) ((Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.mole"), 0)) * 0.051); + float moleStat = (float) ((Utils.getElementAsFloat(Utils.getElement(profileInfo, "mining_core.nodes.mole"), 0)) * + 0.051); double moleperkstat = (double) mole / 20 - 0.55 + 50; double moleperkstat2 = (double) Math.round(moleperkstat * 100) / 100; @@ -320,35 +380,35 @@ public class MiningPage extends GuiProfileViewerPage { () -> miningSpeed != 50 && miningSpeed != 0 ? Lists.newArrayList( - "Mining Speed", - EnumChatFormatting.GRAY + "Level " + miningSpeed + EnumChatFormatting.DARK_GRAY + "/50", - "", - EnumChatFormatting.GRAY + + "Mining Speed", + EnumChatFormatting.GRAY + "Level " + miningSpeed + EnumChatFormatting.DARK_GRAY + "/50", + "", + EnumChatFormatting.GRAY + "Grants " + EnumChatFormatting.GREEN + "+" + miningSpeedStat + EnumChatFormatting.GOLD + " ⸕ Mining", - EnumChatFormatting.GOLD + "Speed" + EnumChatFormatting.GRAY + ".", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + + EnumChatFormatting.GOLD + "Speed" + EnumChatFormatting.GRAY + ".", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.DARK_GREEN + "" + GuiProfileViewer.numberFormat.format(Math.pow(miningSpeed + 2, 3)) + " Mithril Powder" - ) + ) : Lists.newArrayList( "Mining Speed", EnumChatFormatting.GRAY + "Level " + miningSpeed + EnumChatFormatting.DARK_GRAY + "/50", "", EnumChatFormatting.GRAY + - "Grants " + - EnumChatFormatting.GREEN + - "+" + - miningSpeedStat + - EnumChatFormatting.GOLD + - " ⸕ Mining", + "Grants " + + EnumChatFormatting.GREEN + + "+" + + miningSpeedStat + + EnumChatFormatting.GOLD + + " ⸕ Mining", EnumChatFormatting.GOLD + "Speed" + EnumChatFormatting.GRAY + "." ), 50 @@ -363,35 +423,35 @@ public class MiningPage extends GuiProfileViewerPage { () -> miningFortune != 0 && miningFortune != 50 ? Lists.newArrayList( - "Mining Fortune", - EnumChatFormatting.GRAY + "Level " + miningFortune + EnumChatFormatting.DARK_GRAY + "/50", - "", - EnumChatFormatting.GRAY + + "Mining Fortune", + EnumChatFormatting.GRAY + "Level " + miningFortune + EnumChatFormatting.DARK_GRAY + "/50", + "", + EnumChatFormatting.GRAY + "Grants " + EnumChatFormatting.GREEN + "+" + miningFortuneStat + EnumChatFormatting.GOLD + " ☘ Mining", - EnumChatFormatting.GOLD + "Fortune" + EnumChatFormatting.GRAY + ".", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + + EnumChatFormatting.GOLD + "Fortune" + EnumChatFormatting.GRAY + ".", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.DARK_GREEN + "" + GuiProfileViewer.numberFormat.format(Math.pow(miningFortune + 2, 3)) + " Mithril Powder" - ) + ) : Lists.newArrayList( "Mining Fortune", EnumChatFormatting.GRAY + "Level " + miningFortune + EnumChatFormatting.DARK_GRAY + "/50", "", EnumChatFormatting.GRAY + - "Grants " + - EnumChatFormatting.GREEN + - "+" + - miningFortuneStat + - EnumChatFormatting.GOLD + - " ☘ Mining", + "Grants " + + EnumChatFormatting.GREEN + + "+" + + miningFortuneStat + + EnumChatFormatting.GOLD + + " ☘ Mining", EnumChatFormatting.GOLD + "Fortune" + EnumChatFormatting.GRAY + "." ), 50 @@ -406,38 +466,38 @@ public class MiningPage extends GuiProfileViewerPage { () -> tittyInsane != 0 && tittyInsane != 50 ? Lists.newArrayList( - "Titanium Insanium", - EnumChatFormatting.GRAY + "Level " + tittyInsane + EnumChatFormatting.DARK_GRAY + "/50", - "", - EnumChatFormatting.GRAY + "When mining Mithril Ore, you", - EnumChatFormatting.GRAY + + "Titanium Insanium", + EnumChatFormatting.GRAY + "Level " + tittyInsane + EnumChatFormatting.DARK_GRAY + "/50", + "", + EnumChatFormatting.GRAY + "When mining Mithril Ore, you", + EnumChatFormatting.GRAY + "have a " + EnumChatFormatting.GREEN + tittyInsaneStat + "% " + EnumChatFormatting.GRAY + "chance to", - EnumChatFormatting.GRAY + "convert the block into Titanium", - EnumChatFormatting.GRAY + "Ore.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + + EnumChatFormatting.GRAY + "convert the block into Titanium", + EnumChatFormatting.GRAY + "Ore.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.DARK_GREEN + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(tittyInsane + 2, 3)) + " Mithril Powder" - ) + ) : Lists.newArrayList( "Titanium Insanium", EnumChatFormatting.GRAY + "Level " + tittyInsane + EnumChatFormatting.DARK_GRAY + "/50", "", EnumChatFormatting.GRAY + "When mining Mithril Ore, you", EnumChatFormatting.GRAY + - "have a " + - EnumChatFormatting.GREEN + - tittyInsaneStat + - "% " + - EnumChatFormatting.GRAY + - "chance to", + "have a " + + EnumChatFormatting.GREEN + + tittyInsaneStat + + "% " + + EnumChatFormatting.GRAY + + "chance to", EnumChatFormatting.GRAY + "convert the block into Titanium", EnumChatFormatting.GRAY + "Ore." ), @@ -453,31 +513,33 @@ public class MiningPage extends GuiProfileViewerPage { () -> potm == 0 ? Lists.newArrayList( // Peak of the mountain == 0 - "Mining Speed Boost", - "", - EnumChatFormatting.GRAY + "Pickaxe Ability: Mining Speed Boost", - EnumChatFormatting.GRAY + "Grants " + EnumChatFormatting.GREEN + "200% " + EnumChatFormatting.GOLD + "⸕ Mining", - EnumChatFormatting.GOLD + + "Mining Speed Boost", + "", + EnumChatFormatting.GRAY + "Pickaxe Ability: Mining Speed Boost", + EnumChatFormatting.GRAY + "Grants " + EnumChatFormatting.GREEN + "200% " + EnumChatFormatting.GOLD + + "⸕ Mining", + EnumChatFormatting.GOLD + "Speed " + EnumChatFormatting.GRAY + "for " + EnumChatFormatting.GREEN + "15s" + EnumChatFormatting.GRAY, - EnumChatFormatting.DARK_GRAY + "Cooldown: " + EnumChatFormatting.GREEN + "120s" - ) + EnumChatFormatting.DARK_GRAY + "Cooldown: " + EnumChatFormatting.GREEN + "120s" + ) : Lists.newArrayList( // Peak of the mountain > 0 "Mining Speed Boost", "", EnumChatFormatting.GRAY + "Pickaxe Ability: Mining Speed Boost", - EnumChatFormatting.GRAY + "Grants " + EnumChatFormatting.GREEN + "300% " + EnumChatFormatting.GOLD + "⸕ Mining", + EnumChatFormatting.GRAY + "Grants " + EnumChatFormatting.GREEN + "300% " + EnumChatFormatting.GOLD + + "⸕ Mining", EnumChatFormatting.GOLD + - "Speed " + - EnumChatFormatting.GRAY + - "for " + - EnumChatFormatting.GREEN + - "20s" + - EnumChatFormatting.GRAY, + "Speed " + + EnumChatFormatting.GRAY + + "for " + + EnumChatFormatting.GREEN + + "20s" + + EnumChatFormatting.GRAY, EnumChatFormatting.DARK_GRAY + "Cooldown: " + EnumChatFormatting.GREEN + "120s" ) ); @@ -509,19 +571,19 @@ public class MiningPage extends GuiProfileViewerPage { () -> luckofcave != 0 && luckofcave != 45 ? Lists.newArrayList( - "Luck of the Cave", - "§7Level " + luckofcave + EnumChatFormatting.DARK_GRAY + "/45", - "", - "§7Increases the chance for you to", - "§7trigger rare occurrences im", - "§2Dwarven Mines " + EnumChatFormatting.GRAY + "by " + EnumChatFormatting.GREEN + luckofcaveStat + "%§7.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + + "Luck of the Cave", + "§7Level " + luckofcave + EnumChatFormatting.DARK_GRAY + "/45", + "", + "§7Increases the chance for you to", + "§7trigger rare occurrences im", + "§2Dwarven Mines " + EnumChatFormatting.GRAY + "by " + EnumChatFormatting.GREEN + luckofcaveStat + "%§7.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.DARK_GREEN + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(luckofcave + 2, 3.07)) + " Mithril Powder" - ) + ) : Lists.newArrayList( "Luck of the Cave", "§7Level " + luckofcave + EnumChatFormatting.DARK_GRAY + "/45", @@ -542,33 +604,33 @@ public class MiningPage extends GuiProfileViewerPage { () -> dailyPowder != 0 && dailyPowder != 100 ? Lists.newArrayList( - "Daily Powder", - EnumChatFormatting.GRAY + "Level " + dailyPowder + EnumChatFormatting.DARK_GRAY + "/100", - "", - EnumChatFormatting.GRAY + + "Daily Powder", + EnumChatFormatting.GRAY + "Level " + dailyPowder + EnumChatFormatting.DARK_GRAY + "/100", + "", + EnumChatFormatting.GRAY + "Gains " + EnumChatFormatting.GREEN + dailyPowderStat + " Powder" + EnumChatFormatting.GRAY + " from the", - EnumChatFormatting.GRAY + "first ore you mine every day.", - EnumChatFormatting.GRAY + "Works for all Powder types.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + "" + (200 + ((dailyPowder) * 18)) + " Mithril Powder" - ) + EnumChatFormatting.GRAY + "first ore you mine every day.", + EnumChatFormatting.GRAY + "Works for all Powder types.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.DARK_GREEN + "" + (200 + ((dailyPowder) * 18)) + " Mithril Powder" + ) : Lists.newArrayList( "Daily Powder", EnumChatFormatting.GRAY + "Level " + dailyPowder + EnumChatFormatting.DARK_GRAY + "/100", "", EnumChatFormatting.GRAY + - "Gains " + - EnumChatFormatting.GREEN + - dailyPowderStat + - " Powder" + - EnumChatFormatting.GRAY + - " from the", + "Gains " + + EnumChatFormatting.GREEN + + dailyPowderStat + + " Powder" + + EnumChatFormatting.GRAY + + " from the", EnumChatFormatting.GRAY + "first ore you mine every day.", EnumChatFormatting.GRAY + "Works for all Powder types." ), @@ -585,11 +647,11 @@ public class MiningPage extends GuiProfileViewerPage { () -> effMiner != 0 && effMiner != 100 ? Lists.newArrayList( - "Efficient Miner", - EnumChatFormatting.GRAY + "Level " + effMiner + EnumChatFormatting.DARK_GRAY + "/100", - "", - EnumChatFormatting.GRAY + "When mining ores, you have a", - EnumChatFormatting.GREEN + + "Efficient Miner", + EnumChatFormatting.GRAY + "Level " + effMiner + EnumChatFormatting.DARK_GRAY + "/100", + "", + EnumChatFormatting.GRAY + "When mining ores, you have a", + EnumChatFormatting.GREEN + "" + effMinerStat + "%" + @@ -597,27 +659,27 @@ public class MiningPage extends GuiProfileViewerPage { " chance to mine " + EnumChatFormatting.GREEN + Math.round(finalEffMinerStat2), - EnumChatFormatting.GRAY + "adjacent ores.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + + EnumChatFormatting.GRAY + "adjacent ores.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.DARK_GREEN + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(effMiner + 2, 2.6)) + " Mithril Powder" - ) + ) : Lists.newArrayList( "Efficient Miner", EnumChatFormatting.GRAY + "Level " + effMiner + EnumChatFormatting.DARK_GRAY + "/100", "", EnumChatFormatting.GRAY + "When mining ores, you have a", EnumChatFormatting.GREEN + - "" + - effMinerStat + - "%" + - EnumChatFormatting.GRAY + - " chance to mine " + - EnumChatFormatting.GREEN + - Math.round(finalEffMinerStat2), + "" + + effMinerStat + + "%" + + EnumChatFormatting.GRAY + + " chance to mine " + + EnumChatFormatting.GREEN + + Math.round(finalEffMinerStat2), EnumChatFormatting.GRAY + "adjacent ores." ), 100 @@ -634,38 +696,38 @@ public class MiningPage extends GuiProfileViewerPage { case 0: return Lists.newArrayList( EnumChatFormatting.RED + "Peak of the Mountain", - EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/5", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/7", "", EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + "50000 Mithril Powder" + EnumChatFormatting.DARK_GREEN + "50,000 Mithril Powder" ); case 1: return Lists.newArrayList( EnumChatFormatting.YELLOW + "Peak of the Mountain", - EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/5", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/7", "", "§7§8+§c1 Pickaxe Ability Level", "§7§8+§51 Token of the Mountain", "", EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + "50000 Mithril Powder" + EnumChatFormatting.DARK_GREEN + "50,000 Mithril Powder" ); case 2: return Lists.newArrayList( EnumChatFormatting.YELLOW + "Peak of the Mountain", - EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/5", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/7", "", "§7§8+§c1 Pickaxe Ability Level", "§7§8+§51 Token of the Mountain", "§7§8+§a1 Forge Slot", "", EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + "75000 Mithril Powder" + EnumChatFormatting.DARK_GREEN + "75,000 Mithril Powder" ); case 3: return Lists.newArrayList( EnumChatFormatting.YELLOW + "Peak of the Mountain", - EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/5", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/7", "", "§7§8+§c1 Pickaxe Ability Level", "§7§8+§51 Token of the Mountain", @@ -673,12 +735,12 @@ public class MiningPage extends GuiProfileViewerPage { "§7§8+§a1 Commission Slot", "", EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + "100000 Mithril Powder" + EnumChatFormatting.DARK_GREEN + "100,000 Mithril Powder" ); case 4: return Lists.newArrayList( EnumChatFormatting.YELLOW + "Peak of the Mountain", - EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/5", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/7", "", "§7§8+§c1 Pickaxe Ability Level", "§7§8+§51 Token of the Mountain", @@ -688,12 +750,46 @@ public class MiningPage extends GuiProfileViewerPage { "§7mining §fMithril", "", EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + "125000 Mithril Powder" + EnumChatFormatting.DARK_GREEN + "125,000 Mithril Powder" ); case 5: return Lists.newArrayList( EnumChatFormatting.GREEN + "Peak of the Mountain", - EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/5", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/7", + "", + "§7§8+§c1 Pickaxe Ability Level", + "§7§8+§51 Token of the Mountain", + "§7§8+§a1 Forge Slot", + "§7§8+§a1 Commission Slot", + "§7§8+§21 Mithril Powder §7when", + "§7mining §fMithril", + "§7§8+§51 Token of the Mountain", + "", + "§7Cost", + "§d500,000 Gemstone Powder" + ); + case 6: + return Lists.newArrayList( + EnumChatFormatting.GREEN + "Peak of the Mountain", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/7", + "", + "§7§8+§c1 Pickaxe Ability Level", + "§7§8+§51 Token of the Mountain", + "§7§8+§a1 Forge Slot", + "§7§8+§a1 Commission Slot", + "§7§8+§21 Mithril Powder §7when", + "§7mining §fMithril", + "§7§8+§51 Token of the Mountain", + "§7§8+§d2 Gemstone Powder §7when", + "§7mining §dGemstones", + "", + "§7Cost", + "§d750,000 Gemstone Powder" + ); + case 7: + return Lists.newArrayList( + EnumChatFormatting.GREEN + "Peak of the Mountain", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/7", "", "§7§8+§c1 Pickaxe Ability Level", "§7§8+§51 Token of the Mountain", @@ -701,10 +797,18 @@ public class MiningPage extends GuiProfileViewerPage { "§7§8+§a1 Commission Slot", "§7§8+§21 Mithril Powder §7when", "§7mining §fMithril", + "§7§8+§51 Token of the Mountain", + "§7§8+§d2 Gemstone Powder §7when", + "§7mining §dGemstones", "§7§8+§51 Token of the Mountain" ); } - return null; + return Lists.newArrayList( + EnumChatFormatting.GREEN + "Peak of the Mountain", + EnumChatFormatting.GRAY + "Level " + potm + EnumChatFormatting.DARK_GRAY + "/???", + EnumChatFormatting.RED + "It looks like your NEU doesn't understand your peak of the mountain perks.", + EnumChatFormatting.RED + "Please patiently await an update to your NEU installation." + ); }, potm > 0 ? new ItemStack(Blocks.redstone_block) : new ItemStack(Blocks.bedrock), true // A redstone block or bedrock is being rendered, so standard GUI item lighting needs to be enabled. @@ -720,11 +824,11 @@ public class MiningPage extends GuiProfileViewerPage { () -> mole != 0 && mole != 190 ? Lists.newArrayList( - "Mole", - EnumChatFormatting.GRAY + "Level " + mole + EnumChatFormatting.DARK_GRAY + "/190", - "", - EnumChatFormatting.GRAY + "When mining hard stone, you have", - EnumChatFormatting.GRAY + + "Mole", + EnumChatFormatting.GRAY + "Level " + mole + EnumChatFormatting.DARK_GRAY + "/190", + "", + EnumChatFormatting.GRAY + "When mining hard stone, you have", + EnumChatFormatting.GRAY + "a " + EnumChatFormatting.GREEN + finalOutput + @@ -732,38 +836,38 @@ public class MiningPage extends GuiProfileViewerPage { EnumChatFormatting.GRAY + "chance to mine " + EnumChatFormatting.GREEN, - EnumChatFormatting.GREEN + + EnumChatFormatting.GREEN + "" + Math.round(moleStat) + EnumChatFormatting.GRAY + " adjacent hard stone block" + (moleStat == 1.0 ? "." : "s."), - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.LIGHT_PURPLE + + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.LIGHT_PURPLE + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(mole + 2, 2.2)) + " Gemstone Powder" - ) + ) : Lists.newArrayList( "Mole", EnumChatFormatting.GRAY + "Level " + mole + EnumChatFormatting.DARK_GRAY + "/190", "", EnumChatFormatting.GRAY + "When mining hard stone, you have", EnumChatFormatting.GRAY + - "a " + - EnumChatFormatting.GREEN + - finalOutput + - "% " + - EnumChatFormatting.GRAY + - "chance to mine " + - EnumChatFormatting.GREEN, + "a " + + EnumChatFormatting.GREEN + + finalOutput + + "% " + + EnumChatFormatting.GRAY + + "chance to mine " + + EnumChatFormatting.GREEN, EnumChatFormatting.GREEN + - "" + - Math.round(moleStat) + - EnumChatFormatting.GRAY + - " adjacent hard stone block" + - (moleStat == 1.0 ? "." : "s.") + "" + + Math.round(moleStat) + + EnumChatFormatting.GRAY + + " adjacent hard stone block" + + (moleStat == 1.0 ? "." : "s.") ), 190 ); @@ -777,35 +881,35 @@ public class MiningPage extends GuiProfileViewerPage { () -> powderBuff != 0 && powderBuff != 50 ? Lists.newArrayList( - "Powder Buff", - EnumChatFormatting.GRAY + "Level " + powderBuff + EnumChatFormatting.DARK_GRAY + "/50", - "", - EnumChatFormatting.GRAY + + "Powder Buff", + EnumChatFormatting.GRAY + "Level " + powderBuff + EnumChatFormatting.DARK_GRAY + "/50", + "", + EnumChatFormatting.GRAY + "Gain " + EnumChatFormatting.GREEN + powderBuff + "% " + EnumChatFormatting.GRAY + "more Mithril", - EnumChatFormatting.GRAY + "Powder and Gemstone Powder§7.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.LIGHT_PURPLE + + EnumChatFormatting.GRAY + "Powder and Gemstone Powder§7.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.LIGHT_PURPLE + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(powderBuff + 2, 3.2)) + " Gemstone Powder" - ) + ) : Lists.newArrayList( "Powder Buff", EnumChatFormatting.GRAY + "Level " + powderBuff + EnumChatFormatting.DARK_GRAY + "/50", "", EnumChatFormatting.GRAY + - "Gain " + - EnumChatFormatting.GREEN + - powderBuff + - "% " + - EnumChatFormatting.GRAY + - "more Mithril", + "Gain " + + EnumChatFormatting.GREEN + + powderBuff + + "% " + + EnumChatFormatting.GRAY + + "more Mithril", EnumChatFormatting.GRAY + "Powder and Gemstone Powder§7." ), 50 @@ -865,17 +969,17 @@ public class MiningPage extends GuiProfileViewerPage { () -> seasonMine != 0 && seasonMine != 100 ? Lists.newArrayList( - "Seasoned Mineman", - "§7Level " + seasonMine + "§8/100", - "", - "§7Grants §3+" + EnumChatFormatting.DARK_AQUA + seasonMineStat + "☯ Mining Wisdom§7.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + + "Seasoned Mineman", + "§7Level " + seasonMine + "§8/100", + "", + "§7Grants §3+" + EnumChatFormatting.DARK_AQUA + seasonMineStat + "☯ Mining Wisdom§7.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.DARK_GREEN + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(seasonMine + 2, 2.3)) + " Mithril Powder" - ) + ) : Lists.newArrayList( "Seasoned Mineman", "§7Level " + seasonMine + "§8/100", @@ -904,21 +1008,21 @@ public class MiningPage extends GuiProfileViewerPage { () -> lonesomeMiner != 0 && lonesomeMiner != 45 ? Lists.newArrayList( - "Lonesome Miner", - "§7Level " + lonesomeMiner + EnumChatFormatting.DARK_GRAY + "/45", - "", - "§7Increases §c❁ Strength, §9☣ Crit", - "§9Chance, §9☠ Crit Damage, §a❈", - "§aDefense, and §c❤ Health", - "§c§7statistics gain by " + EnumChatFormatting.GREEN + lonesomeMinerStat + "%§7", - "§7while in the Crystal Hollows.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.LIGHT_PURPLE + + "Lonesome Miner", + "§7Level " + lonesomeMiner + EnumChatFormatting.DARK_GRAY + "/45", + "", + "§7Increases §c❁ Strength, §9☣ Crit", + "§9Chance, §9☠ Crit Damage, §a❈", + "§aDefense, and §c❤ Health", + "§c§7statistics gain by " + EnumChatFormatting.GREEN + lonesomeMinerStat + "%§7", + "§7while in the Crystal Hollows.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.LIGHT_PURPLE + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(lonesomeMiner + 2, 3.07)) + " Gemstone Powder" - ) + ) : Lists.newArrayList( "Lonesome Miner", "§7Level " + lonesomeMiner + EnumChatFormatting.DARK_GRAY + "/45", @@ -940,18 +1044,18 @@ public class MiningPage extends GuiProfileViewerPage { () -> professional != 0 && professional != 140 ? Lists.newArrayList( - "Professional", - "§7Level " + professional + EnumChatFormatting.DARK_GRAY + "/140", - "", - "§7Gain §a+" + professionalStat + "§6 ⸕ Mining", - "§6Speed§7 when mining Gemstones.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.LIGHT_PURPLE + + "Professional", + "§7Level " + professional + EnumChatFormatting.DARK_GRAY + "/140", + "", + "§7Gain §a+" + professionalStat + "§6 ⸕ Mining", + "§6Speed§7 when mining Gemstones.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.LIGHT_PURPLE + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(professional + 2, 2.3)) + " Gemstone Powder" - ) + ) : Lists.newArrayList( "Professional", "§7Level " + professional + EnumChatFormatting.DARK_GRAY + "/140", @@ -971,18 +1075,18 @@ public class MiningPage extends GuiProfileViewerPage { () -> miningSpeed2 != 0 && miningSpeed2 != 50 ? Lists.newArrayList( - "Mining Speed 2", - "§7Level " + miningSpeed2 + EnumChatFormatting.DARK_GRAY + "/50", - "", - "§7Grants " + EnumChatFormatting.GREEN + "+" + miningSpeed2Stat + EnumChatFormatting.GOLD + " ⸕ Mining", - "§6Speed§7.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.LIGHT_PURPLE + + "Mining Speed 2", + "§7Level " + miningSpeed2 + EnumChatFormatting.DARK_GRAY + "/50", + "", + "§7Grants " + EnumChatFormatting.GREEN + "+" + miningSpeed2Stat + EnumChatFormatting.GOLD + " ⸕ Mining", + "§6Speed§7.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.LIGHT_PURPLE + "" + GuiProfileViewer.numberFormat.format(Math.pow(miningSpeed2 + 2, 3)) + " Gemstone Powder" - ) + ) : Lists.newArrayList( "Mining Speed 2", "§7Level " + miningSpeed2 + EnumChatFormatting.DARK_GRAY + "/50", @@ -1002,18 +1106,18 @@ public class MiningPage extends GuiProfileViewerPage { () -> quickForge != 0 && quickForge != 20 ? Lists.newArrayList( - "Quick Forge", - "§7Level " + quickForge + EnumChatFormatting.DARK_GRAY + "/20", - "", - "§7Decreases the time it takes to", - "§7forge by §a" + (quickForgeStat < 20 ? quickForgeStat : 30) + "%§7.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + + "Quick Forge", + "§7Level " + quickForge + EnumChatFormatting.DARK_GRAY + "/20", + "", + "§7Decreases the time it takes to", + "§7forge by §a" + (quickForgeStat < 20 ? quickForgeStat : 30) + "%§7.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.DARK_GREEN + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(quickForge + 2, 4)) + " Mithril Powder" - ) + ) : Lists.newArrayList( "Quick Forge", "§7Level " + quickForge + EnumChatFormatting.DARK_GRAY + "/20", @@ -1033,18 +1137,18 @@ public class MiningPage extends GuiProfileViewerPage { () -> fortunate != 0 && fortunate != 20 ? Lists.newArrayList( - "Fortunate", - "§7Level " + fortunate + EnumChatFormatting.DARK_GRAY + "/20", - "", - "§7Gain " + EnumChatFormatting.GREEN + "+" + fortunateStat + " §6☘ Mining", - "§6Fortune§7 when mining Gemstone.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + + "Fortunate", + "§7Level " + fortunate + EnumChatFormatting.DARK_GRAY + "/20", + "", + "§7Gain " + EnumChatFormatting.GREEN + "+" + fortunateStat + " §6☘ Mining", + "§6Fortune§7 when mining Gemstone.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.DARK_GREEN + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(fortunate + 2, 3.05)) + " Mithril Powder" - ) + ) : Lists.newArrayList( "Fortunate", "§7Level " + fortunate + EnumChatFormatting.DARK_GRAY + "/20", @@ -1064,23 +1168,25 @@ public class MiningPage extends GuiProfileViewerPage { () -> greatExplorer != 0 && greatExplorer != 20 ? Lists.newArrayList( - "Great Explorer", - "§7Level " + greatExplorer + EnumChatFormatting.DARK_GRAY + "/20", - "", - "§7Grants " + EnumChatFormatting.GREEN + "+" + greatExplorerStat + "% " + EnumChatFormatting.GRAY + "chance to", - "§7find treasure.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.LIGHT_PURPLE + + "Great Explorer", + "§7Level " + greatExplorer + EnumChatFormatting.DARK_GRAY + "/20", + "", + "§7Grants " + EnumChatFormatting.GREEN + "+" + greatExplorerStat + "% " + EnumChatFormatting.GRAY + + "chance to", + "§7find treasure.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.LIGHT_PURPLE + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(greatExplorer + 2, 4)) + " Gemstone Powder" - ) + ) : Lists.newArrayList( "Great Explorer", "§7Level " + greatExplorer + EnumChatFormatting.DARK_GRAY + "/20", "", - "§7Grants " + EnumChatFormatting.GREEN + "+" + greatExplorerStat + "% " + EnumChatFormatting.GRAY + "chance to", + "§7Grants " + EnumChatFormatting.GREEN + "+" + greatExplorerStat + "% " + EnumChatFormatting.GRAY + + "chance to", "§7find treasure." ), 20 @@ -1095,18 +1201,18 @@ public class MiningPage extends GuiProfileViewerPage { () -> miningFortune2 != 0 && miningFortune2 != 50 ? Lists.newArrayList( - "Mining Fortune 2", - "§7Level " + miningFortune2 + EnumChatFormatting.DARK_GRAY + "/50", - "", - "§7Grants §a+§a" + miningFortune2Stat + "§7 §6☘ Mining", - "§6Fortune§7.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.LIGHT_PURPLE + + "Mining Fortune 2", + "§7Level " + miningFortune2 + EnumChatFormatting.DARK_GRAY + "/50", + "", + "§7Grants §a+§a" + miningFortune2Stat + "§7 §6☘ Mining", + "§6Fortune§7.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.LIGHT_PURPLE + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(miningFortune2 + 2, 3.2)) + " Gemstone Powder" - ) + ) : Lists.newArrayList( "Mining Fortune 2", "§7Level " + miningFortune2 + EnumChatFormatting.DARK_GRAY + "/50", @@ -1126,16 +1232,16 @@ public class MiningPage extends GuiProfileViewerPage { () -> orbit != 0 && orbit != 80 ? Lists.newArrayList( - "Orbiter", - "§7Level " + orbit + EnumChatFormatting.DARK_GRAY + "/80", - "", - "§7When mining ores, you have a", - EnumChatFormatting.GREEN + "" + orbitStat + "%" + EnumChatFormatting.GRAY + " chance to get a random", - "§7amount of experience orbs.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + "" + ((orbit + 1) * 70) + " Mithril Powder" - ) + "Orbiter", + "§7Level " + orbit + EnumChatFormatting.DARK_GRAY + "/80", + "", + "§7When mining ores, you have a", + EnumChatFormatting.GREEN + "" + orbitStat + "%" + EnumChatFormatting.GRAY + " chance to get a random", + "§7amount of experience orbs.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.DARK_GREEN + "" + ((orbit + 1) * 70) + " Mithril Powder" + ) : Lists.newArrayList( "Orbiter", "§7Level " + orbit + EnumChatFormatting.DARK_GRAY + "/80", @@ -1206,20 +1312,20 @@ public class MiningPage extends GuiProfileViewerPage { () -> crystallized != 0 && crystallized != 30 ? Lists.newArrayList( - "Crystallized", - "§7Level " + crystallized + EnumChatFormatting.DARK_GRAY + "/30", - "", - "§7Grants §a+§a" + crystallizedStat + "§7 §6⸕ Mining", - "§6Speed §7and a §a" + crystallizedStat + "%§7 §7chance", - "§7to deal §a+1 §7extra damage near", - "§7§5Fallen Stars§7.", - "", - EnumChatFormatting.GRAY + "Cost", - EnumChatFormatting.DARK_GREEN + + "Crystallized", + "§7Level " + crystallized + EnumChatFormatting.DARK_GRAY + "/30", + "", + "§7Grants §a+§a" + crystallizedStat + "§7 §6⸕ Mining", + "§6Speed §7and a §a" + crystallizedStat + "%§7 §7chance", + "§7to deal §a+1 §7extra damage near", + "§7§5Fallen Stars§7.", + "", + EnumChatFormatting.GRAY + "Cost", + EnumChatFormatting.DARK_GREEN + "" + GuiProfileViewer.numberFormat.format((int) Math.pow(crystallized + 2, 2.4)) + " Mithril Powder" - ) + ) : Lists.newArrayList( "Crystallized", "§7Level " + crystallized + EnumChatFormatting.DARK_GRAY + "/30", @@ -1320,7 +1426,9 @@ public class MiningPage extends GuiProfileViewerPage { ItemStack itemStack; if (isPickaxeAbility) { RenderHelper.enableGUIStandardItemLighting(); // GUI standard item lighting must be enabled for items that are rendered as blocks, like emerald blocks. - itemStack = new ItemStack(unlocked ? Blocks.emerald_block : Blocks.coal_block); // Pickaxe abilities are rendered as blocks + itemStack = new ItemStack(unlocked + ? Blocks.emerald_block + : Blocks.coal_block); // Pickaxe abilities are rendered as blocks } else { // Non-pickaxe abilities are rendered as items itemStack = new ItemStack(unlocked ? (perkLevel >= maxLevel ? Items.diamond : Items.emerald) : Items.coal); } @@ -1329,8 +1437,10 @@ public class MiningPage extends GuiProfileViewerPage { // Prepend the green, yellow, or red color on the first line of each tooltip depending on if the perk is unlocked tooltip.set( 0, - (unlocked ? (perkLevel >= maxLevel ? EnumChatFormatting.GREEN : EnumChatFormatting.YELLOW) : EnumChatFormatting.RED) + - tooltip.get(0) + (unlocked + ? (perkLevel >= maxLevel ? EnumChatFormatting.GREEN : EnumChatFormatting.YELLOW) + : EnumChatFormatting.RED) + + tooltip.get(0) ); NBTTagCompound nbt = new NBTTagCompound(); //Adding NBT Data for Custom Resource Packs 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 c9bd92a3..4aeafb9e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java @@ -27,6 +27,16 @@ import io.github.moulberry.notenoughupdates.NEUManager; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.Utils; +import net.minecraft.init.Blocks; +import net.minecraft.init.Items; +import net.minecraft.item.Item; +import net.minecraft.item.ItemStack; +import net.minecraft.nbt.CompressedStreamTools; +import net.minecraft.nbt.NBTTagCompound; +import net.minecraft.nbt.NBTTagList; +import net.minecraft.util.EnumChatFormatting; + +import javax.annotation.Nullable; import java.io.ByteArrayInputStream; import java.io.IOException; import java.util.ArrayList; @@ -41,15 +51,6 @@ import java.util.concurrent.atomic.AtomicBoolean; import java.util.function.Consumer; import java.util.regex.Matcher; import java.util.regex.Pattern; -import javax.annotation.Nullable; -import net.minecraft.init.Blocks; -import net.minecraft.init.Items; -import net.minecraft.item.Item; -import net.minecraft.item.ItemStack; -import net.minecraft.nbt.CompressedStreamTools; -import net.minecraft.nbt.NBTTagCompound; -import net.minecraft.nbt.NBTTagList; -import net.minecraft.util.EnumChatFormatting; public class ProfileViewer { @@ -63,311 +64,384 @@ public class ProfileViewer { put("MYTHIC", "5"); } }; - private static final LinkedHashMap skillToSkillDisplayMap = new LinkedHashMap() { - { - put("taming", Utils.createItemStack(Items.spawn_egg, EnumChatFormatting.LIGHT_PURPLE + "Taming")); - put("mining", Utils.createItemStack(Items.stone_pickaxe, EnumChatFormatting.GRAY + "Mining")); - put("foraging", Utils.createItemStack(Item.getItemFromBlock(Blocks.sapling), EnumChatFormatting.DARK_GREEN + "Foraging")); - put( - "enchanting", - Utils.createItemStack(Item.getItemFromBlock(Blocks.enchanting_table), EnumChatFormatting.GREEN + "Enchanting") - ); - put( - "carpentry", - Utils.createItemStack(Item.getItemFromBlock(Blocks.crafting_table), EnumChatFormatting.DARK_RED + "Carpentry") - ); - put("farming", Utils.createItemStack(Items.golden_hoe, EnumChatFormatting.YELLOW + "Farming")); - put("combat", Utils.createItemStack(Items.stone_sword, EnumChatFormatting.RED + "Combat")); - put("fishing", Utils.createItemStack(Items.fishing_rod, EnumChatFormatting.AQUA + "Fishing")); - put("alchemy", Utils.createItemStack(Items.brewing_stand, EnumChatFormatting.BLUE + "Alchemy")); - put("runecrafting", Utils.createItemStack(Items.magma_cream, EnumChatFormatting.DARK_PURPLE + "Runecrafting")); - put("social", Utils.createItemStack(Items.emerald, EnumChatFormatting.DARK_GREEN + "Social")); - // put("catacombs", Utils.createItemStack(Item.getItemFromBlock(Blocks.deadbush), EnumChatFormatting.GOLD+"Catacombs")); - put("zombie", Utils.createItemStack(Items.rotten_flesh, EnumChatFormatting.GOLD + "Rev Slayer")); - put("spider", Utils.createItemStack(Items.spider_eye, EnumChatFormatting.GOLD + "Tara Slayer")); - put("wolf", Utils.createItemStack(Items.bone, EnumChatFormatting.GOLD + "Sven Slayer")); - put("enderman", Utils.createItemStack(Items.ender_pearl, EnumChatFormatting.GOLD + "Ender Slayer")); - put("blaze", Utils.createItemStack(Items.blaze_rod, EnumChatFormatting.GOLD + "Blaze Slayer")); - } - }; - private static final ItemStack CAT_FARMING = Utils.createItemStack(Items.golden_hoe, EnumChatFormatting.YELLOW + "Farming"); - private static final ItemStack CAT_MINING = Utils.createItemStack(Items.stone_pickaxe, EnumChatFormatting.GRAY + "Mining"); - private static final ItemStack CAT_COMBAT = Utils.createItemStack(Items.stone_sword, EnumChatFormatting.RED + "Combat"); + private static final LinkedHashMap skillToSkillDisplayMap = + new LinkedHashMap() { + { + put("taming", Utils.createItemStack(Items.spawn_egg, EnumChatFormatting.LIGHT_PURPLE + "Taming")); + put("mining", Utils.createItemStack(Items.stone_pickaxe, EnumChatFormatting.GRAY + "Mining")); + put( + "foraging", + Utils.createItemStack(Item.getItemFromBlock(Blocks.sapling), EnumChatFormatting.DARK_GREEN + "Foraging") + ); + put( + "enchanting", + Utils.createItemStack(Item.getItemFromBlock(Blocks.enchanting_table), EnumChatFormatting.GREEN + "Enchanting") + ); + put( + "carpentry", + Utils.createItemStack(Item.getItemFromBlock(Blocks.crafting_table), EnumChatFormatting.DARK_RED + "Carpentry") + ); + put("farming", Utils.createItemStack(Items.golden_hoe, EnumChatFormatting.YELLOW + "Farming")); + put("combat", Utils.createItemStack(Items.stone_sword, EnumChatFormatting.RED + "Combat")); + put("fishing", Utils.createItemStack(Items.fishing_rod, EnumChatFormatting.AQUA + "Fishing")); + put("alchemy", Utils.createItemStack(Items.brewing_stand, EnumChatFormatting.BLUE + "Alchemy")); + put("runecrafting", Utils.createItemStack(Items.magma_cream, EnumChatFormatting.DARK_PURPLE + "Runecrafting")); + put("social", Utils.createItemStack(Items.emerald, EnumChatFormatting.DARK_GREEN + "Social")); + // put("catacombs", Utils.createItemStack(Item.getItemFromBlock(Blocks.deadbush), EnumChatFormatting.GOLD+"Catacombs")); + put("zombie", Utils.createItemStack(Items.rotten_flesh, EnumChatFormatting.GOLD + "Rev Slayer")); + put("spider", Utils.createItemStack(Items.spider_eye, EnumChatFormatting.GOLD + "Tara Slayer")); + put("wolf", Utils.createItemStack(Items.bone, EnumChatFormatting.GOLD + "Sven Slayer")); + put("enderman", Utils.createItemStack(Items.ender_pearl, EnumChatFormatting.GOLD + "Ender Slayer")); + put("blaze", Utils.createItemStack(Items.blaze_rod, EnumChatFormatting.GOLD + "Blaze Slayer")); + } + }; + private static final ItemStack CAT_FARMING = Utils.createItemStack( + Items.golden_hoe, + EnumChatFormatting.YELLOW + "Farming" + ); + private static final ItemStack CAT_MINING = Utils.createItemStack( + Items.stone_pickaxe, + EnumChatFormatting.GRAY + "Mining" + ); + private static final ItemStack CAT_COMBAT = Utils.createItemStack( + Items.stone_sword, + EnumChatFormatting.RED + "Combat" + ); private static final ItemStack CAT_FORAGING = Utils.createItemStack( Item.getItemFromBlock(Blocks.sapling), EnumChatFormatting.DARK_GREEN + "Foraging" ); - private static final ItemStack CAT_FISHING = Utils.createItemStack(Items.fishing_rod, EnumChatFormatting.AQUA + "Fishing"); - private static final LinkedHashMap> collectionCatToCollectionMap = new LinkedHashMap>() { - { - put( - CAT_FARMING, - Utils.createList( - "WHEAT", - "CARROT_ITEM", - "POTATO_ITEM", + private static final ItemStack CAT_FISHING = Utils.createItemStack( + Items.fishing_rod, + EnumChatFormatting.AQUA + "Fishing" + ); + private static final LinkedHashMap> collectionCatToCollectionMap = + new LinkedHashMap>() { + { + put( + CAT_FARMING, + Utils.createList( + "WHEAT", + "CARROT_ITEM", + "POTATO_ITEM", + "PUMPKIN", + "MELON", + "SEEDS", + "MUSHROOM_COLLECTION", + "INK_SACK:3", + "CACTUS", + "SUGAR_CANE", + "FEATHER", + "LEATHER", + "PORK", + "RAW_CHICKEN", + "MUTTON", + "RABBIT", + "NETHER_STALK" + ) + ); + 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", + null, + "MITHRIL_ORE", + "HARD_STONE", + "GEMSTONE_COLLECTION", + "MYCEL", + "SAND:1", + "SULPHUR_ORE" + ) + ); + put( + CAT_COMBAT, + Utils.createList( + "ROTTEN_FLESH", + "BONE", + "STRING", + "SPIDER_EYE", + "SULPHUR", + "ENDER_PEARL", + "GHAST_TEAR", + "SLIME_BALL", + "BLAZE_ROD", + "MAGMA_CREAM", + null, + null, + null, + null, + "CHILI_PEPPER" + ) + ); + put(CAT_FORAGING, Utils.createList("LOG", "LOG:1", "LOG:2", "LOG_2:1", "LOG_2", "LOG:3", null)); + 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", + "MAGMA_FISH" + ) + ); + } + }; + private static final LinkedHashMap> collectionCatToMinionMap = + new LinkedHashMap>() { + { + put( + CAT_FARMING, + Utils.createList( + "WHEAT", + "CARROT", + "POTATO", + "PUMPKIN", + "MELON", + null, + "MUSHROOM", + "COCOA", + "CACTUS", + "SUGAR_CANE", + "CHICKEN", + "COW", + "PIG", + null, + "SHEEP", + "RABBIT", + "NETHER_WARTS" + ) + ); + put( + CAT_MINING, + Utils.createList( + "COBBLESTONE", + "COAL", + "IRON", + "GOLD", + "DIAMOND", + "LAPIS", + "EMERALD", + "REDSTONE", + "QUARTZ", + "OBSIDIAN", + "GLOWSTONE", + "GRAVEL", + "ICE", + null, + "SAND", + "ENDER_STONE", + "SNOW", + "MITHRIL", + "HARD_STONE", + null, + "MYCELIUM", + "RED_SAND", + null + ) + ); + put( + CAT_COMBAT, + Utils.createList( + "ZOMBIE", + "SKELETON", + "SPIDER", + "CAVESPIDER", + "CREEPER", + "ENDERMAN", + "GHAST", + "SLIME", + "BLAZE", + "MAGMA_CUBE", + "REVENANT", + "TARANTULA", + "VOIDLING", + "INFERNO" + ) + ); + put(CAT_FORAGING, Utils.createList("OAK", "SPRUCE", "BIRCH", "DARK_OAK", "ACACIA", "JUNGLE", "FLOWER")); + put(CAT_FISHING, Utils.createList("FISHING", null, null, null, null, null, "CLAY", null, null, null)); + } + }; + private static final LinkedHashMap collectionToCollectionDisplayMap = + new LinkedHashMap() { + { + /* FARMING COLLECTIONS */ + put("WHEAT", Utils.createItemStack(Items.wheat, EnumChatFormatting.YELLOW + "Wheat")); + put("CARROT_ITEM", Utils.createItemStack(Items.carrot, EnumChatFormatting.YELLOW + "Carrot")); + put("POTATO_ITEM", Utils.createItemStack(Items.potato, EnumChatFormatting.YELLOW + "Potato")); + put( "PUMPKIN", - "MELON", - "SEEDS", + Utils.createItemStack(Item.getItemFromBlock(Blocks.pumpkin), EnumChatFormatting.YELLOW + "Pumpkin") + ); + put("MELON", Utils.createItemStack(Items.melon, EnumChatFormatting.YELLOW + "Melon")); + put("SEEDS", Utils.createItemStack(Items.wheat_seeds, EnumChatFormatting.YELLOW + "Seeds")); + put( "MUSHROOM_COLLECTION", - "INK_SACK:3", + Utils.createItemStack(Item.getItemFromBlock(Blocks.red_mushroom), EnumChatFormatting.YELLOW + "Mushroom") + ); + put("INK_SACK:3", Utils.createItemStack(Items.dye, EnumChatFormatting.YELLOW + "Cocoa Beans", 3)); + put( "CACTUS", - "SUGAR_CANE", - "FEATHER", - "LEATHER", - "PORK", - "RAW_CHICKEN", - "MUTTON", - "RABBIT", - "NETHER_STALK" - ) - ); - put( - CAT_MINING, - Utils.createList( + Utils.createItemStack(Item.getItemFromBlock(Blocks.cactus), EnumChatFormatting.YELLOW + "Cactus") + ); + put("SUGAR_CANE", Utils.createItemStack(Items.reeds, EnumChatFormatting.YELLOW + "Sugar Cane")); + put("FEATHER", Utils.createItemStack(Items.feather, EnumChatFormatting.YELLOW + "Feather")); + put("LEATHER", Utils.createItemStack(Items.leather, EnumChatFormatting.YELLOW + "Leather")); + put("PORK", Utils.createItemStack(Items.porkchop, EnumChatFormatting.YELLOW + "Raw Porkchop")); + put("RAW_CHICKEN", Utils.createItemStack(Items.chicken, EnumChatFormatting.YELLOW + "Raw Chicken")); + put("MUTTON", Utils.createItemStack(Items.mutton, EnumChatFormatting.YELLOW + "Mutton")); + put("RABBIT", Utils.createItemStack(Items.rabbit, EnumChatFormatting.YELLOW + "Raw Rabbit")); + put("NETHER_STALK", Utils.createItemStack(Items.nether_wart, EnumChatFormatting.YELLOW + "Nether Wart")); + + /* MINING COLLECTIONS */ + put( "COBBLESTONE", - "COAL", - "IRON_INGOT", - "GOLD_INGOT", - "DIAMOND", - "INK_SACK:4", - "EMERALD", - "REDSTONE", - "QUARTZ", + Utils.createItemStack(Item.getItemFromBlock(Blocks.cobblestone), EnumChatFormatting.GRAY + "Cobblestone") + ); + put("COAL", Utils.createItemStack(Items.coal, EnumChatFormatting.GRAY + "Coal")); + put("IRON_INGOT", Utils.createItemStack(Items.iron_ingot, EnumChatFormatting.GRAY + "Iron Ingot")); + put("GOLD_INGOT", Utils.createItemStack(Items.gold_ingot, EnumChatFormatting.GRAY + "Gold Ingot")); + put("DIAMOND", Utils.createItemStack(Items.diamond, EnumChatFormatting.GRAY + "Diamond")); + put("INK_SACK:4", Utils.createItemStack(Items.dye, EnumChatFormatting.GRAY + "Lapis Lazuli", 4)); + put("EMERALD", Utils.createItemStack(Items.emerald, EnumChatFormatting.GRAY + "Emerald")); + put("REDSTONE", Utils.createItemStack(Items.redstone, EnumChatFormatting.GRAY + "Redstone")); + put("QUARTZ", Utils.createItemStack(Items.quartz, EnumChatFormatting.GRAY + "Nether Quartz")); + put( "OBSIDIAN", - "GLOWSTONE_DUST", - "GRAVEL", - "ICE", + Utils.createItemStack(Item.getItemFromBlock(Blocks.obsidian), EnumChatFormatting.GRAY + "Obsidian") + ); + put("GLOWSTONE_DUST", Utils.createItemStack(Items.glowstone_dust, EnumChatFormatting.GRAY + "Glowstone Dust")); + put("GRAVEL", Utils.createItemStack(Item.getItemFromBlock(Blocks.gravel), EnumChatFormatting.GRAY + "Gravel")); + put("ICE", Utils.createItemStack(Item.getItemFromBlock(Blocks.ice), EnumChatFormatting.GRAY + "Ice")); + put( "NETHERRACK", - "SAND", + Utils.createItemStack(Item.getItemFromBlock(Blocks.netherrack), EnumChatFormatting.GRAY + "Netherrack") + ); + put("SAND", Utils.createItemStack(Item.getItemFromBlock(Blocks.sand), EnumChatFormatting.GRAY + "Sand")); + put( "ENDER_STONE", - null, - "MITHRIL_ORE", + Utils.createItemStack(Item.getItemFromBlock(Blocks.end_stone), EnumChatFormatting.GRAY + "End Stone") + ); + put("MITHRIL_ORE", Utils.createItemStack(Items.prismarine_crystals, EnumChatFormatting.GRAY + "Mithril")); + put( "HARD_STONE", + Utils.createItemStack(Item.getItemFromBlock(Blocks.stone), EnumChatFormatting.GRAY + "Hard Stone") + ); + put( "GEMSTONE_COLLECTION", + Utils.createSkull( + EnumChatFormatting.GRAY + "Gemstone", + "e942eb66-a350-38e5-aafa-0dfc3e17b4ac", + "ewogICJ0aW1lc3RhbXAiIDogMTYxODA4Mzg4ODc3MSwKICAicHJvZmlsZUlkIiA6ICJjNTBhZmE4YWJlYjk0ZTQ1OTRiZjFiNDI1YTk4MGYwMiIsCiAgInByb2ZpbGVOYW1lIiA6ICJUd29FQmFlIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2FhYzE1ZjZmY2YyY2U5NjNlZjRjYTcxZjFhODY4NWFkYjk3ZWI3NjllMWQxMTE5NGNiYmQyZTk2NGE4ODk3OGMiCiAgICB9CiAgfQp9" + ) + ); + put( "MYCEL", + Utils.createItemStack(Item.getItemFromBlock(Blocks.mycelium), EnumChatFormatting.GRAY + "Mycelium") + ); + put( "SAND:1", - "SULPHUR_ORE" - ) - ); - put( - CAT_COMBAT, - Utils.createList( - "ROTTEN_FLESH", - "BONE", - "STRING", - "SPIDER_EYE", - "SULPHUR", - "ENDER_PEARL", - "GHAST_TEAR", - "SLIME_BALL", - "BLAZE_ROD", - "MAGMA_CREAM", - null, - null, - null, - null, - "CHILI_PEPPER" - ) - ); - put(CAT_FORAGING, Utils.createList("LOG", "LOG:1", "LOG:2", "LOG_2:1", "LOG_2", "LOG:3", null)); - put( - CAT_FISHING, - Utils.createList( - "RAW_FISH", - "RAW_FISH:1", - "RAW_FISH:2", - "RAW_FISH:3", + Utils.createItemStack(Item.getItemFromBlock(Blocks.sand), EnumChatFormatting.GRAY + "Red Sand", 1) + ); + put("SULPHUR_ORE", Utils.createItemStack(Items.glowstone_dust, EnumChatFormatting.GRAY + "Sulphur")); + + /* COMBAT COLLECTIONS */ + put("ROTTEN_FLESH", Utils.createItemStack(Items.rotten_flesh, EnumChatFormatting.RED + "Rotten Flesh")); + put("BONE", Utils.createItemStack(Items.bone, EnumChatFormatting.RED + "Bone")); + put("STRING", Utils.createItemStack(Items.string, EnumChatFormatting.RED + "String")); + put("SPIDER_EYE", Utils.createItemStack(Items.spider_eye, EnumChatFormatting.RED + "Spider Eye")); + put("SULPHUR", Utils.createItemStack(Items.gunpowder, EnumChatFormatting.RED + "Gunpowder")); + put("ENDER_PEARL", Utils.createItemStack(Items.ender_pearl, EnumChatFormatting.RED + "Ender Pearl")); + put("GHAST_TEAR", Utils.createItemStack(Items.ghast_tear, EnumChatFormatting.RED + "Ghast Tear")); + put("SLIME_BALL", Utils.createItemStack(Items.slime_ball, EnumChatFormatting.RED + "Slimeball")); + put("BLAZE_ROD", Utils.createItemStack(Items.blaze_rod, EnumChatFormatting.RED + "Blaze Rod")); + put("MAGMA_CREAM", Utils.createItemStack(Items.magma_cream, EnumChatFormatting.RED + "Magma Cream")); + put( + "CHILI_PEPPER", + Utils.createSkull( + EnumChatFormatting.RED + "Chili Pepper", + "3d47abaa-b40b-3826-b20c-d83a7f053bd9", + "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjg1OWM4ZGYxMTA5YzA4YTc1NjI3NWYxZDI4ODdjMjc0ODA0OWZlMzM4Nzc3NjlhN2I0MTVkNTZlZGE0NjlkOCJ9fX0" + ) + ); + + /* FORAGING COLLECTIONS */ + put( + "LOG", + Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Oak Wood") + ); + put( + "LOG:1", + Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Spruce Wood", 1) + ); + put( + "LOG:2", + Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Birch Wood", 2) + ); + put( + "LOG_2:1", + Utils.createItemStack(Item.getItemFromBlock(Blocks.log2), EnumChatFormatting.DARK_GREEN + "Dark Oak Wood", 1) + ); + put( + "LOG_2", + Utils.createItemStack(Item.getItemFromBlock(Blocks.log2), EnumChatFormatting.DARK_GREEN + "Acacia Wood") + ); + put( + "LOG:3", + Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Jungle Wood", 3) + ); + + /* FISHING COLLECTIONS */ + put("RAW_FISH", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Raw Fish")); + put("RAW_FISH:1", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Raw Salmon", 1)); + put("RAW_FISH:2", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Clownfish", 2)); + put("RAW_FISH:3", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Pufferfish", 3)); + put( "PRISMARINE_SHARD", + Utils.createItemStack(Items.prismarine_shard, EnumChatFormatting.AQUA + "Prismarine Shard") + ); + put( "PRISMARINE_CRYSTALS", - "CLAY_BALL", + Utils.createItemStack(Items.prismarine_crystals, EnumChatFormatting.AQUA + "Prismarine Crystals") + ); + put("CLAY_BALL", Utils.createItemStack(Items.clay_ball, EnumChatFormatting.AQUA + "Clay")); + put( "WATER_LILY", - "INK_SACK", - "SPONGE", - "MAGMA_FISH" - ) - ); - } - }; - private static final LinkedHashMap> collectionCatToMinionMap = new LinkedHashMap>() { - { - put( - CAT_FARMING, - Utils.createList( - "WHEAT", - "CARROT", - "POTATO", - "PUMPKIN", - "MELON", - null, - "MUSHROOM", - "COCOA", - "CACTUS", - "SUGAR_CANE", - "CHICKEN", - "COW", - "PIG", - null, - "SHEEP", - "RABBIT", - "NETHER_WARTS" - ) - ); - put( - CAT_MINING, - Utils.createList( - "COBBLESTONE", - "COAL", - "IRON", - "GOLD", - "DIAMOND", - "LAPIS", - "EMERALD", - "REDSTONE", - "QUARTZ", - "OBSIDIAN", - "GLOWSTONE", - "GRAVEL", - "ICE", - null, - "SAND", - "ENDER_STONE", - "SNOW", - "MITHRIL", - "HARD_STONE", - null, - "MYCELIUM", - "RED_SAND", - null - ) - ); - put( - CAT_COMBAT, - Utils.createList( - "ZOMBIE", - "SKELETON", - "SPIDER", - "CAVESPIDER", - "CREEPER", - "ENDERMAN", - "GHAST", - "SLIME", - "BLAZE", - "MAGMA_CUBE", - "REVENANT", - "TARANTULA", - "VOIDLING", - "INFERNO" - ) - ); - put(CAT_FORAGING, Utils.createList("OAK", "SPRUCE", "BIRCH", "DARK_OAK", "ACACIA", "JUNGLE", "FLOWER")); - put(CAT_FISHING, Utils.createList("FISHING", null, null, null, null, null, "CLAY", null, null, null)); - } - }; - private static final LinkedHashMap collectionToCollectionDisplayMap = new LinkedHashMap() { - { - /* FARMING COLLECTIONS */ - put("WHEAT", Utils.createItemStack(Items.wheat, EnumChatFormatting.YELLOW + "Wheat")); - put("CARROT_ITEM", Utils.createItemStack(Items.carrot, EnumChatFormatting.YELLOW + "Carrot")); - put("POTATO_ITEM", Utils.createItemStack(Items.potato, EnumChatFormatting.YELLOW + "Potato")); - put("PUMPKIN", Utils.createItemStack(Item.getItemFromBlock(Blocks.pumpkin), EnumChatFormatting.YELLOW + "Pumpkin")); - put("MELON", Utils.createItemStack(Items.melon, EnumChatFormatting.YELLOW + "Melon")); - put("SEEDS", Utils.createItemStack(Items.wheat_seeds, EnumChatFormatting.YELLOW + "Seeds")); - put( - "MUSHROOM_COLLECTION", - Utils.createItemStack(Item.getItemFromBlock(Blocks.red_mushroom), EnumChatFormatting.YELLOW + "Mushroom") - ); - put("INK_SACK:3", Utils.createItemStack(Items.dye, EnumChatFormatting.YELLOW + "Cocoa Beans", 3)); - put("CACTUS", Utils.createItemStack(Item.getItemFromBlock(Blocks.cactus), EnumChatFormatting.YELLOW + "Cactus")); - put("SUGAR_CANE", Utils.createItemStack(Items.reeds, EnumChatFormatting.YELLOW + "Sugar Cane")); - put("FEATHER", Utils.createItemStack(Items.feather, EnumChatFormatting.YELLOW + "Feather")); - put("LEATHER", Utils.createItemStack(Items.leather, EnumChatFormatting.YELLOW + "Leather")); - put("PORK", Utils.createItemStack(Items.porkchop, EnumChatFormatting.YELLOW + "Raw Porkchop")); - put("RAW_CHICKEN", Utils.createItemStack(Items.chicken, EnumChatFormatting.YELLOW + "Raw Chicken")); - put("MUTTON", Utils.createItemStack(Items.mutton, EnumChatFormatting.YELLOW + "Mutton")); - put("RABBIT", Utils.createItemStack(Items.rabbit, EnumChatFormatting.YELLOW + "Raw Rabbit")); - put("NETHER_STALK", Utils.createItemStack(Items.nether_wart, EnumChatFormatting.YELLOW + "Nether Wart")); - - /* MINING COLLECTIONS */ - put("COBBLESTONE", Utils.createItemStack(Item.getItemFromBlock(Blocks.cobblestone), EnumChatFormatting.GRAY + "Cobblestone")); - put("COAL", Utils.createItemStack(Items.coal, EnumChatFormatting.GRAY + "Coal")); - put("IRON_INGOT", Utils.createItemStack(Items.iron_ingot, EnumChatFormatting.GRAY + "Iron Ingot")); - put("GOLD_INGOT", Utils.createItemStack(Items.gold_ingot, EnumChatFormatting.GRAY + "Gold Ingot")); - put("DIAMOND", Utils.createItemStack(Items.diamond, EnumChatFormatting.GRAY + "Diamond")); - put("INK_SACK:4", Utils.createItemStack(Items.dye, EnumChatFormatting.GRAY + "Lapis Lazuli", 4)); - put("EMERALD", Utils.createItemStack(Items.emerald, EnumChatFormatting.GRAY + "Emerald")); - put("REDSTONE", Utils.createItemStack(Items.redstone, EnumChatFormatting.GRAY + "Redstone")); - put("QUARTZ", Utils.createItemStack(Items.quartz, EnumChatFormatting.GRAY + "Nether Quartz")); - put("OBSIDIAN", Utils.createItemStack(Item.getItemFromBlock(Blocks.obsidian), EnumChatFormatting.GRAY + "Obsidian")); - put("GLOWSTONE_DUST", Utils.createItemStack(Items.glowstone_dust, EnumChatFormatting.GRAY + "Glowstone Dust")); - put("GRAVEL", Utils.createItemStack(Item.getItemFromBlock(Blocks.gravel), EnumChatFormatting.GRAY + "Gravel")); - put("ICE", Utils.createItemStack(Item.getItemFromBlock(Blocks.ice), EnumChatFormatting.GRAY + "Ice")); - put("NETHERRACK", Utils.createItemStack(Item.getItemFromBlock(Blocks.netherrack), EnumChatFormatting.GRAY + "Netherrack")); - put("SAND", Utils.createItemStack(Item.getItemFromBlock(Blocks.sand), EnumChatFormatting.GRAY + "Sand")); - put("ENDER_STONE", Utils.createItemStack(Item.getItemFromBlock(Blocks.end_stone), EnumChatFormatting.GRAY + "End Stone")); - put("MITHRIL_ORE", Utils.createItemStack(Items.prismarine_crystals, EnumChatFormatting.GRAY + "Mithril")); - put("HARD_STONE", Utils.createItemStack(Item.getItemFromBlock(Blocks.stone), EnumChatFormatting.GRAY + "Hard Stone")); - put( - "GEMSTONE_COLLECTION", - Utils.createSkull( - EnumChatFormatting.GRAY + "Gemstone", - "e942eb66-a350-38e5-aafa-0dfc3e17b4ac", - "ewogICJ0aW1lc3RhbXAiIDogMTYxODA4Mzg4ODc3MSwKICAicHJvZmlsZUlkIiA6ICJjNTBhZmE4YWJlYjk0ZTQ1OTRiZjFiNDI1YTk4MGYwMiIsCiAgInByb2ZpbGVOYW1lIiA6ICJUd29FQmFlIiwKICAic2lnbmF0dXJlUmVxdWlyZWQiIDogdHJ1ZSwKICAidGV4dHVyZXMiIDogewogICAgIlNLSU4iIDogewogICAgICAidXJsIiA6ICJodHRwOi8vdGV4dHVyZXMubWluZWNyYWZ0Lm5ldC90ZXh0dXJlL2FhYzE1ZjZmY2YyY2U5NjNlZjRjYTcxZjFhODY4NWFkYjk3ZWI3NjllMWQxMTE5NGNiYmQyZTk2NGE4ODk3OGMiCiAgICB9CiAgfQp9" - ) - ); - put("MYCEL", Utils.createItemStack(Item.getItemFromBlock(Blocks.mycelium), EnumChatFormatting.GRAY + "Mycelium")); - put("SAND:1", Utils.createItemStack(Item.getItemFromBlock(Blocks.sand), EnumChatFormatting.GRAY + "Red Sand", 1)); - put("SULPHUR_ORE", Utils.createItemStack(Items.glowstone_dust, EnumChatFormatting.GRAY + "Sulphur")); - - /* COMBAT COLLECTIONS */ - put("ROTTEN_FLESH", Utils.createItemStack(Items.rotten_flesh, EnumChatFormatting.RED + "Rotten Flesh")); - put("BONE", Utils.createItemStack(Items.bone, EnumChatFormatting.RED + "Bone")); - put("STRING", Utils.createItemStack(Items.string, EnumChatFormatting.RED + "String")); - put("SPIDER_EYE", Utils.createItemStack(Items.spider_eye, EnumChatFormatting.RED + "Spider Eye")); - put("SULPHUR", Utils.createItemStack(Items.gunpowder, EnumChatFormatting.RED + "Gunpowder")); - put("ENDER_PEARL", Utils.createItemStack(Items.ender_pearl, EnumChatFormatting.RED + "Ender Pearl")); - put("GHAST_TEAR", Utils.createItemStack(Items.ghast_tear, EnumChatFormatting.RED + "Ghast Tear")); - put("SLIME_BALL", Utils.createItemStack(Items.slime_ball, EnumChatFormatting.RED + "Slimeball")); - put("BLAZE_ROD", Utils.createItemStack(Items.blaze_rod, EnumChatFormatting.RED + "Blaze Rod")); - put("MAGMA_CREAM", Utils.createItemStack(Items.magma_cream, EnumChatFormatting.RED + "Magma Cream")); - put( - "CHILI_PEPPER", - Utils.createSkull( - EnumChatFormatting.RED + "Chili Pepper", - "3d47abaa-b40b-3826-b20c-d83a7f053bd9", - "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjg1OWM4ZGYxMTA5YzA4YTc1NjI3NWYxZDI4ODdjMjc0ODA0OWZlMzM4Nzc3NjlhN2I0MTVkNTZlZGE0NjlkOCJ9fX0" - ) - ); - - /* FORAGING COLLECTIONS */ - put("LOG", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Oak Wood")); - put("LOG:1", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Spruce Wood", 1)); - put("LOG:2", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Birch Wood", 2)); - put("LOG_2:1", Utils.createItemStack(Item.getItemFromBlock(Blocks.log2), EnumChatFormatting.DARK_GREEN + "Dark Oak Wood", 1)); - put("LOG_2", Utils.createItemStack(Item.getItemFromBlock(Blocks.log2), EnumChatFormatting.DARK_GREEN + "Acacia Wood")); - put("LOG:3", Utils.createItemStack(Item.getItemFromBlock(Blocks.log), EnumChatFormatting.DARK_GREEN + "Jungle Wood", 3)); - - /* FISHING COLLECTIONS */ - put("RAW_FISH", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Raw Fish")); - put("RAW_FISH:1", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Raw Salmon", 1)); - put("RAW_FISH:2", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Clownfish", 2)); - put("RAW_FISH:3", Utils.createItemStack(Items.fish, EnumChatFormatting.AQUA + "Pufferfish", 3)); - put("PRISMARINE_SHARD", Utils.createItemStack(Items.prismarine_shard, EnumChatFormatting.AQUA + "Prismarine Shard")); - put("PRISMARINE_CRYSTALS", Utils.createItemStack(Items.prismarine_crystals, EnumChatFormatting.AQUA + "Prismarine Crystals")); - put("CLAY_BALL", Utils.createItemStack(Items.clay_ball, EnumChatFormatting.AQUA + "Clay")); - put("WATER_LILY", Utils.createItemStack(Item.getItemFromBlock(Blocks.waterlily), EnumChatFormatting.AQUA + "Lily Pad")); - put("INK_SACK", Utils.createItemStack(Items.dye, EnumChatFormatting.AQUA + "Ink Sac")); - put("SPONGE", Utils.createItemStack(Item.getItemFromBlock(Blocks.sponge), EnumChatFormatting.AQUA + "Sponge")); - put( - "MAGMA_FISH", - Utils.createSkull( - EnumChatFormatting.AQUA + "Magmafish", - "5c53195c-5b98-3476-9731-c32647b22723", - "ewogICJ0aW1lc3RhbXAiIDogMTY0MjQ4ODA3MDY2NiwKICAicHJvZmlsZUlkIiA6ICIzNDkxZjJiOTdjMDE0MWE2OTM2YjFjMjJhMmEwMGZiNyIsCiAgInByb2ZpbGVOYW1lIiA6ICJKZXNzc3N1aGgiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjU2YjU5NTViMjk1NTIyYzk2ODk0ODE5NjBjMDFhOTkyY2ExYzc3NTRjZjRlZTMxM2M4ZGQwYzM1NmQzMzVmIgogICAgfQogIH0KfQ" - ) - ); - } - }; + Utils.createItemStack(Item.getItemFromBlock(Blocks.waterlily), EnumChatFormatting.AQUA + "Lily Pad") + ); + put("INK_SACK", Utils.createItemStack(Items.dye, EnumChatFormatting.AQUA + "Ink Sac")); + put("SPONGE", Utils.createItemStack(Item.getItemFromBlock(Blocks.sponge), EnumChatFormatting.AQUA + "Sponge")); + put( + "MAGMA_FISH", + Utils.createSkull( + EnumChatFormatting.AQUA + "Magmafish", + "5c53195c-5b98-3476-9731-c32647b22723", + "ewogICJ0aW1lc3RhbXAiIDogMTY0MjQ4ODA3MDY2NiwKICAicHJvZmlsZUlkIiA6ICIzNDkxZjJiOTdjMDE0MWE2OTM2YjFjMjJhMmEwMGZiNyIsCiAgInByb2ZpbGVOYW1lIiA6ICJKZXNzc3N1aGgiLAogICJzaWduYXR1cmVSZXF1aXJlZCIgOiB0cnVlLAogICJ0ZXh0dXJlcyIgOiB7CiAgICAiU0tJTiIgOiB7CiAgICAgICJ1cmwiIDogImh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZjU2YjU5NTViMjk1NTIyYzk2ODk0ODE5NjBjMDFhOTkyY2ExYzc3NTRjZjRlZTMxM2M4ZGQwYzM1NmQzMzVmIgogICAgfQogIH0KfQ" + ) + ); + } + }; private static final AtomicBoolean updatingResourceCollection = new AtomicBoolean(false); private static JsonObject resourceCollection = null; private final NEUManager manager; @@ -437,49 +511,42 @@ public class ProfileViewer { updatingResourceCollection.set(true); - HashMap args = new HashMap<>(); - NotEnoughUpdates.INSTANCE.manager.hypixelApi.getHypixelApiAsync( - NotEnoughUpdates.INSTANCE.config.apiData.apiKey, - "resources/skyblock/collections", - args, - jsonObject -> { + NotEnoughUpdates.INSTANCE.manager.apiUtils + .newHypixelApiRequest("resources/skyblock/collections") + .requestJson() + .thenAccept(jsonObject -> { updatingResourceCollection.set(false); if (jsonObject != null && jsonObject.has("success") && jsonObject.get("success").getAsBoolean()) { resourceCollection = jsonObject.get("collections").getAsJsonObject(); } - }, - () -> updatingResourceCollection.set(false) - ); - + }); return null; } public void getHypixelProfile(String name, Consumer callback) { String nameF = name.toLowerCase(); - HashMap args = new HashMap<>(); - args.put("name", "" + nameF); - manager.hypixelApi.getHypixelApiAsync( - NotEnoughUpdates.INSTANCE.config.apiData.apiKey, - "player", - args, - jsonObject -> { - if ( - jsonObject != null && - jsonObject.has("success") && - jsonObject.get("success").getAsBoolean() && - jsonObject.get("player").isJsonObject() - ) { - nameToUuid.put(nameF, jsonObject.get("player").getAsJsonObject().get("uuid").getAsString()); - uuidToHypixelProfile.put( - jsonObject.get("player").getAsJsonObject().get("uuid").getAsString(), - jsonObject.get("player").getAsJsonObject() - ); - if (callback != null) callback.accept(jsonObject); - } else { - if (callback != null) callback.accept(null); + manager.apiUtils + .newHypixelApiRequest("player") + .queryArgument("name", nameF) + .requestJson() + .thenAccept(jsonObject -> { + if ( + jsonObject != null && + jsonObject.has("success") && + jsonObject.get("success").getAsBoolean() && + jsonObject.get("player").isJsonObject() + ) { + nameToUuid.put(nameF, jsonObject.get("player").getAsJsonObject().get("uuid").getAsString()); + uuidToHypixelProfile.put( + jsonObject.get("player").getAsJsonObject().get("uuid").getAsString(), + jsonObject.get("player").getAsJsonObject() + ); + if (callback != null) callback.accept(jsonObject); + } else { + if (callback != null) callback.accept(null); + } } - } - ); + ); } public void putNameUuid(String name, String uuid) { @@ -493,19 +560,20 @@ public class ProfileViewer { return; } - manager.hypixelApi.getApiAsync( - "https://api.mojang.com/users/profiles/minecraft/" + nameF, - jsonObject -> { - if (jsonObject.has("id") && jsonObject.get("id").isJsonPrimitive() && ((JsonPrimitive) jsonObject.get("id")).isString()) { + manager.apiUtils + .request() + .url("https://api.mojang.com/users/profiles/minecraft/" + nameF) + .requestJson() + .thenAccept(jsonObject -> { + if (jsonObject.has("id") && jsonObject.get("id").isJsonPrimitive() && + ((JsonPrimitive) jsonObject.get("id")).isString()) { String uuid = jsonObject.get("id").getAsString(); nameToUuid.put(nameF, uuid); uuidCallback.accept(uuid); return; } uuidCallback.accept(null); - }, - () -> uuidCallback.accept(null) - ); + }); } public void getProfileByName(String name, Consumer callback) { @@ -608,20 +676,18 @@ public class ProfileViewer { HashMap args = new HashMap<>(); args.put("uuid", "" + uuid); - manager.hypixelApi.getHypixelApiAsync( - NotEnoughUpdates.INSTANCE.config.apiData.apiKey, - "status", - args, - jsonObject -> { + manager.apiUtils + .newHypixelApiRequest("status") + .queryArgument("uuid", "" + uuid) + .requestJson() + .handle((jsonObject, ex) -> { updatingPlayerStatusState.set(false); if (jsonObject != null && jsonObject.has("success") && jsonObject.get("success").getAsBoolean()) { playerStatus = jsonObject.get("session").getAsJsonObject(); } - }, - () -> updatingPlayerStatusState.set(false) - ); - + return null; + }); return null; } @@ -634,13 +700,11 @@ public class ProfileViewer { lastBingoInfoState = currentTime; updatingBingoInfo.set(true); - HashMap args = new HashMap<>(); - args.put("uuid", "" + uuid); - NotEnoughUpdates.INSTANCE.manager.hypixelApi.getHypixelApiAsync( - NotEnoughUpdates.INSTANCE.config.apiData.apiKey, - "skyblock/bingo", - args, - jsonObject -> { + NotEnoughUpdates.INSTANCE.manager.apiUtils + .newHypixelApiRequest("skyblock/bingo") + .queryArgument("uuid", "" + uuid) + .requestJson() + .handle(((jsonObject, throwable) -> { updatingBingoInfo.set(false); if (jsonObject != null && jsonObject.has("success") && jsonObject.get("success").getAsBoolean()) { @@ -648,9 +712,8 @@ public class ProfileViewer { } else { bingoInformation = null; } - }, - () -> updatingBingoInfo.set(false) - ); + return null; + })); return bingoInformation != null ? bingoInformation : null; } @@ -726,7 +789,8 @@ public class ProfileViewer { } } } - } catch (IOException ignored) {} + } catch (IOException ignored) { + } int count = 1; if (element.getAsJsonObject().has("count")) { @@ -791,17 +855,15 @@ public class ProfileViewer { lastPlayerInfoState = currentTime; updatingSkyblockProfilesState.set(true); - HashMap args = new HashMap<>(); - args.put("uuid", "" + uuid); - manager.hypixelApi.getHypixelApiAsync( - NotEnoughUpdates.INSTANCE.config.apiData.apiKey, - "skyblock/profiles", - args, - jsonObject -> { + manager.apiUtils + .newHypixelApiRequest("skyblock/profiles") + .queryArgument("uuid", "" + uuid) + .requestJson() + .handle((jsonObject, throwable) -> { updatingSkyblockProfilesState.set(false); if (jsonObject != null && jsonObject.has("success") && jsonObject.get("success").getAsBoolean()) { - if (!jsonObject.has("profiles")) return; + if (!jsonObject.has("profiles")) return null; skyblockProfiles = jsonObject.get("profiles").getAsJsonArray(); String lastCuteName = null; @@ -825,8 +887,12 @@ public class ProfileViewer { } String cuteName = profile.get("cute_name").getAsString(); - if (lastCuteName == null) lastCuteName = cuteName; profileNames.add(cuteName); + if (profile.has("selected") && profile.get("selected").getAsBoolean()) { + lastCuteName = cuteName; + break; + } + if (lastCuteName == null) lastCuteName = cuteName; if (member.has("last_save")) { long lastSave = member.get("last_save").getAsLong(); if (lastSave > lastLastSave) { @@ -840,10 +906,8 @@ public class ProfileViewer { if (runnable != null) runnable.run(); } - }, - () -> updatingSkyblockProfilesState.set(false) - ); - + return null; + }); return null; } @@ -856,26 +920,22 @@ public class ProfileViewer { lastGuildInfoState = currentTime; updatingGuildInfoState.set(true); - HashMap args = new HashMap<>(); - args.put("player", "" + uuid); - manager.hypixelApi.getHypixelApiAsync( - NotEnoughUpdates.INSTANCE.config.apiData.apiKey, - "guild", - args, - jsonObject -> { + manager.apiUtils + .newHypixelApiRequest("guild") + .queryArgument("player", "" + uuid) + .requestJson() + .handle((jsonObject, ex) -> { updatingGuildInfoState.set(false); if (jsonObject != null && jsonObject.has("success") && jsonObject.get("success").getAsBoolean()) { - if (!jsonObject.has("guild")) return; + if (!jsonObject.has("guild")) return null; guildInformation = jsonObject.get("guild").getAsJsonObject(); if (runnable != null) runnable.run(); } - }, - () -> updatingGuildInfoState.set(false) - ); - + return null; + }); return null; } @@ -1013,11 +1073,11 @@ public class ProfileViewer { int maxLevel = getCap(leveling, skillName) + - ( - skillName.equals("farming") - ? Utils.getElementAsInt(Utils.getElement(profileInfo, "jacob2.perks.farming_level_cap"), 0) - : 0 - ); + ( + skillName.equals("farming") + ? Utils.getElementAsInt(Utils.getElement(profileInfo, "jacob2.perks.farming_level_cap"), 0) + : 0 + ); out.put(skillName, getLevel(levelingArray, skillExperience, maxLevel, false)); } @@ -1065,7 +1125,10 @@ public class ProfileViewer { List slayers = Arrays.asList("zombie", "spider", "wolf", "enderman", "blaze"); for (String slayerName : slayers) { - float slayerExperience = Utils.getElementAsFloat(Utils.getElement(profileInfo, "slayer_bosses." + slayerName + ".xp"), 0); + float slayerExperience = Utils.getElementAsFloat(Utils.getElement( + profileInfo, + "slayer_bosses." + slayerName + ".xp" + ), 0); out.put( slayerName, getLevel(Utils.getElement(leveling, "slayer_xp." + slayerName).getAsJsonArray(), slayerExperience, 9, true) @@ -1135,7 +1198,7 @@ public class ProfileViewer { JsonObject inventoryInfo = new JsonObject(); - String[] inv_names = new String[] { + String[] inv_names = new String[]{ "inv_armor", "fishing_bag", "quiver", @@ -1149,7 +1212,7 @@ public class ProfileViewer { "candy_inventory_contents", "equippment_contents", }; - String[] inv_bytes = new String[] { + String[] inv_bytes = new String[]{ inv_armor_bytes, fishing_bag_bytes, quiver_bytes, @@ -1244,7 +1307,8 @@ public class ProfileViewer { JsonObject item = manager.getJsonFromNBTEntry(items.getCompoundTagAt(j)); contents.add(item); } - } catch (IOException ignored) {} + } catch (IOException ignored) { + } } JsonObject bundledReturn = new JsonObject(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java new file mode 100644 index 00000000..8c594911 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java @@ -0,0 +1,203 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.util; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import org.apache.commons.io.IOUtils; +import org.apache.http.NameValuePair; +import org.apache.http.client.utils.URIBuilder; +import org.apache.http.message.BasicNameValuePair; + +import javax.net.ssl.HttpsURLConnection; +import javax.net.ssl.KeyManagerFactory; +import javax.net.ssl.SSLContext; +import javax.net.ssl.TrustManagerFactory; +import java.io.IOException; +import java.io.InputStream; +import java.net.HttpURLConnection; +import java.net.MalformedURLException; +import java.net.URISyntaxException; +import java.net.URL; +import java.net.URLConnection; +import java.nio.charset.StandardCharsets; +import java.security.KeyManagementException; +import java.security.KeyStore; +import java.security.KeyStoreException; +import java.security.NoSuchAlgorithmException; +import java.security.UnrecoverableKeyException; +import java.security.cert.CertificateException; +import java.util.ArrayList; +import java.util.Collection; +import java.util.List; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.zip.GZIPInputStream; + +public class ApiUtil { + private static final Gson gson = new Gson(); + private static final ExecutorService executorService = Executors.newFixedThreadPool(3); + private static final String USER_AGENT = "NotEnoughUpdates/" + NotEnoughUpdates.VERSION; + private static SSLContext ctx; + + static { + try { + KeyStore letsEncryptStore = KeyStore.getInstance("JKS"); + letsEncryptStore.load(ApiUtil.class.getResourceAsStream("/neukeystore.jks"), "neuneu".toCharArray()); + ctx = SSLContext.getInstance("TLS"); + KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); + TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); + kmf.init(letsEncryptStore, null); + tmf.init(letsEncryptStore); + ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); + } catch (KeyStoreException | NoSuchAlgorithmException | KeyManagementException | UnrecoverableKeyException | + IOException | CertificateException e) { + System.out.println("Failed to load NEU keystore. A lot of API requests won't work"); + e.printStackTrace(); + } + } + + public static class Request { + + private final List queryArguments = new ArrayList<>(); + private String baseUrl = null; + private boolean shouldGunzip = false; + private String method = "GET"; + + public Request method(String method) { + this.method = method; + return this; + } + + public Request url(String baseUrl) { + this.baseUrl = baseUrl; + return this; + } + + public Request queryArgument(String key, String value) { + queryArguments.add(new BasicNameValuePair(key, value)); + return this; + } + + public Request queryArguments(Collection queryArguments) { + this.queryArguments.addAll(queryArguments); + return this; + } + + public Request gunzip() { + shouldGunzip = true; + return this; + } + + private CompletableFuture buildUrl() { + CompletableFuture fut = new CompletableFuture<>(); + try { + fut.complete(new URIBuilder(baseUrl) + .addParameters(queryArguments) + .build() + .toURL()); + } catch (URISyntaxException | + MalformedURLException | + NullPointerException e) { // Using CompletableFuture as an exception monad, isn't that exiting? + fut.completeExceptionally(e); + } + return fut; + } + + public CompletableFuture requestString() { + return buildUrl().thenApplyAsync(url -> { + try { + InputStream inputStream = null; + URLConnection conn = null; + try { + conn = url.openConnection(); + if (conn instanceof HttpsURLConnection && ctx != null) { + HttpsURLConnection sslConn = (HttpsURLConnection) conn; + sslConn.setSSLSocketFactory(ctx.getSocketFactory()); + } + if (conn instanceof HttpURLConnection) { + ((HttpURLConnection) conn).setRequestMethod(method); + } + conn.setConnectTimeout(10000); + conn.setReadTimeout(10000); + conn.setRequestProperty("User-Agent", USER_AGENT); + + inputStream = conn.getInputStream(); + + if (shouldGunzip) { + inputStream = new GZIPInputStream(inputStream); + } + + // While the assumption of UTF8 isn't always true; it *should* always be true. + // Not in the sense that this will hold in most cases (although that as well), + // but in the sense that any violation of this better have a good reason. + return IOUtils.toString(inputStream, StandardCharsets.UTF_8); + } finally { + try { + if (inputStream != null) { + inputStream.close(); + } + } finally { + if (conn instanceof HttpURLConnection) { + ((HttpURLConnection) conn).disconnect(); + } + } + } + } catch (IOException e) { + throw new RuntimeException(e); // We can rethrow, since supplyAsync catches exceptions. + } + }, executorService); + } + + public CompletableFuture requestJson() { + return requestJson(JsonObject.class); + } + + public CompletableFuture requestJson(Class clazz) { + return requestString().thenApply(str -> gson.fromJson(str, clazz)); + } + + } + + public Request request() { + return new Request(); + } + + public Request newHypixelApiRequest(String apiPath) { + return newAnonymousHypixelApiRequest(apiPath) + .queryArgument("key", NotEnoughUpdates.INSTANCE.config.apiData.apiKey); + } + + public Request newAnonymousHypixelApiRequest(String apiPath) { + return new Request() + .url("https://api.hypixel.net/" + apiPath); + } + + public Request newMoulberryRequest(String path) { + return new Request() + .url(getMyApiURL() + path); + } + + private String getMyApiURL() { + return String.format("https://%s/", NotEnoughUpdates.INSTANCE.config.apiData.moulberryCodesApi); + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/HotmInformation.java b/src/main/java/io/github/moulberry/notenoughupdates/util/HotmInformation.java index c97a37d9..1968b51e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/HotmInformation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/HotmInformation.java @@ -159,13 +159,11 @@ public class HotmInformation { public synchronized void requestUpdate(boolean force) { if (updateTask.isDone() || force) { - updateTask = neu.manager.hypixelApi.getHypixelApiAsync( - neu.config.apiData.apiKey, - "skyblock/profiles", - new HashMap() {{ - put("uuid", Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", "")); - }} - ).thenAccept(this::updateInformation); + updateTask = neu.manager.apiUtils + .newHypixelApiRequest("skyblock/profiles") + .queryArgument("uuid", Minecraft.getMinecraft().thePlayer.getUniqueID().toString().replace("-", "")) + .requestJson() + .thenAccept(this::updateInformation); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/HypixelApi.java b/src/main/java/io/github/moulberry/notenoughupdates/util/HypixelApi.java deleted file mode 100644 index 3e38fd2e..00000000 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/HypixelApi.java +++ /dev/null @@ -1,174 +0,0 @@ -/* - * Copyright (C) 2022 NotEnoughUpdates contributors - * - * This file is part of NotEnoughUpdates. - * - * NotEnoughUpdates is free software: you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - * - * NotEnoughUpdates is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with NotEnoughUpdates. If not, see . - */ - -package io.github.moulberry.notenoughupdates.util; - -import com.google.gson.Gson; -import com.google.gson.JsonObject; -import io.github.moulberry.notenoughupdates.NotEnoughUpdates; -import org.apache.commons.io.IOUtils; - -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.net.ConnectException; -import java.net.URL; -import java.net.URLConnection; -import java.net.URLEncoder; -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutorService; -import java.util.concurrent.Executors; -import java.util.function.Consumer; -import java.util.zip.GZIPInputStream; - -public class HypixelApi { - private final Gson gson = new Gson(); - private final ExecutorService es = Executors.newFixedThreadPool(3); - - public CompletableFuture getHypixelApiAsync(String apiKey, String method, HashMap args) { - return getApiAsync(generateApiUrl(apiKey, method, args)); - } - - public void getHypixelApiAsync( - String apiKey, - String method, - HashMap args, - Consumer consumer - ) { - getHypixelApiAsync(apiKey, method, args, consumer, () -> { - }); - } - - public void getHypixelApiAsync( - String apiKey, - String method, - HashMap args, - Consumer consumer, - Runnable error - ) { - getApiAsync(generateApiUrl(apiKey, method, args), consumer, error); - } - - private String getMyApiURL() { - return String.format("https://%s/", NotEnoughUpdates.INSTANCE.config.apiData.moulberryCodesApi); - } - - public CompletableFuture getApiAsync(String urlS) { - CompletableFuture result = new CompletableFuture<>(); - es.submit(() -> { - try { - result.complete(getApiSync(urlS)); - } catch (Exception e) { - result.completeExceptionally(e); - } - }); - return result; - } - - public void getApiAsync(String urlS, Consumer consumer, Runnable error) { - es.submit(() -> { - try { - consumer.accept(getApiSync(urlS)); - } catch (Exception e) { - error.run(); - } - }); - } - - public void getMyApiAsync(String urlS, Consumer consumer, Runnable error) { - es.submit(() -> { - try { - consumer.accept(getApiSync(getMyApiURL() + urlS)); - } catch (Exception e) { - if (NotEnoughUpdates.INSTANCE.config.hidden.dev) { - e.printStackTrace(); - } - error.run(); - } - }); - } - - public void getMyApiGZIPAsync(String urlS, Consumer consumer, Runnable error) { - es.submit(() -> { - try { - consumer.accept(getApiGZIPSync(getMyApiURL() + urlS)); - } catch (Exception e) { - error.run(); - } - }); - } - - public void getApiGZIPAsync(String urlS, Consumer consumer, Runnable error) { - es.submit(() -> { - try { - consumer.accept(getApiGZIPSync(urlS)); - } catch (Exception e) { - error.run(); - } - }); - } - - public JsonObject getApiSync(String urlS) throws IOException { - URL url = new URL(urlS); - URLConnection connection = url.openConnection(); - connection.setConnectTimeout(10000); - connection.setReadTimeout(10000); - - String response = IOUtils.toString(connection.getInputStream(), StandardCharsets.UTF_8); - - JsonObject json = gson.fromJson(response, JsonObject.class); - if (json == null) throw new ConnectException("Invalid JSON"); - return json; - } - - public JsonObject getApiGZIPSync(String urlS) throws IOException { - URL url = new URL(urlS); - URLConnection connection = url.openConnection(); - connection.setConnectTimeout(10000); - connection.setReadTimeout(10000); - - String response = IOUtils.toString(new GZIPInputStream(connection.getInputStream()), StandardCharsets.UTF_8); - - JsonObject json = gson.fromJson(response, JsonObject.class); - return json; - } - - public String generateApiUrl(String apiKey, String method, HashMap args) { - if (apiKey != null) - args.put("key", apiKey.trim()); - StringBuilder url = new StringBuilder("https://api.hypixel.net/" + method); - boolean first = true; - for (Map.Entry entry : args.entrySet()) { - if (first) { - url.append("?"); - first = false; - } else { - url.append("&"); - } - try { - url.append(URLEncoder.encode(entry.getKey(), StandardCharsets.UTF_8.name())).append("=") - .append(URLEncoder.encode(entry.getValue(), StandardCharsets.UTF_8.name())); - } catch (UnsupportedEncodingException e) { - } - } - return url.toString(); - } -} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/PronounDB.java b/src/main/java/io/github/moulberry/notenoughupdates/util/PronounDB.java index e7286721..625f92f7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/PronounDB.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/PronounDB.java @@ -21,50 +21,17 @@ package io.github.moulberry.notenoughupdates.util; import com.google.gson.JsonElement; import com.google.gson.JsonObject; -import com.google.gson.JsonParseException; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; -import io.github.moulberry.notenoughupdates.core.util.StringUtils; - -import javax.net.ssl.HttpsURLConnection; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; -import javax.net.ssl.TrustManagerFactory; -import java.io.IOException; -import java.io.InputStreamReader; -import java.net.URL; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableKeyException; -import java.security.cert.CertificateException; + import java.util.Arrays; import java.util.List; import java.util.Optional; import java.util.UUID; +import java.util.concurrent.CompletableFuture; import java.util.stream.Collectors; public class PronounDB { - static SSLContext ctx; - - static { - try { - KeyStore ks = KeyStore.getInstance("JKS"); - ks.load(PronounDB.class.getResourceAsStream("/pronoundb.jks"), "pronoundb".toCharArray()); - ctx = SSLContext.getInstance("TLS"); - KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); - TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); - kmf.init(ks, null); - tmf.init(ks); - ctx.init(kmf.getKeyManagers(), tmf.getTrustManagers(), null); - } catch (KeyStoreException | NoSuchAlgorithmException | KeyManagementException | UnrecoverableKeyException | - IOException | CertificateException e) { - System.out.println("Failed to load keystore. PronounDB requests will probably not work"); - e.printStackTrace(); - } - } - private static boolean isDisabled() { JsonObject disabled = Constants.DISABLE; return disabled != null && disabled.has("pronoundb"); @@ -73,22 +40,15 @@ public class PronounDB { /** * Returns an Optional, since JVMs can be *very* funky with KeyStore loading */ - public static Optional performPronouning(String platform, String id) { - if (isDisabled()) return Optional.empty(); - try { - URL url = new URL("https://pronoundb.org/api/v1/lookup" + - "?platform=" + StringUtils.urlEncode(platform) + - "&id=" + StringUtils.urlEncode(id)); - HttpsURLConnection urlConnection = (HttpsURLConnection) url.openConnection(); - urlConnection.setSSLSocketFactory(ctx.getSocketFactory()); - return Optional.of(NotEnoughUpdates.INSTANCE.manager.gson.fromJson( - new InputStreamReader(urlConnection.getInputStream()), - JsonObject.class - )); - } catch (ClassCastException | IOException | JsonParseException e) { - System.out.println("Failed to contact PronounDB: " + e); - return Optional.empty(); - } + public static CompletableFuture> performPronouning(String platform, String id) { + if (isDisabled()) return CompletableFuture.completedFuture(Optional.empty()); + return NotEnoughUpdates.INSTANCE.manager.apiUtils + .request() + .url("https://pronoundb.org/api/v1/lookup") + .queryArgument("platform", platform) + .queryArgument("id", id) + .requestJson() + .handle((result, ex) -> Optional.ofNullable(result)); } public enum Pronoun { @@ -199,23 +159,20 @@ public class PronounDB { return Optional.empty(); } - public static Optional getPronounsFor(String platform, String name) { - return performPronouning(platform, name).flatMap(PronounDB::parsePronouns); + public static CompletableFuture> getPronounsFor(String platform, String name) { + return performPronouning(platform, name).thenApply(it -> it.flatMap(PronounDB::parsePronouns)); } - public static Optional getPronounsFor(UUID minecraftPlayer) { - return performPronouning("minecraft", minecraftPlayer.toString() /* dashed UUID */) - .flatMap(PronounDB::parsePronouns); + public static CompletableFuture> getPronounsFor(UUID minecraftPlayer) { + return getPronounsFor("minecraft", minecraftPlayer.toString() /* dashed UUID */); } public static void test() { - try { - System.out.println("Pronouning..."); - PronounChoice pronounsFor = getPronounsFor(UUID.fromString("842204e6-6880-487b-ae5a-0595394f9948")).get(); + System.out.println("Pronouning..."); + getPronounsFor(UUID.fromString("842204e6-6880-487b-ae5a-0595394f9948")).thenAccept(it -> { + PronounChoice pronounsFor = it.get(); pronounsFor.render().forEach(System.out::println); - } catch (Exception e) { - e.printStackTrace(); - } + }); } } 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 4e920aea..f3a09fcc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -61,8 +61,6 @@ import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.Objects; -import java.util.concurrent.CompletableFuture; -import java.util.concurrent.ExecutionException; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -431,11 +429,10 @@ public class SBInfo { } public void updateMayor() { - NotEnoughUpdates.INSTANCE.manager.hypixelApi.getHypixelApiAsync( - NotEnoughUpdates.INSTANCE.config.apiData.apiKey, - "resources/skyblock/election", - new HashMap<>() - ).thenAcceptAsync(newJson -> mayorJson = newJson); + NotEnoughUpdates.INSTANCE.manager.apiUtils + .newHypixelApiRequest("resources/skyblock/election") + .requestJson() + .thenAccept(newJson -> mayorJson = newJson); } diff --git a/src/main/resources/neukeystore.jks b/src/main/resources/neukeystore.jks new file mode 100644 index 00000000..3a5a23b6 Binary files /dev/null and b/src/main/resources/neukeystore.jks differ diff --git a/src/main/resources/neukeystore.txt b/src/main/resources/neukeystore.txt new file mode 100644 index 00000000..5616f69b --- /dev/null +++ b/src/main/resources/neukeystore.txt @@ -0,0 +1,17 @@ +neukeystore.jks +=============== + +This file should only ever be handled by a `keytool` binary from jdk 1.8u51 or below, as to be compatible with old java versions. + +The password to the keystore is `neuneu` and it contains every certificate from jdk 1.8u51 and the Let's Encrypt root CAs. + +Example for adding a new certificate: + + ~/.jdks/jdk1.8.0_51/bin/keytool -keystore neukeystore.jks -storepass neuneu -alias ISRGROOTX1 -import -file isrgrootx1.der + +Please keep a list of added aliases below: + + - ISRGROOTX1 (Let's Encrypt) + - ISRGROOTX2 (Let's Encrypt) + + diff --git a/src/main/resources/pronoundb.jks b/src/main/resources/pronoundb.jks deleted file mode 100644 index 1c279333..00000000 Binary files a/src/main/resources/pronoundb.jks and /dev/null differ -- cgit From af846d805939692eab57282851da106c125877d3 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Fri, 30 Sep 2022 02:30:30 +0200 Subject: useless change (#321) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../miscfeatures/AuctionSortModeWarning.java | 82 ++++++++++------------ 1 file changed, 39 insertions(+), 43 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java index 8ac0151a..ed05ee79 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionSortModeWarning.java @@ -45,50 +45,46 @@ public class AuctionSortModeWarning { } public void onPostGuiRender() { - if (isAuctionBrowser()) { - GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; - - ItemStack stack = chest.inventorySlots.getSlot(50).getStack(); - - if (stack != null) { - List tooltip = stack.getTooltip(Minecraft.getMinecraft().thePlayer, false); - - String selectedSort = null; - for (String line : tooltip) { - if (line.startsWith("\u00a75\u00a7o\u00a7b\u25B6 ")) { - selectedSort = Utils.cleanColour(line.substring("\u00a75\u00a7o\u00a7b\u25B6 ".length())); - } - } - - if (selectedSort != null) { - if (!selectedSort.trim().equals("Lowest Price")) { - GlStateManager.disableLighting(); - GlStateManager.pushMatrix(); - GlStateManager.translate(0, 0, 500); - - String selectedColour = "\u00a7e"; - - if (selectedSort.trim().equals("Highest Price")) { - selectedColour = "\u00a7c"; - } - - String warningText = "\u00a7aSort: " + selectedColour + selectedSort; - int warningLength = Minecraft.getMinecraft().fontRendererObj.getStringWidth(warningText); - - int centerX = - ((AccessorGuiContainer) chest).getGuiLeft() + ((AccessorGuiContainer) chest).getXSize() / 2 + 9; - int centerY = ((AccessorGuiContainer) chest).getGuiTop() + 26; - - RenderUtils.drawFloatingRectDark(centerX - warningLength / 2 - 4, centerY - 6, - warningLength + 8, 12, false - ); - TextRenderUtils.drawStringCenteredScaledMaxWidth(warningText, Minecraft.getMinecraft().fontRendererObj, - centerX, centerY, true, chest.width / 2, 0xffffffff - ); - GlStateManager.popMatrix(); - } - } + if (!isAuctionBrowser()) return; + GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; + + ItemStack stack = chest.inventorySlots.getSlot(50).getStack(); + + if (stack == null) return; + List tooltip = stack.getTooltip(Minecraft.getMinecraft().thePlayer, false); + + String selectedSort = null; + for (String line : tooltip) { + if (line.startsWith("\u00a75\u00a7o\u00a7b\u25B6 ")) { + selectedSort = Utils.cleanColour(line.substring("\u00a75\u00a7o\u00a7b\u25B6 ".length())); } } + + if (selectedSort == null) return; + if (selectedSort.trim().equals("Lowest Price")) return; + GlStateManager.disableLighting(); + GlStateManager.pushMatrix(); + GlStateManager.translate(0, 0, 500); + + String selectedColour = "\u00a7e"; + + if (selectedSort.trim().equals("Highest Price")) { + selectedColour = "\u00a7c"; + } + + String warningText = "\u00a7aSort: " + selectedColour + selectedSort; + int warningLength = Minecraft.getMinecraft().fontRendererObj.getStringWidth(warningText); + + int centerX = + ((AccessorGuiContainer) chest).getGuiLeft() + ((AccessorGuiContainer) chest).getXSize() / 2 + 9; + int centerY = ((AccessorGuiContainer) chest).getGuiTop() + 26; + + RenderUtils.drawFloatingRectDark(centerX - warningLength / 2 - 4, centerY - 6, + warningLength + 8, 12, false + ); + TextRenderUtils.drawStringCenteredScaledMaxWidth(warningText, Minecraft.getMinecraft().fontRendererObj, + centerX, centerY, true, chest.width / 2, 0xffffffff + ); + GlStateManager.popMatrix(); } } -- cgit From 9dcfe56caf770998629998b5e5f6ac2fc7450601 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 4 Oct 2022 01:32:42 +1100 Subject: fix typo (#330) --- src/main/java/io/github/moulberry/notenoughupdates/util/PronounDB.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/PronounDB.java b/src/main/java/io/github/moulberry/notenoughupdates/util/PronounDB.java index 625f92f7..4c0b73eb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/PronounDB.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/PronounDB.java @@ -55,7 +55,7 @@ public class PronounDB { HE("he", "him", "his"), IT("it", "it", "its"), SHE("she", "her", "hers"), - THEY("they", "they", "theirs"); + THEY("they", "them", "theirs"); private final String subject; private final String object; -- cgit From 0c22b5eec932e2f916cbbcdbc4d5275b5eb3b6ba Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Tue, 4 Oct 2022 01:37:19 +1100 Subject: Fixed autopet with tier boosted pet (#328) --- .../notenoughupdates/miscfeatures/PetInfoOverlay.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) 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 499448fa..be66e9b3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java @@ -1075,9 +1075,13 @@ public class PetInfoOverlay extends TextOverlay { setCurrentPet(getClosestPetIndex(pet, rarity.petId, "", lastLevelHovered)); if (PetInfoOverlay.config.selectedPet == -1) { - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( - EnumChatFormatting.RED + "[NEU] Can't find pet \u00a7" + petStringMatch + - EnumChatFormatting.RED + " try revisiting all pages of /pets.")); + setCurrentPet(getClosestPetIndex(pet, rarity.petId - 1, "", lastLevelHovered)); + if (!"PET_ITEM_TIER_BOOST".equals(getCurrentPet().petItem)) { + PetInfoOverlay.config.selectedPet = -1; + 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")) || (chatMessage.toLowerCase().contains( "switching to profile")) -- cgit From 958525f42be1868c448246d4ffd15da77c0b0887 Mon Sep 17 00:00:00 2001 From: Ascynx <78341107+Ascynx@users.noreply.github.com> Date: Mon, 3 Oct 2022 17:13:57 +0200 Subject: Mythic tier skin. (#327) --- .../moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) 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 be66e9b3..a14c98e7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java @@ -790,11 +790,14 @@ public class PetInfoOverlay extends TextOverlay { if (!NotEnoughUpdates.INSTANCE.config.petOverlay.petOverlayIcon) return; int mythicRarity = currentPet.rarity.petId; - if (currentPet.rarity.petId == 5) { - mythicRarity = 4; - } JsonObject petItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get( currentPet.skin != null ? currentPet.skin : (currentPet.petType + ";" + mythicRarity)); + + if (petItem == null && currentPet.rarity.petId == 5) { + petItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get( + currentPet.skin != null ? currentPet.skin : (currentPet.petType + ";" + 4)); + } + if (petItem != null) { Vector2f position = getPosition(overlayWidth, overlayHeight); int x = (int) position.x; -- cgit From 7a31307956fa5ce3409de73764851ff22ee7ea19 Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Tue, 4 Oct 2022 04:42:07 +0200 Subject: Removed last_save (#331) --- .../notenoughupdates/profileviewer/ExtraPage.java | 18 +++--------------- 1 file changed, 3 insertions(+), 15 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java index 63a4df2c..3b30b9b7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java @@ -91,18 +91,6 @@ public class ExtraPage extends GuiProfileViewerPage { 76 ); - { - String lastSaveText = getTimeSinceString(profileInfo, "last_save"); - if (lastSaveText != null) { - Utils.renderAlignedString( - EnumChatFormatting.AQUA + "Last Seen", - EnumChatFormatting.WHITE + lastSaveText, - guiLeft + xStart, - guiTop + yStartTop + yOffset * 2, - 76 - ); - } - } { String first_join = getTimeSinceString(profileInfo, "first_join"); if (first_join != null) { @@ -110,7 +98,7 @@ public class ExtraPage extends GuiProfileViewerPage { EnumChatFormatting.AQUA + "Joined", EnumChatFormatting.WHITE + first_join, guiLeft + xStart, - guiTop + yStartTop + yOffset * 3, + guiTop + yStartTop + yOffset * 2, 76 ); } @@ -123,7 +111,7 @@ public class ExtraPage extends GuiProfileViewerPage { EnumChatFormatting.AQUA + "Guild", EnumChatFormatting.WHITE + guildInfo.get("name").getAsString(), guiLeft + xStart, - guiTop + yStartTop + yOffset * 4, + guiTop + yStartTop + yOffset * 3, 76 ); } @@ -133,7 +121,7 @@ public class ExtraPage extends GuiProfileViewerPage { EnumChatFormatting.GREEN + "Pronouns", EnumChatFormatting.WHITE + String.join(" / ", choice.render()), guiLeft + xStart, - guiTop + yStartTop + yOffset * (shouldRenderGuild ? 5 : 4), + guiTop + yStartTop + yOffset * (shouldRenderGuild ? 4 : 3), 76 )); } -- cgit From 431de03ea35cbbfbf81385ad320bfbd8f512feb9 Mon Sep 17 00:00:00 2001 From: "imgbot[bot]" <31301654+imgbot[bot]@users.noreply.github.com> Date: Tue, 4 Oct 2022 13:59:15 +1100 Subject: [ImgBot] Optimize images (#325) Co-authored-by: ImgBotApp --- .../notenoughupdates/accessory_bag_overlay.png | Bin 973 -> 587 bytes .../notenoughupdates/armordisplay/armordisplay.png | Bin 1599 -> 381 bytes .../armordisplay/armordisplay_transparent_pet.png | Bin 1500 -> 1171 bytes .../auc_search/ah_search_overlay.png | Bin 3513 -> 3168 bytes .../auc_search/ah_search_overlay_tab_completed.png | Bin 6969 -> 6547 bytes .../assets/notenoughupdates/auction_profit.png | Bin 595 -> 551 bytes .../assets/notenoughupdates/button_white.png | Bin 6570 -> 4882 bytes .../assets/notenoughupdates/capes/dg_preview.png | Bin 18852 -> 7788 bytes .../assets/notenoughupdates/capes/fade.png | Bin 18572 -> 10289 bytes .../assets/notenoughupdates/capes/fade_preview.png | Bin 10411 -> 10309 bytes .../assets/notenoughupdates/capes/furf.png | Bin 8509 -> 5776 bytes .../assets/notenoughupdates/capes/furf_preview.png | Bin 3506 -> 3286 bytes .../assets/notenoughupdates/capes/ironmoon.png | Bin 142131 -> 133758 bytes .../notenoughupdates/capes/ironmoon_preview.png | Bin 92492 -> 88214 bytes .../assets/notenoughupdates/capes/lava.png | Bin 169280 -> 167381 bytes .../notenoughupdates/capes/mbstaff_preview.png | Bin 39260 -> 38573 bytes .../assets/notenoughupdates/capes/mcworld.png | Bin 291014 -> 280386 bytes .../notenoughupdates/capes/packshq_preview.png | Bin 14680 -> 14346 bytes .../assets/notenoughupdates/capes/screensaver.png | Bin 31381 -> 31139 bytes .../notenoughupdates/capes/screensaver_preview.png | Bin 19453 -> 17150 bytes .../notenoughupdates/capes/secondpfirsisch.png | Bin 58167 -> 52827 bytes .../capes/secondpfirsisch_preview.png | Bin 38433 -> 36232 bytes .../assets/notenoughupdates/capes/sharex_white.png | Bin 27251 -> 15517 bytes .../capes/sharex_white_preview.png | Bin 21698 -> 15204 bytes .../assets/notenoughupdates/capes/skyclient.png | Bin 27981 -> 13024 bytes .../notenoughupdates/capes/skyclient_preview.png | Bin 10294 -> 5987 bytes .../assets/notenoughupdates/capes/space.png | Bin 922429 -> 856184 bytes .../assets/notenoughupdates/capes/stormy_lh.png | Bin 56764 -> 24286 bytes .../notenoughupdates/capes/stormy_lh_preview.png | Bin 12899 -> 11290 bytes .../notenoughupdates/capes/subreddit_dark.png | Bin 7297 -> 5275 bytes .../notenoughupdates/capes/subreddit_light.png | Bin 7508 -> 5353 bytes .../capes/subreddit_light_preview.png | Bin 2583 -> 2406 bytes .../assets/notenoughupdates/capes/thebakery.png | Bin 537705 -> 431168 bytes .../notenoughupdates/capes/thebakery_preview.png | Bin 71386 -> 50272 bytes .../assets/notenoughupdates/capes/void.png | Bin 41607 -> 20910 bytes .../assets/notenoughupdates/capes/void_preview.png | Bin 4712 -> 3235 bytes .../notenoughupdates/colour_selector_dot.png | Bin 3677 -> 2596 bytes .../notenoughupdates/core/colour_selector_dot.png | Bin 3677 -> 2596 bytes .../assets/notenoughupdates/custom_enchant_gui.png | Bin 4982 -> 3227 bytes .../dungeon_map/borders/large/10.png | Bin 7050 -> 6065 bytes .../dungeon_map/borders/large/11.png | Bin 16913 -> 12073 bytes .../dungeon_map/borders/large/2.png | Bin 1006 -> 943 bytes .../dungeon_map/borders/large/3.png | Bin 6971 -> 6232 bytes .../dungeon_map/borders/large/4.png | Bin 10886 -> 7775 bytes .../dungeon_map/borders/large/5.png | Bin 13433 -> 8195 bytes .../dungeon_map/borders/large/8.png | Bin 6904 -> 6080 bytes .../dungeon_map/borders/large/9.png | Bin 6779 -> 5405 bytes .../borders/map_border_dragon_stone.png | Bin 4952 -> 2351 bytes .../dungeon_map/borders/medium/10.png | Bin 6703 -> 6222 bytes .../dungeon_map/borders/medium/11.png | Bin 15370 -> 11183 bytes .../dungeon_map/borders/medium/3.png | Bin 6522 -> 6013 bytes .../dungeon_map/borders/medium/4.png | Bin 7093 -> 5987 bytes .../dungeon_map/borders/medium/5.png | Bin 7618 -> 5824 bytes .../dungeon_map/borders/medium/8.png | Bin 6277 -> 5779 bytes .../dungeon_map/borders/medium/9.png | Bin 6362 -> 5654 bytes .../dungeon_map/borders/small/10.png | Bin 7045 -> 6455 bytes .../dungeon_map/borders/small/11.png | Bin 12576 -> 9691 bytes .../dungeon_map/borders/small/3.png | Bin 6697 -> 6386 bytes .../dungeon_map/borders/small/4.png | Bin 5947 -> 5307 bytes .../dungeon_map/borders/small/5.png | Bin 8456 -> 7041 bytes .../dungeon_map/borders/small/8.png | Bin 6789 -> 6365 bytes .../dungeon_map/borders/small/9.png | Bin 5897 -> 5734 bytes .../dungeon_map/borders/steampunk.png | Bin 10039 -> 8341 bytes .../assets/notenoughupdates/dungeon_win/a.png | Bin 569 -> 517 bytes .../assets/notenoughupdates/dungeon_win/s.png | Bin 579 -> 502 bytes .../assets/notenoughupdates/dungeon_win/splus.png | Bin 2296 -> 1482 bytes .../dynamic_54/style4/dynamic_54_slot_ctm.png | Bin 539 -> 537 bytes .../dynamic_54/style5/dynamic_54_button_ctm.png | Bin 543 -> 533 bytes .../dynamic_54/style5/dynamic_54_slot_ctm.png | Bin 539 -> 537 bytes .../dynamic_54/style6/dynamic_54_button_ctm.png | Bin 539 -> 537 bytes .../dynamic_54/style6/dynamic_54_slot_ctm.png | Bin 539 -> 537 bytes .../dynamic_54/style7/dynamic_54_button_ctm.png | Bin 3437 -> 864 bytes .../dynamic_54/style7/dynamic_54_slot_ctm.png | Bin 539 -> 537 bytes .../notenoughupdates/dynamic_54/toggle_off.png | Bin 389 -> 379 bytes .../notenoughupdates/dynamic_54/toggle_on.png | Bin 406 -> 379 bytes .../notenoughupdates/fishing_warning_exclam.png | Bin 5807 -> 5749 bytes .../resources/assets/notenoughupdates/fuel_bar.png | Bin 2333 -> 2271 bytes .../resources/assets/notenoughupdates/help.png | Bin 3500 -> 3018 bytes .../invbuttons/extraicons/settings.png | Bin 3962 -> 2546 bytes .../resources/assets/notenoughupdates/logo.png | Bin 21782 -> 18710 bytes src/main/resources/assets/notenoughupdates/on.png | Bin 1311 -> 446 bytes .../panoramas/combat_1_day/panorama_0.jpg | Bin 21394 -> 20975 bytes .../panoramas/combat_1_day/panorama_1.jpg | Bin 20539 -> 20008 bytes .../panoramas/combat_1_day/panorama_2.jpg | Bin 18095 -> 18018 bytes .../panoramas/combat_1_day/panorama_3.jpg | Bin 21069 -> 20646 bytes .../panoramas/combat_1_day/panorama_4.jpg | Bin 17245 -> 16944 bytes .../panoramas/combat_1_night/panorama_5.jpg | Bin 16017 -> 15892 bytes .../panoramas/combat_3_day/panorama_0.jpg | Bin 34048 -> 32699 bytes .../panoramas/combat_3_day/panorama_1.jpg | Bin 28471 -> 27566 bytes .../panoramas/combat_3_day/panorama_2.jpg | Bin 22159 -> 21806 bytes .../panoramas/combat_3_day/panorama_3.jpg | Bin 27487 -> 26543 bytes .../panoramas/combat_3_day/panorama_4.jpg | Bin 19750 -> 19205 bytes .../panoramas/combat_3_day/panorama_5.jpg | Bin 21597 -> 21050 bytes .../panoramas/combat_3_night/panorama_0.jpg | Bin 18255 -> 18025 bytes .../panoramas/combat_3_night/panorama_3.jpg | Bin 18438 -> 18259 bytes .../panoramas/dark_auction/panorama_0.jpg | Bin 19008 -> 18990 bytes .../panoramas/dark_auction/panorama_1.jpg | Bin 19414 -> 19399 bytes .../panoramas/dark_auction/panorama_3.jpg | Bin 19497 -> 19482 bytes .../panoramas/dark_auction/panorama_4.jpg | Bin 18727 -> 18500 bytes .../panoramas/dark_auction/panorama_5.jpg | Bin 18871 -> 18621 bytes .../panoramas/dungeon/panorama_4.jpg | Bin 18780 -> 18727 bytes .../panoramas/dungeon/panorama_5.jpg | Bin 18041 -> 17991 bytes .../panoramas/dungeon_hub/panorama_4.jpg | Bin 18780 -> 18727 bytes .../panoramas/dungeon_hub/panorama_5.jpg | Bin 18041 -> 17991 bytes .../panoramas/dynamic_day/panorama_0.jpg | Bin 35131 -> 33582 bytes .../panoramas/dynamic_day/panorama_1.jpg | Bin 32356 -> 31126 bytes .../panoramas/dynamic_day/panorama_2.jpg | Bin 34147 -> 32793 bytes .../panoramas/dynamic_day/panorama_3.jpg | Bin 42291 -> 40205 bytes .../panoramas/dynamic_day/panorama_4.jpg | Bin 25831 -> 24929 bytes .../panoramas/dynamic_day/panorama_5.jpg | Bin 20933 -> 20373 bytes .../panoramas/dynamic_night/panorama_0.jpg | Bin 28070 -> 27052 bytes .../panoramas/dynamic_night/panorama_1.jpg | Bin 30401 -> 29354 bytes .../panoramas/dynamic_night/panorama_2.jpg | Bin 29899 -> 28849 bytes .../panoramas/dynamic_night/panorama_3.jpg | Bin 30543 -> 29568 bytes .../panoramas/dynamic_night/panorama_4.jpg | Bin 27401 -> 26255 bytes .../panoramas/dynamic_night/panorama_5.jpg | Bin 21828 -> 21223 bytes .../panoramas/farming_1_day/panorama_0.jpg | Bin 34294 -> 32829 bytes .../panoramas/farming_1_day/panorama_1.jpg | Bin 47518 -> 45004 bytes .../panoramas/farming_1_day/panorama_2.jpg | Bin 46569 -> 44117 bytes .../panoramas/farming_1_day/panorama_3.jpg | Bin 36648 -> 35025 bytes .../panoramas/farming_1_day/panorama_4.jpg | Bin 15788 -> 15667 bytes .../panoramas/farming_1_day/panorama_5.jpg | Bin 47536 -> 45072 bytes .../panoramas/farming_1_night/panorama_0.jpg | Bin 20273 -> 19870 bytes .../panoramas/farming_1_night/panorama_1.jpg | Bin 23666 -> 23078 bytes .../panoramas/farming_1_night/panorama_2.jpg | Bin 26548 -> 25794 bytes .../panoramas/farming_1_night/panorama_3.jpg | Bin 22310 -> 21899 bytes .../panoramas/farming_1_night/panorama_5.jpg | Bin 29882 -> 28777 bytes .../panoramas/farming_2_day/panorama_0.jpg | Bin 30779 -> 29641 bytes .../panoramas/farming_2_day/panorama_2.jpg | Bin 30070 -> 29040 bytes .../panoramas/farming_2_day/panorama_3.jpg | Bin 30822 -> 29641 bytes .../panoramas/farming_2_day/panorama_5.jpg | Bin 24780 -> 23466 bytes .../panoramas/farming_2_night/panorama_0.jpg | Bin 19525 -> 19360 bytes .../panoramas/farming_2_night/panorama_3.jpg | Bin 17533 -> 17432 bytes .../panoramas/farming_2_night/panorama_5.jpg | Bin 17504 -> 17040 bytes .../panoramas/foraging_1_day/panorama_0.jpg | Bin 42789 -> 40489 bytes .../panoramas/foraging_1_day/panorama_1.jpg | Bin 32963 -> 31789 bytes .../panoramas/foraging_1_day/panorama_2.jpg | Bin 36208 -> 34619 bytes .../panoramas/foraging_1_day/panorama_3.jpg | Bin 34657 -> 33244 bytes .../panoramas/foraging_1_day/panorama_4.jpg | Bin 25234 -> 24265 bytes .../panoramas/foraging_1_day/panorama_5.jpg | Bin 29243 -> 27950 bytes .../panoramas/foraging_1_night/panorama_0.jpg | Bin 16958 -> 16927 bytes .../panoramas/foraging_1_night/panorama_3.jpg | Bin 17531 -> 17518 bytes .../panoramas/foraging_1_night/panorama_5.jpg | Bin 17297 -> 16836 bytes .../panoramas/hub_day/panorama_0.jpg | Bin 20453 -> 20153 bytes .../panoramas/hub_day/panorama_1.jpg | Bin 20509 -> 20168 bytes .../panoramas/hub_day/panorama_2.jpg | Bin 23845 -> 23266 bytes .../panoramas/hub_day/panorama_3.jpg | Bin 24436 -> 23872 bytes .../panoramas/hub_day/panorama_5.jpg | Bin 16562 -> 16208 bytes .../panoramas/hub_night/panorama_0.jpg | Bin 17155 -> 16995 bytes .../panoramas/hub_night/panorama_1.jpg | Bin 17538 -> 17361 bytes .../panoramas/hub_night/panorama_2.jpg | Bin 15950 -> 15857 bytes .../panoramas/hub_night/panorama_3.jpg | Bin 17928 -> 17829 bytes .../panoramas/hub_night/panorama_5.jpg | Bin 15786 -> 15695 bytes .../panoramas/mining_1_day/panorama_0.jpg | Bin 37877 -> 36322 bytes .../panoramas/mining_1_day/panorama_1.jpg | Bin 33985 -> 32721 bytes .../panoramas/mining_1_day/panorama_2.jpg | Bin 29885 -> 28886 bytes .../panoramas/mining_1_day/panorama_3.jpg | Bin 29426 -> 28366 bytes .../panoramas/mining_1_day/panorama_4.jpg | Bin 17061 -> 16993 bytes .../panoramas/mining_1_day/panorama_5.jpg | Bin 24623 -> 23602 bytes .../panoramas/mining_1_night/panorama_0.jpg | Bin 25721 -> 25182 bytes .../panoramas/mining_1_night/panorama_1.jpg | Bin 22713 -> 22307 bytes .../panoramas/mining_1_night/panorama_3.jpg | Bin 19113 -> 18911 bytes .../panoramas/mining_1_night/panorama_5.jpg | Bin 17142 -> 17041 bytes .../panoramas/unknown/panorama_0.jpg | Bin 26015 -> 25187 bytes .../panoramas/unknown/panorama_1.jpg | Bin 26016 -> 25186 bytes .../panoramas/unknown/panorama_2.jpg | Bin 24769 -> 24064 bytes .../panoramas/unknown/panorama_3.jpg | Bin 24854 -> 24124 bytes .../panoramas/unknown/panorama_4.jpg | Bin 26123 -> 25315 bytes .../panoramas/unknown/panorama_5.jpg | Bin 24894 -> 24144 bytes .../petdisplay/petdisplayarmor_dark.png | Bin 1738 -> 1269 bytes .../petdisplay/petdisplayarmor_fsr.png | Bin 1734 -> 1305 bytes .../petdisplay/petdisplayarmor_phqdark.png | Bin 1728 -> 1272 bytes .../petdisplay/petdisplayarmor_transparent.png | Bin 1890 -> 1314 bytes .../notenoughupdates/petdisplay/petdisplaysolo.png | Bin 1743 -> 1284 bytes .../petdisplay/petdisplaysolo_dark.png | Bin 1545 -> 1190 bytes .../petdisplay/petdisplaysolo_fsr.png | Bin 1548 -> 1231 bytes .../petdisplay/petdisplaysolo_phqdark.png | Bin 1537 -> 1191 bytes .../petdisplay/petdisplaysolo_transparent.png | Bin 1720 -> 1257 bytes .../price_graph_gui/price_information_gui.png | Bin 2079 -> 1547 bytes .../price_graph_gui/price_information_gui_dark.png | Bin 2088 -> 1553 bytes .../price_graph_gui/price_information_gui_fsr.png | Bin 2045 -> 1520 bytes .../price_information_gui_phqdark.png | Bin 2091 -> 1556 bytes .../resources/assets/notenoughupdates/pv_basic.png | Bin 2836 -> 1860 bytes .../assets/notenoughupdates/pv_bestiary_tab.png | Bin 628 -> 400 bytes .../assets/notenoughupdates/pv_bingo_tab.png | Bin 2635 -> 1914 bytes .../assets/notenoughupdates/pv_elements.png | Bin 3030 -> 2219 bytes .../resources/assets/notenoughupdates/pv_invs.png | Bin 2426 -> 1219 bytes .../assets/notenoughupdates/pv_mining.png | Bin 4516 -> 3137 bytes .../assets/notenoughupdates/pv_trophy_fish_tab.png | Bin 2839 -> 1888 bytes .../assets/notenoughupdates/pv_unknown.png | Bin 1814 -> 1341 bytes .../resources/assets/notenoughupdates/settings.png | Bin 3962 -> 2546 bytes .../assets/notenoughupdates/slotlocking/bound.png | Bin 5619 -> 5512 bytes .../notenoughupdates/storage_gui/storage_gui_0.png | Bin 6939 -> 4334 bytes .../notenoughupdates/storage_gui/storage_gui_1.png | Bin 4859 -> 4026 bytes .../notenoughupdates/storage_gui/storage_gui_2.png | Bin 4380 -> 3669 bytes .../notenoughupdates/storage_gui/storage_gui_3.png | Bin 4469 -> 3419 bytes .../storage_gui/storage_gui_pane_ctm.png | Bin 1523 -> 1460 bytes .../notenoughupdates/storage_gui/storage_icons.png | Bin 5046 -> 3726 bytes .../storage_gui/storage_preview_0.png | Bin 6939 -> 5541 bytes .../storage_gui/storage_preview_1.png | Bin 7369 -> 6383 bytes .../storage_gui/storage_preview_2.png | Bin 7020 -> 5652 bytes .../storage_gui/storage_preview_3.png | Bin 4373 -> 3912 bytes .../storage_gui/we_do_a_little_rolling/0.jpg | Bin 3696 -> 3455 bytes .../storage_gui/we_do_a_little_rolling/1.jpg | Bin 3642 -> 3400 bytes .../storage_gui/we_do_a_little_rolling/10.jpg | Bin 3687 -> 3444 bytes .../storage_gui/we_do_a_little_rolling/11.jpg | Bin 3827 -> 3597 bytes .../storage_gui/we_do_a_little_rolling/12.jpg | Bin 3762 -> 3518 bytes .../storage_gui/we_do_a_little_rolling/13.jpg | Bin 3701 -> 3447 bytes .../storage_gui/we_do_a_little_rolling/14.jpg | Bin 3604 -> 3370 bytes .../storage_gui/we_do_a_little_rolling/15.jpg | Bin 3574 -> 3324 bytes .../storage_gui/we_do_a_little_rolling/16.jpg | Bin 3717 -> 3488 bytes .../storage_gui/we_do_a_little_rolling/17.jpg | Bin 3798 -> 3573 bytes .../storage_gui/we_do_a_little_rolling/18.jpg | Bin 4003 -> 3787 bytes .../storage_gui/we_do_a_little_rolling/2.jpg | Bin 3719 -> 3473 bytes .../storage_gui/we_do_a_little_rolling/3.jpg | Bin 3730 -> 3494 bytes .../storage_gui/we_do_a_little_rolling/4.jpg | Bin 3762 -> 3525 bytes .../storage_gui/we_do_a_little_rolling/5.jpg | Bin 3706 -> 3472 bytes .../storage_gui/we_do_a_little_rolling/6.jpg | Bin 3560 -> 3315 bytes .../storage_gui/we_do_a_little_rolling/7.jpg | Bin 3547 -> 3289 bytes .../storage_gui/we_do_a_little_rolling/8.jpg | Bin 3579 -> 3320 bytes .../storage_gui/we_do_a_little_rolling/9.jpg | Bin 3609 -> 3351 bytes .../notenoughupdates/supersecretassets/bald.png | Bin 19909 -> 17189 bytes .../notenoughupdates/supersecretassets/lunar.png | Bin 54979 -> 33956 bytes .../textures/gui/forge_recipe_tall.png | Bin 2743 -> 2548 bytes .../textures/gui/item_shop_recipe.png | Bin 3177 -> 2829 bytes .../notenoughupdates/textures/gui/navigation.png | Bin 984 -> 883 bytes .../textures/gui/villager_recipe_tall.png | Bin 2709 -> 2503 bytes 227 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/resources/assets/notenoughupdates/accessory_bag_overlay.png b/src/main/resources/assets/notenoughupdates/accessory_bag_overlay.png index 6fcac4d1..9de21da0 100644 Binary files a/src/main/resources/assets/notenoughupdates/accessory_bag_overlay.png and b/src/main/resources/assets/notenoughupdates/accessory_bag_overlay.png differ diff --git a/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay.png b/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay.png index 56f6060a..56bf0e1d 100644 Binary files a/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay.png and b/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay.png differ diff --git a/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay_transparent_pet.png b/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay_transparent_pet.png index aeb1b5ed..0467011e 100644 Binary files a/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay_transparent_pet.png and b/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay_transparent_pet.png differ diff --git a/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay.png b/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay.png index 3e21edda..7e15ccd5 100644 Binary files a/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay.png and b/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay.png differ diff --git a/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay_tab_completed.png b/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay_tab_completed.png index b5cf62c0..e6d5ccf0 100644 Binary files a/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay_tab_completed.png and b/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay_tab_completed.png differ diff --git a/src/main/resources/assets/notenoughupdates/auction_profit.png b/src/main/resources/assets/notenoughupdates/auction_profit.png index 80e06c10..26a2bbc6 100644 Binary files a/src/main/resources/assets/notenoughupdates/auction_profit.png and b/src/main/resources/assets/notenoughupdates/auction_profit.png differ diff --git a/src/main/resources/assets/notenoughupdates/button_white.png b/src/main/resources/assets/notenoughupdates/button_white.png index 7763716d..d6460e89 100644 Binary files a/src/main/resources/assets/notenoughupdates/button_white.png and b/src/main/resources/assets/notenoughupdates/button_white.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/dg_preview.png b/src/main/resources/assets/notenoughupdates/capes/dg_preview.png index 2e68d99d..bf9bad22 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/dg_preview.png and b/src/main/resources/assets/notenoughupdates/capes/dg_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/fade.png b/src/main/resources/assets/notenoughupdates/capes/fade.png index d898ec4d..7ee247a6 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/fade.png and b/src/main/resources/assets/notenoughupdates/capes/fade.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/fade_preview.png b/src/main/resources/assets/notenoughupdates/capes/fade_preview.png index fcb121e3..2a580336 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/fade_preview.png and b/src/main/resources/assets/notenoughupdates/capes/fade_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/furf.png b/src/main/resources/assets/notenoughupdates/capes/furf.png index a083a662..74983e1f 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/furf.png and b/src/main/resources/assets/notenoughupdates/capes/furf.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/furf_preview.png b/src/main/resources/assets/notenoughupdates/capes/furf_preview.png index d65f8fbe..8f5dd5da 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/furf_preview.png and b/src/main/resources/assets/notenoughupdates/capes/furf_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/ironmoon.png b/src/main/resources/assets/notenoughupdates/capes/ironmoon.png index b25221d9..2e3ebda1 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/ironmoon.png and b/src/main/resources/assets/notenoughupdates/capes/ironmoon.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/ironmoon_preview.png b/src/main/resources/assets/notenoughupdates/capes/ironmoon_preview.png index c233128a..242bec0e 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/ironmoon_preview.png and b/src/main/resources/assets/notenoughupdates/capes/ironmoon_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/lava.png b/src/main/resources/assets/notenoughupdates/capes/lava.png index 8f60a03e..71451cf2 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/lava.png and b/src/main/resources/assets/notenoughupdates/capes/lava.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/mbstaff_preview.png b/src/main/resources/assets/notenoughupdates/capes/mbstaff_preview.png index 0d9ad9eb..147491ef 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/mbstaff_preview.png and b/src/main/resources/assets/notenoughupdates/capes/mbstaff_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/mcworld.png b/src/main/resources/assets/notenoughupdates/capes/mcworld.png index 89b3b367..562ab737 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/mcworld.png and b/src/main/resources/assets/notenoughupdates/capes/mcworld.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/packshq_preview.png b/src/main/resources/assets/notenoughupdates/capes/packshq_preview.png index d69ff6c0..45c36da3 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/packshq_preview.png and b/src/main/resources/assets/notenoughupdates/capes/packshq_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/screensaver.png b/src/main/resources/assets/notenoughupdates/capes/screensaver.png index c6ce9e8c..024f5504 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/screensaver.png and b/src/main/resources/assets/notenoughupdates/capes/screensaver.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/screensaver_preview.png b/src/main/resources/assets/notenoughupdates/capes/screensaver_preview.png index a7d890f8..35d0cdeb 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/screensaver_preview.png and b/src/main/resources/assets/notenoughupdates/capes/screensaver_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch.png b/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch.png index 66314629..a801e8c0 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch.png and b/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch_preview.png b/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch_preview.png index 2be61fee..c8fb5204 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch_preview.png and b/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/sharex_white.png b/src/main/resources/assets/notenoughupdates/capes/sharex_white.png index c7457897..c638e825 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/sharex_white.png and b/src/main/resources/assets/notenoughupdates/capes/sharex_white.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/sharex_white_preview.png b/src/main/resources/assets/notenoughupdates/capes/sharex_white_preview.png index 6ed14bd8..0855c8d7 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/sharex_white_preview.png and b/src/main/resources/assets/notenoughupdates/capes/sharex_white_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/skyclient.png b/src/main/resources/assets/notenoughupdates/capes/skyclient.png index 8fa36038..62543232 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/skyclient.png and b/src/main/resources/assets/notenoughupdates/capes/skyclient.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/skyclient_preview.png b/src/main/resources/assets/notenoughupdates/capes/skyclient_preview.png index 36140806..d8ad43f0 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/skyclient_preview.png and b/src/main/resources/assets/notenoughupdates/capes/skyclient_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/space.png b/src/main/resources/assets/notenoughupdates/capes/space.png index 76d4a42c..0fd5c0a5 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/space.png and b/src/main/resources/assets/notenoughupdates/capes/space.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/stormy_lh.png b/src/main/resources/assets/notenoughupdates/capes/stormy_lh.png index aba13112..201f31c5 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/stormy_lh.png and b/src/main/resources/assets/notenoughupdates/capes/stormy_lh.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/stormy_lh_preview.png b/src/main/resources/assets/notenoughupdates/capes/stormy_lh_preview.png index 6a9b43d0..e03a6379 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/stormy_lh_preview.png and b/src/main/resources/assets/notenoughupdates/capes/stormy_lh_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/subreddit_dark.png b/src/main/resources/assets/notenoughupdates/capes/subreddit_dark.png index 83ae4223..4daa66ca 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/subreddit_dark.png and b/src/main/resources/assets/notenoughupdates/capes/subreddit_dark.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/subreddit_light.png b/src/main/resources/assets/notenoughupdates/capes/subreddit_light.png index a2af3c1d..f32d1b02 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/subreddit_light.png and b/src/main/resources/assets/notenoughupdates/capes/subreddit_light.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/subreddit_light_preview.png b/src/main/resources/assets/notenoughupdates/capes/subreddit_light_preview.png index d06a5c33..c9e3d636 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/subreddit_light_preview.png and b/src/main/resources/assets/notenoughupdates/capes/subreddit_light_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/thebakery.png b/src/main/resources/assets/notenoughupdates/capes/thebakery.png index 8d4ca440..8784cf63 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/thebakery.png and b/src/main/resources/assets/notenoughupdates/capes/thebakery.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/thebakery_preview.png b/src/main/resources/assets/notenoughupdates/capes/thebakery_preview.png index 4d0a6b7e..eb3dbcd9 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/thebakery_preview.png and b/src/main/resources/assets/notenoughupdates/capes/thebakery_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/void.png b/src/main/resources/assets/notenoughupdates/capes/void.png index d9f27e95..2c481444 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/void.png and b/src/main/resources/assets/notenoughupdates/capes/void.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/void_preview.png b/src/main/resources/assets/notenoughupdates/capes/void_preview.png index 5bac3004..a2914145 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/void_preview.png and b/src/main/resources/assets/notenoughupdates/capes/void_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/colour_selector_dot.png b/src/main/resources/assets/notenoughupdates/colour_selector_dot.png index 1150c8bb..775c5290 100644 Binary files a/src/main/resources/assets/notenoughupdates/colour_selector_dot.png and b/src/main/resources/assets/notenoughupdates/colour_selector_dot.png differ diff --git a/src/main/resources/assets/notenoughupdates/core/colour_selector_dot.png b/src/main/resources/assets/notenoughupdates/core/colour_selector_dot.png index 1150c8bb..6dc8cc15 100644 Binary files a/src/main/resources/assets/notenoughupdates/core/colour_selector_dot.png and b/src/main/resources/assets/notenoughupdates/core/colour_selector_dot.png differ diff --git a/src/main/resources/assets/notenoughupdates/custom_enchant_gui.png b/src/main/resources/assets/notenoughupdates/custom_enchant_gui.png index 735a3fb4..fe53d96d 100644 Binary files a/src/main/resources/assets/notenoughupdates/custom_enchant_gui.png and b/src/main/resources/assets/notenoughupdates/custom_enchant_gui.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/10.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/10.png index 6cd64ed1..a1935c97 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/10.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/10.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/11.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/11.png index 65898e8f..f0471e28 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/11.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/11.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/2.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/2.png index 6f0daba0..6d80fa08 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/2.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/2.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/3.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/3.png index 4c123e77..4ed21c74 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/3.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/3.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/4.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/4.png index 833b9017..3384e52f 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/4.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/4.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/5.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/5.png index 93bef87d..cb74af61 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/5.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/5.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/8.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/8.png index 54db6fbc..9fb3d937 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/8.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/8.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/9.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/9.png index c5fedff9..40b88826 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/9.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/9.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/map_border_dragon_stone.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/map_border_dragon_stone.png index c79eee7f..cb604e86 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/map_border_dragon_stone.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/map_border_dragon_stone.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/10.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/10.png index 4f4b1dc7..ef623aec 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/10.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/10.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/11.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/11.png index 3730ab57..132ccd97 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/11.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/11.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/3.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/3.png index 68824d04..a22cf178 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/3.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/3.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/4.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/4.png index 3b8776e7..51c59181 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/4.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/4.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/5.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/5.png index 3a708494..a4625bf9 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/5.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/5.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/8.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/8.png index c131badf..982477f9 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/8.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/8.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/9.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/9.png index a42870f2..723056e9 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/9.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/9.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/10.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/10.png index b9bcac1d..359eacf6 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/10.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/10.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/11.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/11.png index 2fdbe252..da1e28eb 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/11.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/11.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/3.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/3.png index fe0ba4b9..92e441ea 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/3.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/3.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/4.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/4.png index bd580c8e..5a8cb034 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/4.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/4.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/5.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/5.png index 6f2bdc29..1dabecff 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/5.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/5.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/8.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/8.png index 5dd06a89..055e99fb 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/8.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/8.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/9.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/9.png index 1d275525..199da5c7 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/9.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/9.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/steampunk.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/steampunk.png index 3d1c0833..dbe35950 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/steampunk.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/steampunk.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_win/a.png b/src/main/resources/assets/notenoughupdates/dungeon_win/a.png index 85322946..cfb3630d 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_win/a.png and b/src/main/resources/assets/notenoughupdates/dungeon_win/a.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_win/s.png b/src/main/resources/assets/notenoughupdates/dungeon_win/s.png index a514f285..a1bf993c 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_win/s.png and b/src/main/resources/assets/notenoughupdates/dungeon_win/s.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_win/splus.png b/src/main/resources/assets/notenoughupdates/dungeon_win/splus.png index 732d30a3..69aa0c75 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_win/splus.png and b/src/main/resources/assets/notenoughupdates/dungeon_win/splus.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style4/dynamic_54_slot_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style4/dynamic_54_slot_ctm.png index fa43a0ed..aa3f32fe 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style4/dynamic_54_slot_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style4/dynamic_54_slot_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_button_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_button_ctm.png index bab0eab7..ee5a3b54 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_button_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_button_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_slot_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_slot_ctm.png index fa43a0ed..13c83e85 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_slot_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_slot_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_button_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_button_ctm.png index fa43a0ed..4ba59d9a 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_button_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_button_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_slot_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_slot_ctm.png index fa43a0ed..3c91e846 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_slot_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_slot_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_button_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_button_ctm.png index ea57f0d0..b8749675 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_button_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_button_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_slot_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_slot_ctm.png index fa43a0ed..ff73398b 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_slot_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_slot_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_off.png b/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_off.png index 7a1aa4a4..34fde767 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_off.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_off.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_on.png b/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_on.png index 5f4960f9..55f0cf25 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_on.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_on.png differ diff --git a/src/main/resources/assets/notenoughupdates/fishing_warning_exclam.png b/src/main/resources/assets/notenoughupdates/fishing_warning_exclam.png index 914e86bf..0e2078dc 100644 Binary files a/src/main/resources/assets/notenoughupdates/fishing_warning_exclam.png and b/src/main/resources/assets/notenoughupdates/fishing_warning_exclam.png differ diff --git a/src/main/resources/assets/notenoughupdates/fuel_bar.png b/src/main/resources/assets/notenoughupdates/fuel_bar.png index f15ab522..1b2daa14 100644 Binary files a/src/main/resources/assets/notenoughupdates/fuel_bar.png and b/src/main/resources/assets/notenoughupdates/fuel_bar.png differ diff --git a/src/main/resources/assets/notenoughupdates/help.png b/src/main/resources/assets/notenoughupdates/help.png index 1a7ebb60..71501035 100644 Binary files a/src/main/resources/assets/notenoughupdates/help.png and b/src/main/resources/assets/notenoughupdates/help.png differ diff --git a/src/main/resources/assets/notenoughupdates/invbuttons/extraicons/settings.png b/src/main/resources/assets/notenoughupdates/invbuttons/extraicons/settings.png index 481a0588..dd65a6e4 100644 Binary files a/src/main/resources/assets/notenoughupdates/invbuttons/extraicons/settings.png and b/src/main/resources/assets/notenoughupdates/invbuttons/extraicons/settings.png differ diff --git a/src/main/resources/assets/notenoughupdates/logo.png b/src/main/resources/assets/notenoughupdates/logo.png index c08a8991..26d30ff6 100644 Binary files a/src/main/resources/assets/notenoughupdates/logo.png and b/src/main/resources/assets/notenoughupdates/logo.png differ diff --git a/src/main/resources/assets/notenoughupdates/on.png b/src/main/resources/assets/notenoughupdates/on.png index 5520a661..e3f0eee0 100644 Binary files a/src/main/resources/assets/notenoughupdates/on.png and b/src/main/resources/assets/notenoughupdates/on.png differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_0.jpg index 27531695..e777b0fc 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_1.jpg index 5586cf8a..2564894c 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_2.jpg index 78540079..7bf12754 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_3.jpg index 74bc8f23..a6c9c2fe 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_4.jpg index cdf3fdde..d15749a6 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_night/panorama_5.jpg index f9e5ed40..2f9aac53 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_0.jpg index f1f6a028..ed3339e5 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_1.jpg index 882e20a2..7452f9ef 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_2.jpg index 3ec9391f..aa988960 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_3.jpg index 0c99863b..df60e3ba 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_4.jpg index 92b62ab3..ddd78a06 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_5.jpg index 169c36be..45c635f9 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_0.jpg index cb60f6d3..74ce480c 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_3.jpg index 39a3b594..1aadb5ba 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_0.jpg index 32f9f7bb..3cc6ec86 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_1.jpg index ece00b29..7ed2a00e 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_3.jpg index ed4af05e..4715dacf 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_4.jpg index aca79dcf..53449ffe 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_5.jpg index 398e21c9..a76500fe 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_4.jpg index 75b6cd4e..8b21cd0c 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_5.jpg index c5e99eac..e1562211 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_4.jpg index 75b6cd4e..8b21cd0c 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_5.jpg index c5e99eac..e1562211 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_0.jpg index f6231245..55ad8851 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_1.jpg index 286b3a38..bb0edeaa 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_2.jpg index c6fca879..ed6e4f58 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_3.jpg index 01b2f816..ccea9cd2 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_4.jpg index a5c810fe..4c8e6249 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_5.jpg index 30d32a08..803f43f4 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_0.jpg index b1fb3e84..39080e08 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_1.jpg index f7642beb..3167ff3a 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_2.jpg index 3cb3b42f..dd39c253 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_3.jpg index a98d7672..656700da 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_4.jpg index ad2b8c70..4cfc6d34 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_5.jpg index f2e93cde..b47d9b7f 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_0.jpg index c03b849d..302b60b8 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_1.jpg index 2286407b..a35a3ff8 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_2.jpg index 62127f51..6121cbcf 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_3.jpg index fe631d89..139dcceb 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_4.jpg index cf835eea..e9de5bf8 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_5.jpg index 879b5747..29304f3c 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_0.jpg index 265515f6..fac794d6 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_1.jpg index e774ca7a..7b526d60 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_2.jpg index 1e3c8a98..d3cbe633 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_3.jpg index 7833eb89..259bd3d6 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_5.jpg index ae3bdbdf..e1f41379 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_0.jpg index e03657af..009684ce 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_2.jpg index c83f2c91..3fb00305 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_3.jpg index 9b730712..1ae90a23 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_5.jpg index a17337b9..f98a25e2 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_0.jpg index 26909780..e893b436 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_3.jpg index 0e870f38..33512fe1 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_5.jpg index f40c330c..ddc7820f 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_0.jpg index 9a12896f..6ff184ff 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_1.jpg index c157ccdd..f0133647 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_2.jpg index ecee024b..bdb4e055 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_3.jpg index 0dbef91f..42d45a9c 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_4.jpg index 681aa33e..2bc73a30 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_5.jpg index 6be866d2..160f84c6 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_0.jpg index 050e4f78..1631924e 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_3.jpg index 3af3638e..8647d5ee 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_5.jpg index d3c13992..4bac20d8 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_0.jpg index 0d5f26dd..e61f7c12 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_1.jpg index 820b92a4..3e97f3c0 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_2.jpg index 14d01dd1..141a4fcf 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_3.jpg index bfc66ec9..570da076 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_5.jpg index f3df82a5..cafeb1dd 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_0.jpg index 34bc84db..988c7cdb 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_1.jpg index 742d158b..0ef7e0a2 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_2.jpg index abf0a253..1d3f8d11 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_3.jpg index 7efc75d6..aebc2b4e 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_5.jpg index e86e93c4..3159658d 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_0.jpg index e0c4288d..7872a822 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_1.jpg index e0cc8139..40c1b8bf 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_2.jpg index 381912e1..2586dec8 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_3.jpg index 0beaf628..7d4a23a4 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_4.jpg index 26417482..befb2875 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_5.jpg index 8571b288..2e2d1700 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_0.jpg index e90efd5f..3045fbc5 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_1.jpg index 603f9d04..6e04d738 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_3.jpg index abd201d1..1d87c269 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_5.jpg index 93a5a26d..67b0c1a0 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_0.jpg index 9482df80..3c579656 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_1.jpg index 1b4235dd..5d38a803 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_2.jpg index 2f1fcc06..46465f71 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_3.jpg index ce20d9b5..39eb8c7e 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_4.jpg index 3dcdac57..67cd1ecf 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_5.jpg index 45f65c7c..fe839f66 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_dark.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_dark.png index 27abd2d5..d231bd86 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_dark.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_dark.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_fsr.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_fsr.png index 39782b3f..d179fa42 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_fsr.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_fsr.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_phqdark.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_phqdark.png index 83b78351..d33dac25 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_phqdark.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_phqdark.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_transparent.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_transparent.png index f1bebc01..6e9f1928 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_transparent.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_transparent.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo.png index c047d5ad..9f4f712e 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_dark.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_dark.png index 6ad6216c..c43b5fdb 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_dark.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_dark.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_fsr.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_fsr.png index f39235af..795ba881 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_fsr.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_fsr.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_phqdark.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_phqdark.png index 80566c92..41fa8bc1 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_phqdark.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_phqdark.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_transparent.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_transparent.png index dfe92b74..2364318f 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_transparent.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_transparent.png differ diff --git a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui.png b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui.png index 633be870..d84526ca 100644 Binary files a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui.png and b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui.png differ diff --git a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_dark.png b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_dark.png index 0f7743e6..d70fc7dc 100644 Binary files a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_dark.png and b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_dark.png differ diff --git a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_fsr.png b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_fsr.png index e98bdb7d..36921193 100644 Binary files a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_fsr.png and b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_fsr.png differ diff --git a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_phqdark.png b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_phqdark.png index f794319f..893d2716 100644 Binary files a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_phqdark.png and b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_phqdark.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_basic.png b/src/main/resources/assets/notenoughupdates/pv_basic.png index 4d5236f5..1c46a8e4 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_basic.png and b/src/main/resources/assets/notenoughupdates/pv_basic.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_bestiary_tab.png b/src/main/resources/assets/notenoughupdates/pv_bestiary_tab.png index 620c156b..eed9a72b 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_bestiary_tab.png and b/src/main/resources/assets/notenoughupdates/pv_bestiary_tab.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_bingo_tab.png b/src/main/resources/assets/notenoughupdates/pv_bingo_tab.png index 135035cf..56046537 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_bingo_tab.png and b/src/main/resources/assets/notenoughupdates/pv_bingo_tab.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_elements.png b/src/main/resources/assets/notenoughupdates/pv_elements.png index 7e9033bd..2a6cd1c2 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_elements.png and b/src/main/resources/assets/notenoughupdates/pv_elements.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_invs.png b/src/main/resources/assets/notenoughupdates/pv_invs.png index 46c7b0e9..c25ce499 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_invs.png and b/src/main/resources/assets/notenoughupdates/pv_invs.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_mining.png b/src/main/resources/assets/notenoughupdates/pv_mining.png index a183fe88..226c7e40 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_mining.png and b/src/main/resources/assets/notenoughupdates/pv_mining.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_trophy_fish_tab.png b/src/main/resources/assets/notenoughupdates/pv_trophy_fish_tab.png index d42446c1..47ac6928 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_trophy_fish_tab.png and b/src/main/resources/assets/notenoughupdates/pv_trophy_fish_tab.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_unknown.png b/src/main/resources/assets/notenoughupdates/pv_unknown.png index d6ce3a00..0c282ac7 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_unknown.png and b/src/main/resources/assets/notenoughupdates/pv_unknown.png differ diff --git a/src/main/resources/assets/notenoughupdates/settings.png b/src/main/resources/assets/notenoughupdates/settings.png index 481a0588..c81d4c18 100644 Binary files a/src/main/resources/assets/notenoughupdates/settings.png and b/src/main/resources/assets/notenoughupdates/settings.png differ diff --git a/src/main/resources/assets/notenoughupdates/slotlocking/bound.png b/src/main/resources/assets/notenoughupdates/slotlocking/bound.png index 1631d386..8ff435b3 100644 Binary files a/src/main/resources/assets/notenoughupdates/slotlocking/bound.png and b/src/main/resources/assets/notenoughupdates/slotlocking/bound.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.png index da1461be..12f613ff 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.png index 3ff29ff1..5c0e8175 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.png index 16150a20..8ceeb6c3 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.png index 755dc865..74d9820d 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_pane_ctm.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_pane_ctm.png index 429e7a28..56a1c8ef 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_pane_ctm.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_pane_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png index be569369..9dec164f 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_0.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_0.png index faa30c96..dcce08b4 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_0.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_0.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_1.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_1.png index 00ed9488..bb23232d 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_1.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_1.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_2.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_2.png index 89fe7b15..ddaf339c 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_2.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_2.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_3.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_3.png index 7ead5a79..2d23ee4a 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_3.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_3.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/0.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/0.jpg index 48d7a47f..ef225dba 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/0.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/1.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/1.jpg index ace0d1a0..363bc4ab 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/1.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/10.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/10.jpg index afed0c9b..82f66718 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/10.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/10.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/11.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/11.jpg index 0b03bbfb..9baa4531 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/11.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/11.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/12.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/12.jpg index b7142650..fea92c09 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/12.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/12.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/13.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/13.jpg index 8e62f742..4a220319 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/13.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/13.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/14.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/14.jpg index 6f296154..b50fb7cf 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/14.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/14.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/15.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/15.jpg index 682aae45..15fa28f9 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/15.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/15.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/16.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/16.jpg index ea4efa72..b6bd773a 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/16.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/16.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/17.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/17.jpg index 9be04bea..7046b122 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/17.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/17.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/18.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/18.jpg index d2f1e372..1429548a 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/18.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/18.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/2.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/2.jpg index 11598aec..5050048b 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/2.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/3.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/3.jpg index 6c8a53e7..468278b8 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/3.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/4.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/4.jpg index c78a311f..7d29bf3d 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/4.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/5.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/5.jpg index 48080f68..4277a767 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/5.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/6.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/6.jpg index 382082e2..bbe597d7 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/6.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/6.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/7.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/7.jpg index 7f3576fe..8f311a6d 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/7.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/7.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/8.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/8.jpg index de065e28..d7c97663 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/8.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/8.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/9.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/9.jpg index 29fdfc1b..39da193a 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/9.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/9.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/supersecretassets/bald.png b/src/main/resources/assets/notenoughupdates/supersecretassets/bald.png index 4f730a44..7b407117 100644 Binary files a/src/main/resources/assets/notenoughupdates/supersecretassets/bald.png and b/src/main/resources/assets/notenoughupdates/supersecretassets/bald.png differ diff --git a/src/main/resources/assets/notenoughupdates/supersecretassets/lunar.png b/src/main/resources/assets/notenoughupdates/supersecretassets/lunar.png index 7de98284..469d96b8 100644 Binary files a/src/main/resources/assets/notenoughupdates/supersecretassets/lunar.png and b/src/main/resources/assets/notenoughupdates/supersecretassets/lunar.png differ diff --git a/src/main/resources/assets/notenoughupdates/textures/gui/forge_recipe_tall.png b/src/main/resources/assets/notenoughupdates/textures/gui/forge_recipe_tall.png index cdd8b0f1..d89260db 100644 Binary files a/src/main/resources/assets/notenoughupdates/textures/gui/forge_recipe_tall.png and b/src/main/resources/assets/notenoughupdates/textures/gui/forge_recipe_tall.png differ diff --git a/src/main/resources/assets/notenoughupdates/textures/gui/item_shop_recipe.png b/src/main/resources/assets/notenoughupdates/textures/gui/item_shop_recipe.png index e78c0f44..9226529a 100644 Binary files a/src/main/resources/assets/notenoughupdates/textures/gui/item_shop_recipe.png and b/src/main/resources/assets/notenoughupdates/textures/gui/item_shop_recipe.png differ diff --git a/src/main/resources/assets/notenoughupdates/textures/gui/navigation.png b/src/main/resources/assets/notenoughupdates/textures/gui/navigation.png index 628f3a47..fc85046f 100644 Binary files a/src/main/resources/assets/notenoughupdates/textures/gui/navigation.png and b/src/main/resources/assets/notenoughupdates/textures/gui/navigation.png differ diff --git a/src/main/resources/assets/notenoughupdates/textures/gui/villager_recipe_tall.png b/src/main/resources/assets/notenoughupdates/textures/gui/villager_recipe_tall.png index 8cb89bae..f22f28ee 100644 Binary files a/src/main/resources/assets/notenoughupdates/textures/gui/villager_recipe_tall.png and b/src/main/resources/assets/notenoughupdates/textures/gui/villager_recipe_tall.png differ -- cgit From df9f5b86598e5d358463bcc770471a274027626d Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Tue, 4 Oct 2022 13:59:56 +0200 Subject: Revert "[ImgBot] Optimize images" (#334) --- .../notenoughupdates/accessory_bag_overlay.png | Bin 587 -> 973 bytes .../notenoughupdates/armordisplay/armordisplay.png | Bin 381 -> 1599 bytes .../armordisplay/armordisplay_transparent_pet.png | Bin 1171 -> 1500 bytes .../auc_search/ah_search_overlay.png | Bin 3168 -> 3513 bytes .../auc_search/ah_search_overlay_tab_completed.png | Bin 6547 -> 6969 bytes .../assets/notenoughupdates/auction_profit.png | Bin 551 -> 595 bytes .../assets/notenoughupdates/button_white.png | Bin 4882 -> 6570 bytes .../assets/notenoughupdates/capes/dg_preview.png | Bin 7788 -> 18852 bytes .../assets/notenoughupdates/capes/fade.png | Bin 10289 -> 18572 bytes .../assets/notenoughupdates/capes/fade_preview.png | Bin 10309 -> 10411 bytes .../assets/notenoughupdates/capes/furf.png | Bin 5776 -> 8509 bytes .../assets/notenoughupdates/capes/furf_preview.png | Bin 3286 -> 3506 bytes .../assets/notenoughupdates/capes/ironmoon.png | Bin 133758 -> 142131 bytes .../notenoughupdates/capes/ironmoon_preview.png | Bin 88214 -> 92492 bytes .../assets/notenoughupdates/capes/lava.png | Bin 167381 -> 169280 bytes .../notenoughupdates/capes/mbstaff_preview.png | Bin 38573 -> 39260 bytes .../assets/notenoughupdates/capes/mcworld.png | Bin 280386 -> 291014 bytes .../notenoughupdates/capes/packshq_preview.png | Bin 14346 -> 14680 bytes .../assets/notenoughupdates/capes/screensaver.png | Bin 31139 -> 31381 bytes .../notenoughupdates/capes/screensaver_preview.png | Bin 17150 -> 19453 bytes .../notenoughupdates/capes/secondpfirsisch.png | Bin 52827 -> 58167 bytes .../capes/secondpfirsisch_preview.png | Bin 36232 -> 38433 bytes .../assets/notenoughupdates/capes/sharex_white.png | Bin 15517 -> 27251 bytes .../capes/sharex_white_preview.png | Bin 15204 -> 21698 bytes .../assets/notenoughupdates/capes/skyclient.png | Bin 13024 -> 27981 bytes .../notenoughupdates/capes/skyclient_preview.png | Bin 5987 -> 10294 bytes .../assets/notenoughupdates/capes/space.png | Bin 856184 -> 922429 bytes .../assets/notenoughupdates/capes/stormy_lh.png | Bin 24286 -> 56764 bytes .../notenoughupdates/capes/stormy_lh_preview.png | Bin 11290 -> 12899 bytes .../notenoughupdates/capes/subreddit_dark.png | Bin 5275 -> 7297 bytes .../notenoughupdates/capes/subreddit_light.png | Bin 5353 -> 7508 bytes .../capes/subreddit_light_preview.png | Bin 2406 -> 2583 bytes .../assets/notenoughupdates/capes/thebakery.png | Bin 431168 -> 537705 bytes .../notenoughupdates/capes/thebakery_preview.png | Bin 50272 -> 71386 bytes .../assets/notenoughupdates/capes/void.png | Bin 20910 -> 41607 bytes .../assets/notenoughupdates/capes/void_preview.png | Bin 3235 -> 4712 bytes .../notenoughupdates/colour_selector_dot.png | Bin 2596 -> 3677 bytes .../notenoughupdates/core/colour_selector_dot.png | Bin 2596 -> 3677 bytes .../assets/notenoughupdates/custom_enchant_gui.png | Bin 3227 -> 4982 bytes .../dungeon_map/borders/large/10.png | Bin 6065 -> 7050 bytes .../dungeon_map/borders/large/11.png | Bin 12073 -> 16913 bytes .../dungeon_map/borders/large/2.png | Bin 943 -> 1006 bytes .../dungeon_map/borders/large/3.png | Bin 6232 -> 6971 bytes .../dungeon_map/borders/large/4.png | Bin 7775 -> 10886 bytes .../dungeon_map/borders/large/5.png | Bin 8195 -> 13433 bytes .../dungeon_map/borders/large/8.png | Bin 6080 -> 6904 bytes .../dungeon_map/borders/large/9.png | Bin 5405 -> 6779 bytes .../borders/map_border_dragon_stone.png | Bin 2351 -> 4952 bytes .../dungeon_map/borders/medium/10.png | Bin 6222 -> 6703 bytes .../dungeon_map/borders/medium/11.png | Bin 11183 -> 15370 bytes .../dungeon_map/borders/medium/3.png | Bin 6013 -> 6522 bytes .../dungeon_map/borders/medium/4.png | Bin 5987 -> 7093 bytes .../dungeon_map/borders/medium/5.png | Bin 5824 -> 7618 bytes .../dungeon_map/borders/medium/8.png | Bin 5779 -> 6277 bytes .../dungeon_map/borders/medium/9.png | Bin 5654 -> 6362 bytes .../dungeon_map/borders/small/10.png | Bin 6455 -> 7045 bytes .../dungeon_map/borders/small/11.png | Bin 9691 -> 12576 bytes .../dungeon_map/borders/small/3.png | Bin 6386 -> 6697 bytes .../dungeon_map/borders/small/4.png | Bin 5307 -> 5947 bytes .../dungeon_map/borders/small/5.png | Bin 7041 -> 8456 bytes .../dungeon_map/borders/small/8.png | Bin 6365 -> 6789 bytes .../dungeon_map/borders/small/9.png | Bin 5734 -> 5897 bytes .../dungeon_map/borders/steampunk.png | Bin 8341 -> 10039 bytes .../assets/notenoughupdates/dungeon_win/a.png | Bin 517 -> 569 bytes .../assets/notenoughupdates/dungeon_win/s.png | Bin 502 -> 579 bytes .../assets/notenoughupdates/dungeon_win/splus.png | Bin 1482 -> 2296 bytes .../dynamic_54/style4/dynamic_54_slot_ctm.png | Bin 537 -> 539 bytes .../dynamic_54/style5/dynamic_54_button_ctm.png | Bin 533 -> 543 bytes .../dynamic_54/style5/dynamic_54_slot_ctm.png | Bin 537 -> 539 bytes .../dynamic_54/style6/dynamic_54_button_ctm.png | Bin 537 -> 539 bytes .../dynamic_54/style6/dynamic_54_slot_ctm.png | Bin 537 -> 539 bytes .../dynamic_54/style7/dynamic_54_button_ctm.png | Bin 864 -> 3437 bytes .../dynamic_54/style7/dynamic_54_slot_ctm.png | Bin 537 -> 539 bytes .../notenoughupdates/dynamic_54/toggle_off.png | Bin 379 -> 389 bytes .../notenoughupdates/dynamic_54/toggle_on.png | Bin 379 -> 406 bytes .../notenoughupdates/fishing_warning_exclam.png | Bin 5749 -> 5807 bytes .../resources/assets/notenoughupdates/fuel_bar.png | Bin 2271 -> 2333 bytes .../resources/assets/notenoughupdates/help.png | Bin 3018 -> 3500 bytes .../invbuttons/extraicons/settings.png | Bin 2546 -> 3962 bytes .../resources/assets/notenoughupdates/logo.png | Bin 18710 -> 21782 bytes src/main/resources/assets/notenoughupdates/on.png | Bin 446 -> 1311 bytes .../panoramas/combat_1_day/panorama_0.jpg | Bin 20975 -> 21394 bytes .../panoramas/combat_1_day/panorama_1.jpg | Bin 20008 -> 20539 bytes .../panoramas/combat_1_day/panorama_2.jpg | Bin 18018 -> 18095 bytes .../panoramas/combat_1_day/panorama_3.jpg | Bin 20646 -> 21069 bytes .../panoramas/combat_1_day/panorama_4.jpg | Bin 16944 -> 17245 bytes .../panoramas/combat_1_night/panorama_5.jpg | Bin 15892 -> 16017 bytes .../panoramas/combat_3_day/panorama_0.jpg | Bin 32699 -> 34048 bytes .../panoramas/combat_3_day/panorama_1.jpg | Bin 27566 -> 28471 bytes .../panoramas/combat_3_day/panorama_2.jpg | Bin 21806 -> 22159 bytes .../panoramas/combat_3_day/panorama_3.jpg | Bin 26543 -> 27487 bytes .../panoramas/combat_3_day/panorama_4.jpg | Bin 19205 -> 19750 bytes .../panoramas/combat_3_day/panorama_5.jpg | Bin 21050 -> 21597 bytes .../panoramas/combat_3_night/panorama_0.jpg | Bin 18025 -> 18255 bytes .../panoramas/combat_3_night/panorama_3.jpg | Bin 18259 -> 18438 bytes .../panoramas/dark_auction/panorama_0.jpg | Bin 18990 -> 19008 bytes .../panoramas/dark_auction/panorama_1.jpg | Bin 19399 -> 19414 bytes .../panoramas/dark_auction/panorama_3.jpg | Bin 19482 -> 19497 bytes .../panoramas/dark_auction/panorama_4.jpg | Bin 18500 -> 18727 bytes .../panoramas/dark_auction/panorama_5.jpg | Bin 18621 -> 18871 bytes .../panoramas/dungeon/panorama_4.jpg | Bin 18727 -> 18780 bytes .../panoramas/dungeon/panorama_5.jpg | Bin 17991 -> 18041 bytes .../panoramas/dungeon_hub/panorama_4.jpg | Bin 18727 -> 18780 bytes .../panoramas/dungeon_hub/panorama_5.jpg | Bin 17991 -> 18041 bytes .../panoramas/dynamic_day/panorama_0.jpg | Bin 33582 -> 35131 bytes .../panoramas/dynamic_day/panorama_1.jpg | Bin 31126 -> 32356 bytes .../panoramas/dynamic_day/panorama_2.jpg | Bin 32793 -> 34147 bytes .../panoramas/dynamic_day/panorama_3.jpg | Bin 40205 -> 42291 bytes .../panoramas/dynamic_day/panorama_4.jpg | Bin 24929 -> 25831 bytes .../panoramas/dynamic_day/panorama_5.jpg | Bin 20373 -> 20933 bytes .../panoramas/dynamic_night/panorama_0.jpg | Bin 27052 -> 28070 bytes .../panoramas/dynamic_night/panorama_1.jpg | Bin 29354 -> 30401 bytes .../panoramas/dynamic_night/panorama_2.jpg | Bin 28849 -> 29899 bytes .../panoramas/dynamic_night/panorama_3.jpg | Bin 29568 -> 30543 bytes .../panoramas/dynamic_night/panorama_4.jpg | Bin 26255 -> 27401 bytes .../panoramas/dynamic_night/panorama_5.jpg | Bin 21223 -> 21828 bytes .../panoramas/farming_1_day/panorama_0.jpg | Bin 32829 -> 34294 bytes .../panoramas/farming_1_day/panorama_1.jpg | Bin 45004 -> 47518 bytes .../panoramas/farming_1_day/panorama_2.jpg | Bin 44117 -> 46569 bytes .../panoramas/farming_1_day/panorama_3.jpg | Bin 35025 -> 36648 bytes .../panoramas/farming_1_day/panorama_4.jpg | Bin 15667 -> 15788 bytes .../panoramas/farming_1_day/panorama_5.jpg | Bin 45072 -> 47536 bytes .../panoramas/farming_1_night/panorama_0.jpg | Bin 19870 -> 20273 bytes .../panoramas/farming_1_night/panorama_1.jpg | Bin 23078 -> 23666 bytes .../panoramas/farming_1_night/panorama_2.jpg | Bin 25794 -> 26548 bytes .../panoramas/farming_1_night/panorama_3.jpg | Bin 21899 -> 22310 bytes .../panoramas/farming_1_night/panorama_5.jpg | Bin 28777 -> 29882 bytes .../panoramas/farming_2_day/panorama_0.jpg | Bin 29641 -> 30779 bytes .../panoramas/farming_2_day/panorama_2.jpg | Bin 29040 -> 30070 bytes .../panoramas/farming_2_day/panorama_3.jpg | Bin 29641 -> 30822 bytes .../panoramas/farming_2_day/panorama_5.jpg | Bin 23466 -> 24780 bytes .../panoramas/farming_2_night/panorama_0.jpg | Bin 19360 -> 19525 bytes .../panoramas/farming_2_night/panorama_3.jpg | Bin 17432 -> 17533 bytes .../panoramas/farming_2_night/panorama_5.jpg | Bin 17040 -> 17504 bytes .../panoramas/foraging_1_day/panorama_0.jpg | Bin 40489 -> 42789 bytes .../panoramas/foraging_1_day/panorama_1.jpg | Bin 31789 -> 32963 bytes .../panoramas/foraging_1_day/panorama_2.jpg | Bin 34619 -> 36208 bytes .../panoramas/foraging_1_day/panorama_3.jpg | Bin 33244 -> 34657 bytes .../panoramas/foraging_1_day/panorama_4.jpg | Bin 24265 -> 25234 bytes .../panoramas/foraging_1_day/panorama_5.jpg | Bin 27950 -> 29243 bytes .../panoramas/foraging_1_night/panorama_0.jpg | Bin 16927 -> 16958 bytes .../panoramas/foraging_1_night/panorama_3.jpg | Bin 17518 -> 17531 bytes .../panoramas/foraging_1_night/panorama_5.jpg | Bin 16836 -> 17297 bytes .../panoramas/hub_day/panorama_0.jpg | Bin 20153 -> 20453 bytes .../panoramas/hub_day/panorama_1.jpg | Bin 20168 -> 20509 bytes .../panoramas/hub_day/panorama_2.jpg | Bin 23266 -> 23845 bytes .../panoramas/hub_day/panorama_3.jpg | Bin 23872 -> 24436 bytes .../panoramas/hub_day/panorama_5.jpg | Bin 16208 -> 16562 bytes .../panoramas/hub_night/panorama_0.jpg | Bin 16995 -> 17155 bytes .../panoramas/hub_night/panorama_1.jpg | Bin 17361 -> 17538 bytes .../panoramas/hub_night/panorama_2.jpg | Bin 15857 -> 15950 bytes .../panoramas/hub_night/panorama_3.jpg | Bin 17829 -> 17928 bytes .../panoramas/hub_night/panorama_5.jpg | Bin 15695 -> 15786 bytes .../panoramas/mining_1_day/panorama_0.jpg | Bin 36322 -> 37877 bytes .../panoramas/mining_1_day/panorama_1.jpg | Bin 32721 -> 33985 bytes .../panoramas/mining_1_day/panorama_2.jpg | Bin 28886 -> 29885 bytes .../panoramas/mining_1_day/panorama_3.jpg | Bin 28366 -> 29426 bytes .../panoramas/mining_1_day/panorama_4.jpg | Bin 16993 -> 17061 bytes .../panoramas/mining_1_day/panorama_5.jpg | Bin 23602 -> 24623 bytes .../panoramas/mining_1_night/panorama_0.jpg | Bin 25182 -> 25721 bytes .../panoramas/mining_1_night/panorama_1.jpg | Bin 22307 -> 22713 bytes .../panoramas/mining_1_night/panorama_3.jpg | Bin 18911 -> 19113 bytes .../panoramas/mining_1_night/panorama_5.jpg | Bin 17041 -> 17142 bytes .../panoramas/unknown/panorama_0.jpg | Bin 25187 -> 26015 bytes .../panoramas/unknown/panorama_1.jpg | Bin 25186 -> 26016 bytes .../panoramas/unknown/panorama_2.jpg | Bin 24064 -> 24769 bytes .../panoramas/unknown/panorama_3.jpg | Bin 24124 -> 24854 bytes .../panoramas/unknown/panorama_4.jpg | Bin 25315 -> 26123 bytes .../panoramas/unknown/panorama_5.jpg | Bin 24144 -> 24894 bytes .../petdisplay/petdisplayarmor_dark.png | Bin 1269 -> 1738 bytes .../petdisplay/petdisplayarmor_fsr.png | Bin 1305 -> 1734 bytes .../petdisplay/petdisplayarmor_phqdark.png | Bin 1272 -> 1728 bytes .../petdisplay/petdisplayarmor_transparent.png | Bin 1314 -> 1890 bytes .../notenoughupdates/petdisplay/petdisplaysolo.png | Bin 1284 -> 1743 bytes .../petdisplay/petdisplaysolo_dark.png | Bin 1190 -> 1545 bytes .../petdisplay/petdisplaysolo_fsr.png | Bin 1231 -> 1548 bytes .../petdisplay/petdisplaysolo_phqdark.png | Bin 1191 -> 1537 bytes .../petdisplay/petdisplaysolo_transparent.png | Bin 1257 -> 1720 bytes .../price_graph_gui/price_information_gui.png | Bin 1547 -> 2079 bytes .../price_graph_gui/price_information_gui_dark.png | Bin 1553 -> 2088 bytes .../price_graph_gui/price_information_gui_fsr.png | Bin 1520 -> 2045 bytes .../price_information_gui_phqdark.png | Bin 1556 -> 2091 bytes .../resources/assets/notenoughupdates/pv_basic.png | Bin 1860 -> 2836 bytes .../assets/notenoughupdates/pv_bestiary_tab.png | Bin 400 -> 628 bytes .../assets/notenoughupdates/pv_bingo_tab.png | Bin 1914 -> 2635 bytes .../assets/notenoughupdates/pv_elements.png | Bin 2219 -> 3030 bytes .../resources/assets/notenoughupdates/pv_invs.png | Bin 1219 -> 2426 bytes .../assets/notenoughupdates/pv_mining.png | Bin 3137 -> 4516 bytes .../assets/notenoughupdates/pv_trophy_fish_tab.png | Bin 1888 -> 2839 bytes .../assets/notenoughupdates/pv_unknown.png | Bin 1341 -> 1814 bytes .../resources/assets/notenoughupdates/settings.png | Bin 2546 -> 3962 bytes .../assets/notenoughupdates/slotlocking/bound.png | Bin 5512 -> 5619 bytes .../notenoughupdates/storage_gui/storage_gui_0.png | Bin 4334 -> 6939 bytes .../notenoughupdates/storage_gui/storage_gui_1.png | Bin 4026 -> 4859 bytes .../notenoughupdates/storage_gui/storage_gui_2.png | Bin 3669 -> 4380 bytes .../notenoughupdates/storage_gui/storage_gui_3.png | Bin 3419 -> 4469 bytes .../storage_gui/storage_gui_pane_ctm.png | Bin 1460 -> 1523 bytes .../notenoughupdates/storage_gui/storage_icons.png | Bin 3726 -> 5046 bytes .../storage_gui/storage_preview_0.png | Bin 5541 -> 6939 bytes .../storage_gui/storage_preview_1.png | Bin 6383 -> 7369 bytes .../storage_gui/storage_preview_2.png | Bin 5652 -> 7020 bytes .../storage_gui/storage_preview_3.png | Bin 3912 -> 4373 bytes .../storage_gui/we_do_a_little_rolling/0.jpg | Bin 3455 -> 3696 bytes .../storage_gui/we_do_a_little_rolling/1.jpg | Bin 3400 -> 3642 bytes .../storage_gui/we_do_a_little_rolling/10.jpg | Bin 3444 -> 3687 bytes .../storage_gui/we_do_a_little_rolling/11.jpg | Bin 3597 -> 3827 bytes .../storage_gui/we_do_a_little_rolling/12.jpg | Bin 3518 -> 3762 bytes .../storage_gui/we_do_a_little_rolling/13.jpg | Bin 3447 -> 3701 bytes .../storage_gui/we_do_a_little_rolling/14.jpg | Bin 3370 -> 3604 bytes .../storage_gui/we_do_a_little_rolling/15.jpg | Bin 3324 -> 3574 bytes .../storage_gui/we_do_a_little_rolling/16.jpg | Bin 3488 -> 3717 bytes .../storage_gui/we_do_a_little_rolling/17.jpg | Bin 3573 -> 3798 bytes .../storage_gui/we_do_a_little_rolling/18.jpg | Bin 3787 -> 4003 bytes .../storage_gui/we_do_a_little_rolling/2.jpg | Bin 3473 -> 3719 bytes .../storage_gui/we_do_a_little_rolling/3.jpg | Bin 3494 -> 3730 bytes .../storage_gui/we_do_a_little_rolling/4.jpg | Bin 3525 -> 3762 bytes .../storage_gui/we_do_a_little_rolling/5.jpg | Bin 3472 -> 3706 bytes .../storage_gui/we_do_a_little_rolling/6.jpg | Bin 3315 -> 3560 bytes .../storage_gui/we_do_a_little_rolling/7.jpg | Bin 3289 -> 3547 bytes .../storage_gui/we_do_a_little_rolling/8.jpg | Bin 3320 -> 3579 bytes .../storage_gui/we_do_a_little_rolling/9.jpg | Bin 3351 -> 3609 bytes .../notenoughupdates/supersecretassets/bald.png | Bin 17189 -> 19909 bytes .../notenoughupdates/supersecretassets/lunar.png | Bin 33956 -> 54979 bytes .../textures/gui/forge_recipe_tall.png | Bin 2548 -> 2743 bytes .../textures/gui/item_shop_recipe.png | Bin 2829 -> 3177 bytes .../notenoughupdates/textures/gui/navigation.png | Bin 883 -> 984 bytes .../textures/gui/villager_recipe_tall.png | Bin 2503 -> 2709 bytes 227 files changed, 0 insertions(+), 0 deletions(-) diff --git a/src/main/resources/assets/notenoughupdates/accessory_bag_overlay.png b/src/main/resources/assets/notenoughupdates/accessory_bag_overlay.png index 9de21da0..6fcac4d1 100644 Binary files a/src/main/resources/assets/notenoughupdates/accessory_bag_overlay.png and b/src/main/resources/assets/notenoughupdates/accessory_bag_overlay.png differ diff --git a/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay.png b/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay.png index 56bf0e1d..56f6060a 100644 Binary files a/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay.png and b/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay.png differ diff --git a/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay_transparent_pet.png b/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay_transparent_pet.png index 0467011e..aeb1b5ed 100644 Binary files a/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay_transparent_pet.png and b/src/main/resources/assets/notenoughupdates/armordisplay/armordisplay_transparent_pet.png differ diff --git a/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay.png b/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay.png index 7e15ccd5..3e21edda 100644 Binary files a/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay.png and b/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay.png differ diff --git a/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay_tab_completed.png b/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay_tab_completed.png index e6d5ccf0..b5cf62c0 100644 Binary files a/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay_tab_completed.png and b/src/main/resources/assets/notenoughupdates/auc_search/ah_search_overlay_tab_completed.png differ diff --git a/src/main/resources/assets/notenoughupdates/auction_profit.png b/src/main/resources/assets/notenoughupdates/auction_profit.png index 26a2bbc6..80e06c10 100644 Binary files a/src/main/resources/assets/notenoughupdates/auction_profit.png and b/src/main/resources/assets/notenoughupdates/auction_profit.png differ diff --git a/src/main/resources/assets/notenoughupdates/button_white.png b/src/main/resources/assets/notenoughupdates/button_white.png index d6460e89..7763716d 100644 Binary files a/src/main/resources/assets/notenoughupdates/button_white.png and b/src/main/resources/assets/notenoughupdates/button_white.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/dg_preview.png b/src/main/resources/assets/notenoughupdates/capes/dg_preview.png index bf9bad22..2e68d99d 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/dg_preview.png and b/src/main/resources/assets/notenoughupdates/capes/dg_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/fade.png b/src/main/resources/assets/notenoughupdates/capes/fade.png index 7ee247a6..d898ec4d 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/fade.png and b/src/main/resources/assets/notenoughupdates/capes/fade.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/fade_preview.png b/src/main/resources/assets/notenoughupdates/capes/fade_preview.png index 2a580336..fcb121e3 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/fade_preview.png and b/src/main/resources/assets/notenoughupdates/capes/fade_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/furf.png b/src/main/resources/assets/notenoughupdates/capes/furf.png index 74983e1f..a083a662 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/furf.png and b/src/main/resources/assets/notenoughupdates/capes/furf.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/furf_preview.png b/src/main/resources/assets/notenoughupdates/capes/furf_preview.png index 8f5dd5da..d65f8fbe 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/furf_preview.png and b/src/main/resources/assets/notenoughupdates/capes/furf_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/ironmoon.png b/src/main/resources/assets/notenoughupdates/capes/ironmoon.png index 2e3ebda1..b25221d9 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/ironmoon.png and b/src/main/resources/assets/notenoughupdates/capes/ironmoon.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/ironmoon_preview.png b/src/main/resources/assets/notenoughupdates/capes/ironmoon_preview.png index 242bec0e..c233128a 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/ironmoon_preview.png and b/src/main/resources/assets/notenoughupdates/capes/ironmoon_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/lava.png b/src/main/resources/assets/notenoughupdates/capes/lava.png index 71451cf2..8f60a03e 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/lava.png and b/src/main/resources/assets/notenoughupdates/capes/lava.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/mbstaff_preview.png b/src/main/resources/assets/notenoughupdates/capes/mbstaff_preview.png index 147491ef..0d9ad9eb 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/mbstaff_preview.png and b/src/main/resources/assets/notenoughupdates/capes/mbstaff_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/mcworld.png b/src/main/resources/assets/notenoughupdates/capes/mcworld.png index 562ab737..89b3b367 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/mcworld.png and b/src/main/resources/assets/notenoughupdates/capes/mcworld.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/packshq_preview.png b/src/main/resources/assets/notenoughupdates/capes/packshq_preview.png index 45c36da3..d69ff6c0 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/packshq_preview.png and b/src/main/resources/assets/notenoughupdates/capes/packshq_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/screensaver.png b/src/main/resources/assets/notenoughupdates/capes/screensaver.png index 024f5504..c6ce9e8c 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/screensaver.png and b/src/main/resources/assets/notenoughupdates/capes/screensaver.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/screensaver_preview.png b/src/main/resources/assets/notenoughupdates/capes/screensaver_preview.png index 35d0cdeb..a7d890f8 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/screensaver_preview.png and b/src/main/resources/assets/notenoughupdates/capes/screensaver_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch.png b/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch.png index a801e8c0..66314629 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch.png and b/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch_preview.png b/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch_preview.png index c8fb5204..2be61fee 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch_preview.png and b/src/main/resources/assets/notenoughupdates/capes/secondpfirsisch_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/sharex_white.png b/src/main/resources/assets/notenoughupdates/capes/sharex_white.png index c638e825..c7457897 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/sharex_white.png and b/src/main/resources/assets/notenoughupdates/capes/sharex_white.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/sharex_white_preview.png b/src/main/resources/assets/notenoughupdates/capes/sharex_white_preview.png index 0855c8d7..6ed14bd8 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/sharex_white_preview.png and b/src/main/resources/assets/notenoughupdates/capes/sharex_white_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/skyclient.png b/src/main/resources/assets/notenoughupdates/capes/skyclient.png index 62543232..8fa36038 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/skyclient.png and b/src/main/resources/assets/notenoughupdates/capes/skyclient.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/skyclient_preview.png b/src/main/resources/assets/notenoughupdates/capes/skyclient_preview.png index d8ad43f0..36140806 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/skyclient_preview.png and b/src/main/resources/assets/notenoughupdates/capes/skyclient_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/space.png b/src/main/resources/assets/notenoughupdates/capes/space.png index 0fd5c0a5..76d4a42c 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/space.png and b/src/main/resources/assets/notenoughupdates/capes/space.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/stormy_lh.png b/src/main/resources/assets/notenoughupdates/capes/stormy_lh.png index 201f31c5..aba13112 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/stormy_lh.png and b/src/main/resources/assets/notenoughupdates/capes/stormy_lh.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/stormy_lh_preview.png b/src/main/resources/assets/notenoughupdates/capes/stormy_lh_preview.png index e03a6379..6a9b43d0 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/stormy_lh_preview.png and b/src/main/resources/assets/notenoughupdates/capes/stormy_lh_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/subreddit_dark.png b/src/main/resources/assets/notenoughupdates/capes/subreddit_dark.png index 4daa66ca..83ae4223 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/subreddit_dark.png and b/src/main/resources/assets/notenoughupdates/capes/subreddit_dark.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/subreddit_light.png b/src/main/resources/assets/notenoughupdates/capes/subreddit_light.png index f32d1b02..a2af3c1d 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/subreddit_light.png and b/src/main/resources/assets/notenoughupdates/capes/subreddit_light.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/subreddit_light_preview.png b/src/main/resources/assets/notenoughupdates/capes/subreddit_light_preview.png index c9e3d636..d06a5c33 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/subreddit_light_preview.png and b/src/main/resources/assets/notenoughupdates/capes/subreddit_light_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/thebakery.png b/src/main/resources/assets/notenoughupdates/capes/thebakery.png index 8784cf63..8d4ca440 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/thebakery.png and b/src/main/resources/assets/notenoughupdates/capes/thebakery.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/thebakery_preview.png b/src/main/resources/assets/notenoughupdates/capes/thebakery_preview.png index eb3dbcd9..4d0a6b7e 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/thebakery_preview.png and b/src/main/resources/assets/notenoughupdates/capes/thebakery_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/void.png b/src/main/resources/assets/notenoughupdates/capes/void.png index 2c481444..d9f27e95 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/void.png and b/src/main/resources/assets/notenoughupdates/capes/void.png differ diff --git a/src/main/resources/assets/notenoughupdates/capes/void_preview.png b/src/main/resources/assets/notenoughupdates/capes/void_preview.png index a2914145..5bac3004 100644 Binary files a/src/main/resources/assets/notenoughupdates/capes/void_preview.png and b/src/main/resources/assets/notenoughupdates/capes/void_preview.png differ diff --git a/src/main/resources/assets/notenoughupdates/colour_selector_dot.png b/src/main/resources/assets/notenoughupdates/colour_selector_dot.png index 775c5290..1150c8bb 100644 Binary files a/src/main/resources/assets/notenoughupdates/colour_selector_dot.png and b/src/main/resources/assets/notenoughupdates/colour_selector_dot.png differ diff --git a/src/main/resources/assets/notenoughupdates/core/colour_selector_dot.png b/src/main/resources/assets/notenoughupdates/core/colour_selector_dot.png index 6dc8cc15..1150c8bb 100644 Binary files a/src/main/resources/assets/notenoughupdates/core/colour_selector_dot.png and b/src/main/resources/assets/notenoughupdates/core/colour_selector_dot.png differ diff --git a/src/main/resources/assets/notenoughupdates/custom_enchant_gui.png b/src/main/resources/assets/notenoughupdates/custom_enchant_gui.png index fe53d96d..735a3fb4 100644 Binary files a/src/main/resources/assets/notenoughupdates/custom_enchant_gui.png and b/src/main/resources/assets/notenoughupdates/custom_enchant_gui.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/10.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/10.png index a1935c97..6cd64ed1 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/10.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/10.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/11.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/11.png index f0471e28..65898e8f 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/11.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/11.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/2.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/2.png index 6d80fa08..6f0daba0 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/2.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/2.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/3.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/3.png index 4ed21c74..4c123e77 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/3.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/3.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/4.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/4.png index 3384e52f..833b9017 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/4.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/4.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/5.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/5.png index cb74af61..93bef87d 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/5.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/5.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/8.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/8.png index 9fb3d937..54db6fbc 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/8.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/8.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/9.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/9.png index 40b88826..c5fedff9 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/9.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/large/9.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/map_border_dragon_stone.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/map_border_dragon_stone.png index cb604e86..c79eee7f 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/map_border_dragon_stone.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/map_border_dragon_stone.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/10.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/10.png index ef623aec..4f4b1dc7 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/10.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/10.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/11.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/11.png index 132ccd97..3730ab57 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/11.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/11.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/3.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/3.png index a22cf178..68824d04 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/3.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/3.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/4.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/4.png index 51c59181..3b8776e7 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/4.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/4.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/5.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/5.png index a4625bf9..3a708494 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/5.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/5.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/8.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/8.png index 982477f9..c131badf 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/8.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/8.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/9.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/9.png index 723056e9..a42870f2 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/9.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/medium/9.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/10.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/10.png index 359eacf6..b9bcac1d 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/10.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/10.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/11.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/11.png index da1e28eb..2fdbe252 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/11.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/11.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/3.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/3.png index 92e441ea..fe0ba4b9 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/3.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/3.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/4.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/4.png index 5a8cb034..bd580c8e 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/4.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/4.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/5.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/5.png index 1dabecff..6f2bdc29 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/5.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/5.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/8.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/8.png index 055e99fb..5dd06a89 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/8.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/8.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/9.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/9.png index 199da5c7..1d275525 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/9.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/small/9.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/steampunk.png b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/steampunk.png index dbe35950..3d1c0833 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_map/borders/steampunk.png and b/src/main/resources/assets/notenoughupdates/dungeon_map/borders/steampunk.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_win/a.png b/src/main/resources/assets/notenoughupdates/dungeon_win/a.png index cfb3630d..85322946 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_win/a.png and b/src/main/resources/assets/notenoughupdates/dungeon_win/a.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_win/s.png b/src/main/resources/assets/notenoughupdates/dungeon_win/s.png index a1bf993c..a514f285 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_win/s.png and b/src/main/resources/assets/notenoughupdates/dungeon_win/s.png differ diff --git a/src/main/resources/assets/notenoughupdates/dungeon_win/splus.png b/src/main/resources/assets/notenoughupdates/dungeon_win/splus.png index 69aa0c75..732d30a3 100644 Binary files a/src/main/resources/assets/notenoughupdates/dungeon_win/splus.png and b/src/main/resources/assets/notenoughupdates/dungeon_win/splus.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style4/dynamic_54_slot_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style4/dynamic_54_slot_ctm.png index aa3f32fe..fa43a0ed 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style4/dynamic_54_slot_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style4/dynamic_54_slot_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_button_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_button_ctm.png index ee5a3b54..bab0eab7 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_button_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_button_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_slot_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_slot_ctm.png index 13c83e85..fa43a0ed 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_slot_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style5/dynamic_54_slot_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_button_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_button_ctm.png index 4ba59d9a..fa43a0ed 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_button_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_button_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_slot_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_slot_ctm.png index 3c91e846..fa43a0ed 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_slot_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style6/dynamic_54_slot_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_button_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_button_ctm.png index b8749675..ea57f0d0 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_button_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_button_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_slot_ctm.png b/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_slot_ctm.png index ff73398b..fa43a0ed 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_slot_ctm.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/style7/dynamic_54_slot_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_off.png b/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_off.png index 34fde767..7a1aa4a4 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_off.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_off.png differ diff --git a/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_on.png b/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_on.png index 55f0cf25..5f4960f9 100644 Binary files a/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_on.png and b/src/main/resources/assets/notenoughupdates/dynamic_54/toggle_on.png differ diff --git a/src/main/resources/assets/notenoughupdates/fishing_warning_exclam.png b/src/main/resources/assets/notenoughupdates/fishing_warning_exclam.png index 0e2078dc..914e86bf 100644 Binary files a/src/main/resources/assets/notenoughupdates/fishing_warning_exclam.png and b/src/main/resources/assets/notenoughupdates/fishing_warning_exclam.png differ diff --git a/src/main/resources/assets/notenoughupdates/fuel_bar.png b/src/main/resources/assets/notenoughupdates/fuel_bar.png index 1b2daa14..f15ab522 100644 Binary files a/src/main/resources/assets/notenoughupdates/fuel_bar.png and b/src/main/resources/assets/notenoughupdates/fuel_bar.png differ diff --git a/src/main/resources/assets/notenoughupdates/help.png b/src/main/resources/assets/notenoughupdates/help.png index 71501035..1a7ebb60 100644 Binary files a/src/main/resources/assets/notenoughupdates/help.png and b/src/main/resources/assets/notenoughupdates/help.png differ diff --git a/src/main/resources/assets/notenoughupdates/invbuttons/extraicons/settings.png b/src/main/resources/assets/notenoughupdates/invbuttons/extraicons/settings.png index dd65a6e4..481a0588 100644 Binary files a/src/main/resources/assets/notenoughupdates/invbuttons/extraicons/settings.png and b/src/main/resources/assets/notenoughupdates/invbuttons/extraicons/settings.png differ diff --git a/src/main/resources/assets/notenoughupdates/logo.png b/src/main/resources/assets/notenoughupdates/logo.png index 26d30ff6..c08a8991 100644 Binary files a/src/main/resources/assets/notenoughupdates/logo.png and b/src/main/resources/assets/notenoughupdates/logo.png differ diff --git a/src/main/resources/assets/notenoughupdates/on.png b/src/main/resources/assets/notenoughupdates/on.png index e3f0eee0..5520a661 100644 Binary files a/src/main/resources/assets/notenoughupdates/on.png and b/src/main/resources/assets/notenoughupdates/on.png differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_0.jpg index e777b0fc..27531695 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_1.jpg index 2564894c..5586cf8a 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_2.jpg index 7bf12754..78540079 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_3.jpg index a6c9c2fe..74bc8f23 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_4.jpg index d15749a6..cdf3fdde 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_day/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_night/panorama_5.jpg index 2f9aac53..f9e5ed40 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_1_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_1_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_0.jpg index ed3339e5..f1f6a028 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_1.jpg index 7452f9ef..882e20a2 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_2.jpg index aa988960..3ec9391f 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_3.jpg index df60e3ba..0c99863b 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_4.jpg index ddd78a06..92b62ab3 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_5.jpg index 45c635f9..169c36be 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_0.jpg index 74ce480c..cb60f6d3 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_3.jpg index 1aadb5ba..39a3b594 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/combat_3_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_0.jpg index 3cc6ec86..32f9f7bb 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_1.jpg index 7ed2a00e..ece00b29 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_3.jpg index 4715dacf..ed4af05e 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_4.jpg index 53449ffe..aca79dcf 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_5.jpg index a76500fe..398e21c9 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dark_auction/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_4.jpg index 8b21cd0c..75b6cd4e 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_5.jpg index e1562211..c5e99eac 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dungeon/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_4.jpg index 8b21cd0c..75b6cd4e 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_5.jpg index e1562211..c5e99eac 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dungeon_hub/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_0.jpg index 55ad8851..f6231245 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_1.jpg index bb0edeaa..286b3a38 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_2.jpg index ed6e4f58..c6fca879 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_3.jpg index ccea9cd2..01b2f816 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_4.jpg index 4c8e6249..a5c810fe 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_5.jpg index 803f43f4..30d32a08 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_0.jpg index 39080e08..b1fb3e84 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_1.jpg index 3167ff3a..f7642beb 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_2.jpg index dd39c253..3cb3b42f 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_3.jpg index 656700da..a98d7672 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_4.jpg index 4cfc6d34..ad2b8c70 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_5.jpg index b47d9b7f..f2e93cde 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/dynamic_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_0.jpg index 302b60b8..c03b849d 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_1.jpg index a35a3ff8..2286407b 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_2.jpg index 6121cbcf..62127f51 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_3.jpg index 139dcceb..fe631d89 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_4.jpg index e9de5bf8..cf835eea 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_5.jpg index 29304f3c..879b5747 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_0.jpg index fac794d6..265515f6 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_1.jpg index 7b526d60..e774ca7a 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_2.jpg index d3cbe633..1e3c8a98 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_3.jpg index 259bd3d6..7833eb89 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_5.jpg index e1f41379..ae3bdbdf 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_1_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_0.jpg index 009684ce..e03657af 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_2.jpg index 3fb00305..c83f2c91 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_3.jpg index 1ae90a23..9b730712 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_5.jpg index f98a25e2..a17337b9 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_0.jpg index e893b436..26909780 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_3.jpg index 33512fe1..0e870f38 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_5.jpg index ddc7820f..f40c330c 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/farming_2_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_0.jpg index 6ff184ff..9a12896f 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_1.jpg index f0133647..c157ccdd 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_2.jpg index bdb4e055..ecee024b 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_3.jpg index 42d45a9c..0dbef91f 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_4.jpg index 2bc73a30..681aa33e 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_5.jpg index 160f84c6..6be866d2 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_0.jpg index 1631924e..050e4f78 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_3.jpg index 8647d5ee..3af3638e 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_5.jpg index 4bac20d8..d3c13992 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/foraging_1_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_0.jpg index e61f7c12..0d5f26dd 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_1.jpg index 3e97f3c0..820b92a4 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_2.jpg index 141a4fcf..14d01dd1 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_3.jpg index 570da076..bfc66ec9 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_5.jpg index cafeb1dd..f3df82a5 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_0.jpg index 988c7cdb..34bc84db 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_1.jpg index 0ef7e0a2..742d158b 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_2.jpg index 1d3f8d11..abf0a253 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_3.jpg index aebc2b4e..7efc75d6 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_5.jpg index 3159658d..e86e93c4 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/hub_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_0.jpg index 7872a822..e0c4288d 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_1.jpg index 40c1b8bf..e0cc8139 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_2.jpg index 2586dec8..381912e1 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_3.jpg index 7d4a23a4..0beaf628 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_4.jpg index befb2875..26417482 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_5.jpg index 2e2d1700..8571b288 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_day/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_0.jpg index 3045fbc5..e90efd5f 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_1.jpg index 6e04d738..603f9d04 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_3.jpg index 1d87c269..abd201d1 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_5.jpg index 67b0c1a0..93a5a26d 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/mining_1_night/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_0.jpg b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_0.jpg index 3c579656..9482df80 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_0.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_1.jpg b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_1.jpg index 5d38a803..1b4235dd 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_1.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_2.jpg b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_2.jpg index 46465f71..2f1fcc06 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_2.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_3.jpg b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_3.jpg index 39eb8c7e..ce20d9b5 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_3.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_4.jpg b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_4.jpg index 67cd1ecf..3dcdac57 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_4.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_5.jpg b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_5.jpg index fe839f66..45f65c7c 100644 Binary files a/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_5.jpg and b/src/main/resources/assets/notenoughupdates/panoramas/unknown/panorama_5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_dark.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_dark.png index d231bd86..27abd2d5 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_dark.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_dark.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_fsr.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_fsr.png index d179fa42..39782b3f 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_fsr.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_fsr.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_phqdark.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_phqdark.png index d33dac25..83b78351 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_phqdark.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_phqdark.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_transparent.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_transparent.png index 6e9f1928..f1bebc01 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_transparent.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplayarmor_transparent.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo.png index 9f4f712e..c047d5ad 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_dark.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_dark.png index c43b5fdb..6ad6216c 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_dark.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_dark.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_fsr.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_fsr.png index 795ba881..f39235af 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_fsr.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_fsr.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_phqdark.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_phqdark.png index 41fa8bc1..80566c92 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_phqdark.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_phqdark.png differ diff --git a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_transparent.png b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_transparent.png index 2364318f..dfe92b74 100644 Binary files a/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_transparent.png and b/src/main/resources/assets/notenoughupdates/petdisplay/petdisplaysolo_transparent.png differ diff --git a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui.png b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui.png index d84526ca..633be870 100644 Binary files a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui.png and b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui.png differ diff --git a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_dark.png b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_dark.png index d70fc7dc..0f7743e6 100644 Binary files a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_dark.png and b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_dark.png differ diff --git a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_fsr.png b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_fsr.png index 36921193..e98bdb7d 100644 Binary files a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_fsr.png and b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_fsr.png differ diff --git a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_phqdark.png b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_phqdark.png index 893d2716..f794319f 100644 Binary files a/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_phqdark.png and b/src/main/resources/assets/notenoughupdates/price_graph_gui/price_information_gui_phqdark.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_basic.png b/src/main/resources/assets/notenoughupdates/pv_basic.png index 1c46a8e4..4d5236f5 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_basic.png and b/src/main/resources/assets/notenoughupdates/pv_basic.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_bestiary_tab.png b/src/main/resources/assets/notenoughupdates/pv_bestiary_tab.png index eed9a72b..620c156b 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_bestiary_tab.png and b/src/main/resources/assets/notenoughupdates/pv_bestiary_tab.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_bingo_tab.png b/src/main/resources/assets/notenoughupdates/pv_bingo_tab.png index 56046537..135035cf 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_bingo_tab.png and b/src/main/resources/assets/notenoughupdates/pv_bingo_tab.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_elements.png b/src/main/resources/assets/notenoughupdates/pv_elements.png index 2a6cd1c2..7e9033bd 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_elements.png and b/src/main/resources/assets/notenoughupdates/pv_elements.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_invs.png b/src/main/resources/assets/notenoughupdates/pv_invs.png index c25ce499..46c7b0e9 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_invs.png and b/src/main/resources/assets/notenoughupdates/pv_invs.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_mining.png b/src/main/resources/assets/notenoughupdates/pv_mining.png index 226c7e40..a183fe88 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_mining.png and b/src/main/resources/assets/notenoughupdates/pv_mining.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_trophy_fish_tab.png b/src/main/resources/assets/notenoughupdates/pv_trophy_fish_tab.png index 47ac6928..d42446c1 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_trophy_fish_tab.png and b/src/main/resources/assets/notenoughupdates/pv_trophy_fish_tab.png differ diff --git a/src/main/resources/assets/notenoughupdates/pv_unknown.png b/src/main/resources/assets/notenoughupdates/pv_unknown.png index 0c282ac7..d6ce3a00 100644 Binary files a/src/main/resources/assets/notenoughupdates/pv_unknown.png and b/src/main/resources/assets/notenoughupdates/pv_unknown.png differ diff --git a/src/main/resources/assets/notenoughupdates/settings.png b/src/main/resources/assets/notenoughupdates/settings.png index c81d4c18..481a0588 100644 Binary files a/src/main/resources/assets/notenoughupdates/settings.png and b/src/main/resources/assets/notenoughupdates/settings.png differ diff --git a/src/main/resources/assets/notenoughupdates/slotlocking/bound.png b/src/main/resources/assets/notenoughupdates/slotlocking/bound.png index 8ff435b3..1631d386 100644 Binary files a/src/main/resources/assets/notenoughupdates/slotlocking/bound.png and b/src/main/resources/assets/notenoughupdates/slotlocking/bound.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.png index 12f613ff..da1461be 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_0.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.png index 5c0e8175..3ff29ff1 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_1.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.png index 8ceeb6c3..16150a20 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_2.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.png index 74d9820d..755dc865 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_3.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_pane_ctm.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_pane_ctm.png index 56a1c8ef..429e7a28 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_pane_ctm.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_gui_pane_ctm.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png index 9dec164f..be569369 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_icons.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_0.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_0.png index dcce08b4..faa30c96 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_0.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_0.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_1.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_1.png index bb23232d..00ed9488 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_1.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_1.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_2.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_2.png index ddaf339c..89fe7b15 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_2.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_2.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_3.png b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_3.png index 2d23ee4a..7ead5a79 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_3.png and b/src/main/resources/assets/notenoughupdates/storage_gui/storage_preview_3.png differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/0.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/0.jpg index ef225dba..48d7a47f 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/0.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/0.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/1.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/1.jpg index 363bc4ab..ace0d1a0 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/1.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/1.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/10.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/10.jpg index 82f66718..afed0c9b 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/10.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/10.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/11.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/11.jpg index 9baa4531..0b03bbfb 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/11.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/11.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/12.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/12.jpg index fea92c09..b7142650 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/12.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/12.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/13.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/13.jpg index 4a220319..8e62f742 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/13.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/13.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/14.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/14.jpg index b50fb7cf..6f296154 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/14.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/14.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/15.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/15.jpg index 15fa28f9..682aae45 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/15.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/15.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/16.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/16.jpg index b6bd773a..ea4efa72 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/16.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/16.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/17.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/17.jpg index 7046b122..9be04bea 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/17.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/17.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/18.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/18.jpg index 1429548a..d2f1e372 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/18.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/18.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/2.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/2.jpg index 5050048b..11598aec 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/2.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/2.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/3.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/3.jpg index 468278b8..6c8a53e7 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/3.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/3.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/4.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/4.jpg index 7d29bf3d..c78a311f 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/4.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/4.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/5.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/5.jpg index 4277a767..48080f68 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/5.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/5.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/6.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/6.jpg index bbe597d7..382082e2 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/6.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/6.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/7.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/7.jpg index 8f311a6d..7f3576fe 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/7.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/7.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/8.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/8.jpg index d7c97663..de065e28 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/8.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/8.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/9.jpg b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/9.jpg index 39da193a..29fdfc1b 100644 Binary files a/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/9.jpg and b/src/main/resources/assets/notenoughupdates/storage_gui/we_do_a_little_rolling/9.jpg differ diff --git a/src/main/resources/assets/notenoughupdates/supersecretassets/bald.png b/src/main/resources/assets/notenoughupdates/supersecretassets/bald.png index 7b407117..4f730a44 100644 Binary files a/src/main/resources/assets/notenoughupdates/supersecretassets/bald.png and b/src/main/resources/assets/notenoughupdates/supersecretassets/bald.png differ diff --git a/src/main/resources/assets/notenoughupdates/supersecretassets/lunar.png b/src/main/resources/assets/notenoughupdates/supersecretassets/lunar.png index 469d96b8..7de98284 100644 Binary files a/src/main/resources/assets/notenoughupdates/supersecretassets/lunar.png and b/src/main/resources/assets/notenoughupdates/supersecretassets/lunar.png differ diff --git a/src/main/resources/assets/notenoughupdates/textures/gui/forge_recipe_tall.png b/src/main/resources/assets/notenoughupdates/textures/gui/forge_recipe_tall.png index d89260db..cdd8b0f1 100644 Binary files a/src/main/resources/assets/notenoughupdates/textures/gui/forge_recipe_tall.png and b/src/main/resources/assets/notenoughupdates/textures/gui/forge_recipe_tall.png differ diff --git a/src/main/resources/assets/notenoughupdates/textures/gui/item_shop_recipe.png b/src/main/resources/assets/notenoughupdates/textures/gui/item_shop_recipe.png index 9226529a..e78c0f44 100644 Binary files a/src/main/resources/assets/notenoughupdates/textures/gui/item_shop_recipe.png and b/src/main/resources/assets/notenoughupdates/textures/gui/item_shop_recipe.png differ diff --git a/src/main/resources/assets/notenoughupdates/textures/gui/navigation.png b/src/main/resources/assets/notenoughupdates/textures/gui/navigation.png index fc85046f..628f3a47 100644 Binary files a/src/main/resources/assets/notenoughupdates/textures/gui/navigation.png and b/src/main/resources/assets/notenoughupdates/textures/gui/navigation.png differ diff --git a/src/main/resources/assets/notenoughupdates/textures/gui/villager_recipe_tall.png b/src/main/resources/assets/notenoughupdates/textures/gui/villager_recipe_tall.png index f22f28ee..8cb89bae 100644 Binary files a/src/main/resources/assets/notenoughupdates/textures/gui/villager_recipe_tall.png and b/src/main/resources/assets/notenoughupdates/textures/gui/villager_recipe_tall.png differ -- cgit From 796f1a24d058ab49e9ef5e9fc3a30817c79950dd Mon Sep 17 00:00:00 2001 From: efefury <69400149+efefury@users.noreply.github.com> Date: Tue, 4 Oct 2022 12:18:31 +0000 Subject: no more kicking i think (#335) Co-authored-by: nopo --- .../github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java index f708fb5f..a24f4c84 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java @@ -362,7 +362,11 @@ public abstract class MixinGuiContainer extends GuiScreen { BetterContainers.clickSlot(slotIn.getSlotIndex()); if (BetterContainers.isBlankStack(slotIn.slotNumber, slotIn.getStack())) { - $this.mc.playerController.windowClick($this.inventorySlots.windowId, slotId, 2, clickType, $this.mc.thePlayer); + GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); + Minecraft.getMinecraft().playerController.windowClick( + chest.inventorySlots.windowId, + slotId, 2, 3, Minecraft.getMinecraft().thePlayer + ); ci.cancel(); } else { Utils.playPressSound(); -- cgit From f96aa66096b87744d4d400a63c7a6c1a813cde22 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Tue, 4 Oct 2022 15:07:11 +0200 Subject: Do not read the pr description (#336) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../notenoughupdates/NotEnoughUpdates.java | 2 - .../miscfeatures/BazaarSacksProfit.java | 200 --------------------- .../options/seperateSections/BazaarTweaks.java | 8 - 3 files changed, 210 deletions(-) delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index b06f2ab2..efd45b3c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -36,7 +36,6 @@ import io.github.moulberry.notenoughupdates.listener.NEUEventListener; import io.github.moulberry.notenoughupdates.listener.OldAnimationChecker; import io.github.moulberry.notenoughupdates.listener.RenderListener; import io.github.moulberry.notenoughupdates.miscfeatures.AuctionProfit; -import io.github.moulberry.notenoughupdates.miscfeatures.BazaarSacksProfit; import io.github.moulberry.notenoughupdates.miscfeatures.CrystalOverlay; import io.github.moulberry.notenoughupdates.miscfeatures.CrystalWishingCompassSolver; import io.github.moulberry.notenoughupdates.miscfeatures.CustomItemEffects; @@ -298,7 +297,6 @@ public class NotEnoughUpdates { MinecraftForge.EVENT_BUS.register(new SignCalculator()); MinecraftForge.EVENT_BUS.register(TrophyRewardOverlay.getInstance()); MinecraftForge.EVENT_BUS.register(PowerStoneStatsDisplay.getInstance()); - MinecraftForge.EVENT_BUS.register(BazaarSacksProfit.getInstance()); MinecraftForge.EVENT_BUS.register(navigation); if (Minecraft.getMinecraft().getResourceManager() instanceof IReloadableResourceManager) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java deleted file mode 100644 index 9ab85390..00000000 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BazaarSacksProfit.java +++ /dev/null @@ -1,200 +0,0 @@ -/* - * Copyright (C) 2022 NotEnoughUpdates contributors - * - * This file is part of NotEnoughUpdates. - * - * NotEnoughUpdates is free software: you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - * - * NotEnoughUpdates is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with NotEnoughUpdates. If not, see . - */ - -package io.github.moulberry.notenoughupdates.miscfeatures; - -import com.google.gson.JsonObject; -import io.github.moulberry.notenoughupdates.NotEnoughUpdates; -import io.github.moulberry.notenoughupdates.core.util.StringUtils; -import io.github.moulberry.notenoughupdates.miscgui.TrophyRewardOverlay; -import io.github.moulberry.notenoughupdates.util.ItemUtils; -import net.minecraft.client.Minecraft; -import net.minecraft.inventory.Container; -import net.minecraft.inventory.ContainerChest; -import net.minecraft.item.ItemStack; -import net.minecraftforge.client.event.GuiOpenEvent; -import net.minecraftforge.event.entity.player.ItemTooltipEvent; -import net.minecraftforge.fml.common.eventhandler.EventPriority; -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import org.lwjgl.input.Keyboard; - -import java.text.DecimalFormat; -import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; - -public class BazaarSacksProfit { - - private static BazaarSacksProfit INSTANCE = null; - private boolean showSellOrderPrice = false; - private boolean pressedShiftLast = false; - - public static BazaarSacksProfit getInstance() { - if (INSTANCE == null) { - INSTANCE = new BazaarSacksProfit(); - } - return INSTANCE; - } - - private final Map prices = new HashMap<>(); - private final Map names = new HashMap<>(); - private final List invalidNames = new ArrayList<>(); - private boolean dirty = true; - - @SubscribeEvent - public void onGuiOpen(GuiOpenEvent event) { - showSellOrderPrice = false; - dirty = true; - } - - @SubscribeEvent(priority = EventPriority.LOW) - public void onItemTooltipLow(ItemTooltipEvent event) { - if (!NotEnoughUpdates.INSTANCE.config.bazaarTweaks.bazaarSacksProfit) return; - if (!inBazaar()) return; - - ItemStack itemStack = event.itemStack; - String displayName = itemStack.getDisplayName(); - if (!displayName.equals("§bSell Sacks Now")) return; - - boolean shift = Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) || Keyboard.isKeyDown(Keyboard.KEY_RSHIFT); - if (!pressedShiftLast && shift) { - showSellOrderPrice = !showSellOrderPrice; - } - pressedShiftLast = shift; - - if (dirty) { - dirty = false; - prices.clear(); - names.clear(); - invalidNames.clear(); - - out: - for (String line : ItemUtils.getLore(itemStack)) { - - if (line.equals("§8Loading...")) { - dirty = true; - return; - } - if (line.contains("§7x ")) { - String[] split = line.split("§7x "); - String rawAmount = StringUtils.cleanColour(split[0]).replace(",", "").substring(1); - int amount = Integer.parseInt(rawAmount); - String bazaarName = split[1].split(" §7for")[0]; - for (Map.Entry entry : NotEnoughUpdates.INSTANCE.manager - .getItemInformation() - .entrySet()) { - String internalName = entry.getKey(); - - // Ignoring builder melon, builder clay and builder cactus - if (NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(internalName) == null) continue; - - JsonObject object = entry.getValue(); - if (object.has("displayname")) { - String name = object.get("displayname").getAsString(); - if (name.equals(bazaarName)) { - prices.put(internalName, amount); - names.put(internalName, bazaarName); - continue out; - } - } - } - System.err.println("no bazaar item in repo found for '" + bazaarName + "'"); - invalidNames.add(bazaarName); - } - } - } - - event.toolTip.removeIf(line -> line.contains("§7x ") || line.contains("You earn:")); - - Map map = new HashMap<>(); - DecimalFormat formatter = (DecimalFormat) NumberFormat.getNumberInstance(Locale.ENGLISH); - formatter.applyPattern("#,##0"); - double totalPrice = 0; - for (Map.Entry entry : prices.entrySet()) { - String internalName = entry.getKey(); - int amount = entry.getValue(); - String name = names.get(internalName); - - JsonObject bazaarInfo = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(internalName); - - float price = 0; - if (bazaarInfo != null) { - - if (showSellOrderPrice) { - if (bazaarInfo.has("curr_buy")) { - price = bazaarInfo.get("curr_buy").getAsFloat(); - } else { - System.err.println("curr_sell does not exist for '" + internalName + "'"); - } - } else { - if (bazaarInfo.has("curr_sell")) { - price = bazaarInfo.get("curr_sell").getAsFloat(); - } else { - System.err.println("curr_sell does not exist for '" + internalName + "'"); - } - } - } - float extraPrice = price * amount; - String priceFormat = formatter.format(extraPrice); - totalPrice += extraPrice; - map.put("§a" + formatter.format(amount) + "§7x §f" + name + " §7for §6" + priceFormat + " coins", extraPrice); - } - - event.toolTip.add(4, ""); - if (showSellOrderPrice) { - event.toolTip.add(4, "§7Sell order price: §6" + formatter.format(totalPrice)); - } else { - event.toolTip.add(4, "§7Instant sell price: §6" + formatter.format(totalPrice)); - } - - event.toolTip.add(4, ""); - event.toolTip.removeIf(line -> line.equals("§5§o")); - int index = 4; - for (String name : invalidNames) { - index++; - event.toolTip.add(4, name + " §c[NEU] Missing Repo data!"); - } - for (String text : TrophyRewardOverlay.sortByValue(map).keySet()) { - index++; - event.toolTip.add(4, text); - } - event.toolTip.add(index, ""); - - if (!showSellOrderPrice) { - event.toolTip.add("§8[Press SHIFT to show sell order price]"); - } else { - event.toolTip.add("§8[Press SHIFT to show instant sell price]"); - } - } - - public static boolean inBazaar() { - if (!NotEnoughUpdates.INSTANCE.isOnSkyblock()) return false; - - Minecraft minecraft = Minecraft.getMinecraft(); - if (minecraft == null || minecraft.thePlayer == null) return false; - - Container inventoryContainer = minecraft.thePlayer.openContainer; - if (!(inventoryContainer instanceof ContainerChest)) return false; - ContainerChest containerChest = (ContainerChest) inventoryContainer; - return containerChest.getLowerChestInventory().getDisplayName().getUnformattedText().startsWith("Bazaar "); - } -} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/BazaarTweaks.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/BazaarTweaks.java index 2ba0b718..954af02d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/BazaarTweaks.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/BazaarTweaks.java @@ -70,12 +70,4 @@ public class BazaarTweaks { @ConfigEditorBoolean @ConfigAccordionId(id = 0) public boolean escFullClose = true; - - @Expose - @ConfigOption( - name = "Bazaar Sacks Profit", - desc = "Orders the items in your sacks in the bazaar inventory and adding buy order toggle" - ) - @ConfigEditorBoolean - public boolean bazaarSacksProfit = true; } -- cgit From 6f44a62fa9fde32e3ecdefa459a64822ba00a43d Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 5 Oct 2022 00:13:04 +1100 Subject: Changed the pet overlay to use spaces instead of "-" (#326) --- .../github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java | 1 - .../java/io/github/moulberry/notenoughupdates/util/ItemUtils.java | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java index e6e8cb3b..5cd8f6b3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/EquipmentOverlay.java @@ -140,7 +140,6 @@ public class EquipmentOverlay { public static final int PET_OVERLAY_OFFSET_Y = ARMOR_OVERLAY_HEIGHT - 14 /* overlaying pixels */; // - public boolean isRenderingPet; public boolean shouldRenderPets; public boolean shouldRenderArmorHud; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java index c6bc7538..8b81d1b4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java @@ -369,9 +369,9 @@ public class ItemUtils { if (j < (levelPercent / 5)) { sb.append(EnumChatFormatting.DARK_GREEN); } else { - sb.append(EnumChatFormatting.GRAY); + sb.append(EnumChatFormatting.WHITE); } - sb.append("-"); + sb.append(EnumChatFormatting.BOLD + "" + EnumChatFormatting.STRIKETHROUGH + " "); } newLore.appendTag(new NBTTagString(sb.toString())); newLore.appendTag(new NBTTagString( -- cgit From 34d049d2611dab85f6fee6c2f13a51e8f8e284bd Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Tue, 4 Oct 2022 15:13:43 +0200 Subject: Translate Hypixel to NEU ids (#332) --- .../io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java index 4d3b4645..3692602a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemResolutionQuery.java @@ -274,7 +274,7 @@ public class ItemResolutionQuery { private String resolveFromSkyblock() { String internalName = getExtraAttributes().getString("id"); if (internalName == null || internalName.isEmpty()) return null; - return internalName.toUpperCase(Locale.ROOT); + return internalName.toUpperCase(Locale.ROOT).replace(':', '-'); } // -- cgit From 7b647deee3d37847f2ca2a6895d837748800c6b6 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 5 Oct 2022 12:51:23 +1100 Subject: fix hollows solver with turkey (#340) *maybe* fix hollows solver with turkey --- .../notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java index 07f19a60..0ee29b4f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CrystalWishingCompassSolver.java @@ -47,6 +47,7 @@ import java.util.ArrayDeque; import java.util.ArrayList; import java.util.EnumSet; import java.util.HashMap; +import java.util.Locale; import java.util.function.BooleanSupplier; import java.util.function.LongSupplier; @@ -509,7 +510,7 @@ public class CrystalWishingCompassSolver { for (String crystalName : crystals.keySet()) { Integer crystalState = crystals.get(crystalName); if (crystalState != null && crystalState > 0) { - foundCrystals.add(Crystal.valueOf(crystalName.toUpperCase())); + foundCrystals.add(Crystal.valueOf(crystalName.toUpperCase(Locale.US).replace("İ", "I"))); } } -- cgit From 61513e20063d8997ba8a6d0cd7f34ef4ca29cdb6 Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Wed, 5 Oct 2022 04:46:26 +0200 Subject: EnchantingSolvers.java (#341) * EnchantingSolvers.java * remove println * register bin overlay Co-authored-by: nopo --- .../notenoughupdates/NotEnoughUpdates.java | 8 ++ .../notenoughupdates/events/SlotClickEvent.java | 51 +++++++ .../miscfeatures/AbiphoneWarning.java | 25 ++-- .../notenoughupdates/miscfeatures/AntiCoopAdd.java | 32 ++--- .../miscfeatures/AuctionBINWarning.java | 110 +++++++-------- .../miscfeatures/BetterContainers.java | 15 ++ .../miscfeatures/EnchantingSolvers.java | 155 ++++++++++----------- .../miscfeatures/PetInfoOverlay.java | 16 ++- .../notenoughupdates/miscfeatures/SlotLocking.java | 66 +++++---- .../notenoughupdates/mixins/MixinGuiChest.java | 2 +- .../notenoughupdates/mixins/MixinGuiContainer.java | 82 ++--------- 11 files changed, 291 insertions(+), 271 deletions(-) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/events/SlotClickEvent.java diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index efd45b3c..7175c7e8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -35,7 +35,11 @@ import io.github.moulberry.notenoughupdates.listener.ItemTooltipRngListener; import io.github.moulberry.notenoughupdates.listener.NEUEventListener; import io.github.moulberry.notenoughupdates.listener.OldAnimationChecker; import io.github.moulberry.notenoughupdates.listener.RenderListener; +import io.github.moulberry.notenoughupdates.miscfeatures.AbiphoneWarning; +import io.github.moulberry.notenoughupdates.miscfeatures.AntiCoopAdd; +import io.github.moulberry.notenoughupdates.miscfeatures.AuctionBINWarning; import io.github.moulberry.notenoughupdates.miscfeatures.AuctionProfit; +import io.github.moulberry.notenoughupdates.miscfeatures.BetterContainers; import io.github.moulberry.notenoughupdates.miscfeatures.CrystalOverlay; import io.github.moulberry.notenoughupdates.miscfeatures.CrystalWishingCompassSolver; import io.github.moulberry.notenoughupdates.miscfeatures.CustomItemEffects; @@ -297,6 +301,10 @@ public class NotEnoughUpdates { MinecraftForge.EVENT_BUS.register(new SignCalculator()); MinecraftForge.EVENT_BUS.register(TrophyRewardOverlay.getInstance()); MinecraftForge.EVENT_BUS.register(PowerStoneStatsDisplay.getInstance()); + MinecraftForge.EVENT_BUS.register(new AntiCoopAdd()); + MinecraftForge.EVENT_BUS.register(AbiphoneWarning.getInstance()); + MinecraftForge.EVENT_BUS.register(new BetterContainers()); + MinecraftForge.EVENT_BUS.register(AuctionBINWarning.getInstance()); MinecraftForge.EVENT_BUS.register(navigation); if (Minecraft.getMinecraft().getResourceManager() instanceof IReloadableResourceManager) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/events/SlotClickEvent.java b/src/main/java/io/github/moulberry/notenoughupdates/events/SlotClickEvent.java new file mode 100644 index 00000000..13c31b54 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/events/SlotClickEvent.java @@ -0,0 +1,51 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.events; + +import net.minecraft.client.gui.inventory.GuiContainer; +import net.minecraft.inventory.Slot; +import net.minecraftforge.fml.common.eventhandler.Cancelable; + +@Cancelable +public class SlotClickEvent extends NEUEvent { + public final GuiContainer guiContainer; + public final Slot slot; + public final int slotId; + public int clickedButton; + public int clickType; + public boolean usePickblockInstead = false; + + public SlotClickEvent(GuiContainer guiContainer, Slot slot, int slotId, int clickedButton, int clickType) { + this.guiContainer = guiContainer; + this.slot = slot; + this.slotId = slotId; + this.clickedButton = clickedButton; + this.clickType = clickType; + } + + public void usePickblockInstead() { + usePickblockInstead = true; + } + + @Override + public void setCanceled(boolean cancel) { + super.setCanceled(cancel); + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java index 254c891a..67ac4f4c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java @@ -23,6 +23,7 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.GuiElement; import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; import io.github.moulberry.notenoughupdates.core.util.render.TextRenderUtils; +import io.github.moulberry.notenoughupdates.events.SlotClickEvent; import io.github.moulberry.notenoughupdates.util.ItemUtils; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; @@ -33,6 +34,7 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @@ -68,29 +70,28 @@ public class AbiphoneWarning extends GuiElement { return shouldPerformCheck() && showWarning; } - public boolean onMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType) { - if (!shouldPerformCheck()) return false; - if (!NotEnoughUpdates.INSTANCE.config.misc.abiphoneWarning) return false; - if (slotId == -999) return false; - if (clickedButton == 0) return false; + @SubscribeEvent + public void onMouseClick(SlotClickEvent event) { + if (!shouldPerformCheck()) return; + if (!NotEnoughUpdates.INSTANCE.config.misc.abiphoneWarning) return; + if (event.slotId == -999) return; + if (event.clickedButton == 0) return; GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; - ItemStack clickedContact = chest.inventorySlots.getSlot(slotId).getStack(); - if (clickedContact == null) return false; + ItemStack clickedContact = chest.inventorySlots.getSlot(event.slotId).getStack(); + if (clickedContact == null) return; List list = ItemUtils.getLore(clickedContact); - if (list.isEmpty()) return false; + if (list.isEmpty()) return; String last = list.get(list.size() - 1); if (last.contains("Right-click to remove contact!")) { showWarning = true; contactName = clickedContact.getDisplayName(); - contactSlot = slotId; - return true; + contactSlot = event.slotId; + event.setCanceled(true); } - - return false; } public void overrideIsMouseOverSlot(Slot slot, int mouseX, int mouseY, CallbackInfoReturnable cir) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AntiCoopAdd.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AntiCoopAdd.java index 25aaaa0a..70ac4489 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AntiCoopAdd.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AntiCoopAdd.java @@ -20,43 +20,43 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.events.SlotClickEvent; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; -import net.minecraft.client.gui.inventory.GuiChest; import net.minecraft.event.ClickEvent; import net.minecraft.event.HoverEvent; import net.minecraft.init.Items; -import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; public class AntiCoopAdd { - public static boolean onMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType) { - if (!NotEnoughUpdates.INSTANCE.config.misc.coopWarning) return false; - if (slotId == -999) return false; - if (!Utils.getOpenChestName().contains("Profile")) return false; + @SubscribeEvent + public void onMouseClick(SlotClickEvent event) { + if (!NotEnoughUpdates.INSTANCE.config.misc.coopWarning) return; + if (event.slotId == -999) return; + if (!Utils.getOpenChestName().contains("Profile")) return; - GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; - - ItemStack stack = chest.inventorySlots.getSlot(slotId).getStack(); - if (stack == null) return false; - if (stack.getItem() == Items.diamond && stack.getDisplayName() != null && stack.getDisplayName().contains("Co-op Request")) { + ItemStack stack = event.slot.getStack(); + if (stack == null) return; + if (stack.getItem() == Items.diamond && stack.getDisplayName() != null && stack.getDisplayName().contains( + "Co-op Request")) { String ign = Utils.getOpenChestName().split("'s Profile")[0]; ChatComponentText storageMessage = new ChatComponentText( EnumChatFormatting.YELLOW + "[NEU] " + EnumChatFormatting.YELLOW + "You just clicked on the Co-op add button. If you want to coop add this person, click this chat message"); storageMessage.setChatStyle(Utils.createClickStyle(ClickEvent.Action.RUN_COMMAND, "/coopadd " + ign)); storageMessage.setChatStyle(storageMessage.getChatStyle().setChatHoverEvent( - new HoverEvent(HoverEvent.Action.SHOW_TEXT, - new ChatComponentText(EnumChatFormatting.YELLOW + "Click to add " + ign + " to your coop")))); + new HoverEvent( + HoverEvent.Action.SHOW_TEXT, + new ChatComponentText(EnumChatFormatting.YELLOW + "Click to add " + ign + " to your coop") + ))); ChatComponentText storageChatMessage = new ChatComponentText(""); storageChatMessage.appendSibling(storageMessage); Minecraft.getMinecraft().thePlayer.addChatMessage(storageChatMessage); - return true; + event.setCanceled(true); } - - return false; } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java index 3bd674dd..ad9df7af 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java @@ -24,6 +24,7 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.GuiElement; import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; import io.github.moulberry.notenoughupdates.core.util.render.TextRenderUtils; +import io.github.moulberry.notenoughupdates.events.SlotClickEvent; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.Gui; @@ -33,6 +34,7 @@ import net.minecraft.client.renderer.GlStateManager; import net.minecraft.inventory.Slot; import net.minecraft.item.ItemStack; import net.minecraft.util.EnumChatFormatting; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; @@ -79,75 +81,73 @@ public class AuctionBINWarning extends GuiElement { return shouldPerformCheck() && showWarning; } - public boolean onMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType) { - if (!shouldPerformCheck()) return false; + @SubscribeEvent + public void onMouseClick(SlotClickEvent event) { + if (!shouldPerformCheck()) return; - if (slotId == 29) { - GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; + if (event.slotId != 29) { + return; + } - sellingPrice = -1; + sellingPrice = -1; - ItemStack priceStack = chest.inventorySlots.getSlot(31).getStack(); - if (priceStack != null) { - String displayName = priceStack.getDisplayName(); - Matcher priceMatcher = ITEM_PRICE_REGEX.matcher(displayName); + ItemStack priceStack = event.guiContainer.inventorySlots.getSlot(31).getStack(); + if (priceStack != null) { + String displayName = priceStack.getDisplayName(); + Matcher priceMatcher = ITEM_PRICE_REGEX.matcher(displayName); - if (priceMatcher.matches()) { - try { - sellingPrice = Long.parseLong(priceMatcher.group(1).replace(",", "")); - } catch (NumberFormatException ignored) { - } + if (priceMatcher.matches()) { + try { + sellingPrice = Long.parseLong(priceMatcher.group(1).replace(",", "")); + } catch (NumberFormatException ignored) { } } + } - ItemStack sellStack = chest.inventorySlots.getSlot(13).getStack(); - String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(sellStack); - sellStackAmount = sellStack.stackSize; + ItemStack sellStack = event.guiContainer.inventorySlots.getSlot(13).getStack(); + String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(sellStack); + sellStackAmount = sellStack.stackSize; - if (internalname == null) { - return false; - } + if (internalname == null) { + return; + } - JsonObject itemInfo = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(internalname); - if (itemInfo == null || !itemInfo.has("displayname")) { - sellingName = internalname; - } else { - sellingName = itemInfo.get("displayname").getAsString(); - } + JsonObject itemInfo = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(internalname); + if (itemInfo == null || !itemInfo.has("displayname")) { + sellingName = internalname; + } else { + sellingName = itemInfo.get("displayname").getAsString(); + } - sellingTooltip = sellStack.getTooltip( - Minecraft.getMinecraft().thePlayer, - Minecraft.getMinecraft().gameSettings.advancedItemTooltips - ); + sellingTooltip = sellStack.getTooltip( + Minecraft.getMinecraft().thePlayer, + Minecraft.getMinecraft().gameSettings.advancedItemTooltips + ); - lowestPrice = NotEnoughUpdates.INSTANCE.manager.auctionManager.getLowestBin(internalname); - if (lowestPrice <= 0) { - lowestPrice = (int) NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAvgBin(internalname); - } + lowestPrice = NotEnoughUpdates.INSTANCE.manager.auctionManager.getLowestBin(internalname); + if (lowestPrice <= 0) { + lowestPrice = (int) NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAvgBin(internalname); + } - float undercutFactor = 1 - NotEnoughUpdates.INSTANCE.config.ahTweaks.warningThreshold / 100; - if (undercutFactor < 0) undercutFactor = 0; - if (undercutFactor > 1) undercutFactor = 1; - float overcutFactor = 1 - NotEnoughUpdates.INSTANCE.config.ahTweaks.overcutWarningThreshold / 100; - if (overcutFactor < 0) overcutFactor = 0; - if (overcutFactor > 1) overcutFactor = 1; + float undercutFactor = 1 - NotEnoughUpdates.INSTANCE.config.ahTweaks.warningThreshold / 100; + if (undercutFactor < 0) undercutFactor = 0; + if (undercutFactor > 1) undercutFactor = 1; + float overcutFactor = 1 - NotEnoughUpdates.INSTANCE.config.ahTweaks.overcutWarningThreshold / 100; + if (overcutFactor < 0) overcutFactor = 0; + if (overcutFactor > 1) overcutFactor = 1; - if (lowestPrice == -1) { - return false; - } - if (NotEnoughUpdates.INSTANCE.config.ahTweaks.underCutWarning && - (sellingPrice > 0 && lowestPrice > 0 && sellingPrice < sellStackAmount * lowestPrice * undercutFactor)) { - showWarning = true; - return true; - } else if (NotEnoughUpdates.INSTANCE.config.ahTweaks.overCutWarning && - (sellingPrice > 0 && lowestPrice > 0 && sellingPrice > sellStackAmount * lowestPrice * (overcutFactor + 1))) { - showWarning = true; - return true; - } else { - return false; - } + if (lowestPrice == -1) { + return; + } + if (NotEnoughUpdates.INSTANCE.config.ahTweaks.underCutWarning && + (sellingPrice > 0 && lowestPrice > 0 && sellingPrice < sellStackAmount * lowestPrice * undercutFactor)) { + showWarning = true; + event.setCanceled(true); + } else if (NotEnoughUpdates.INSTANCE.config.ahTweaks.overCutWarning && + (sellingPrice > 0 && lowestPrice > 0 && sellingPrice > sellStackAmount * lowestPrice * (overcutFactor + 1))) { + showWarning = true; + event.setCanceled(true); } - return false; } public void overrideIsMouseOverSlot(Slot slot, int mouseX, int mouseY, CallbackInfoReturnable cir) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java index e51496e3..ad0b238a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java @@ -21,6 +21,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.events.SlotClickEvent; import io.github.moulberry.notenoughupdates.listener.RenderListener; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiChest; @@ -37,6 +38,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagList; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; import javax.imageio.ImageIO; import java.awt.*; @@ -563,4 +565,17 @@ public class BetterContainers { return 0; } } + + @SubscribeEvent + public void onMouseClick(SlotClickEvent event) { + if (!isOverriding()) return; + boolean isBlankStack = BetterContainers.isBlankStack(event.slot.slotNumber, event.slot.getStack()); + if (!(isBlankStack || + BetterContainers.isButtonStack(event.slot.slotNumber, event.slot.getStack()))) return; + clickSlot(event.slotId); + if (isBlankStack) { + event.usePickblockInstead(); + } + } + } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java index a1580d8e..d5cbfdde 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java @@ -20,6 +20,7 @@ package io.github.moulberry.notenoughupdates.miscfeatures; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.events.SlotClickEvent; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiChest; @@ -308,98 +309,88 @@ public class EnchantingSolvers { return false; } - public static boolean onStackClick(ItemStack stack, int windowId, int slotId, int mouseButtonClicked, int mode) { - if (!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableEnchantingSolvers) { - return false; + @SubscribeEvent + public void onStackClick(SlotClickEvent event) { + if (!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.enableEnchantingSolvers + || !NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) { + return; } - if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) { - return false; + ItemStack stack = event.slot.getStack(); + if (stack == null || stack.getDisplayName() == null) { + return; } + String displayName = stack.getDisplayName(); + if (!(Minecraft.getMinecraft().currentScreen instanceof GuiChest)) { + return; + } + GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; + ContainerChest container = (ContainerChest) chest.inventorySlots; + IInventory lower = container.getLowerChestInventory(); + + if (currentSolver == SolverType.CHRONOMATRON) { + ItemStack timerStack = lower.getStackInSlot(lower.getSizeInventory() - 5); + if (timerStack == null) { + return; + } - if (stack != null && stack.getDisplayName() != null) { - String displayName = stack.getDisplayName(); - if (Minecraft.getMinecraft().currentScreen instanceof GuiChest) { - GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; - ContainerChest container = (ContainerChest) chest.inventorySlots; - IInventory lower = container.getLowerChestInventory(); - - if (currentSolver == SolverType.CHRONOMATRON) { - ItemStack timerStack = lower.getStackInSlot(lower.getSizeInventory() - 5); - if (timerStack == null) { - return false; - } - - boolean yepClock = timerStack.getItem() == Items.clock; - if (timerStack.getItem() == Item.getItemFromBlock(Blocks.glowstone) || - (yepClock && (!addToChronomatron || chronomatronOrder.size() < lastChronomatronSize + 1))) { - return true; - } else if (yepClock) { - long currentTime = System.currentTimeMillis(); - if (currentTime - millisLastClick < 150) { - return true; - } + boolean yepClock = timerStack.getItem() == Items.clock; + if (timerStack.getItem() == Item.getItemFromBlock(Blocks.glowstone) || + (yepClock && (!addToChronomatron || chronomatronOrder.size() < lastChronomatronSize + 1))) { + event.setCanceled(true); + return; + } + if (yepClock) { + long currentTime = System.currentTimeMillis(); + if (currentTime - millisLastClick < 150) { + event.setCanceled(true); + return; + } - if (chronomatronReplayIndex < chronomatronOrder.size()) { - String chronomatronCurrent = chronomatronOrder.get(chronomatronReplayIndex); - if ((!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.preventMisclicks1 || - chronomatronCurrent.equals(displayName) || Keyboard.getEventKey() == Keyboard.KEY_LSHIFT) && - stack.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane) && slotId != 4 && slotId != 49) { - chronomatronReplayIndex++; - Minecraft.getMinecraft().playerController.windowClick(windowId, slotId, - 2, mode, Minecraft.getMinecraft().thePlayer - ); - millisLastClick = currentTime; - } - /*if (chronomatronCurrent.equals(displayName)) { - chronomatronReplayIndex++; - } - Minecraft.getMinecraft().playerController.windowClick(windowId, slotId, - 2, mode, Minecraft.getMinecraft().thePlayer); - millisLastClick = currentTime;*/ - } - return true; - } - } else if (currentSolver == SolverType.ULTRASEQUENCER) { - ItemStack timerStack = lower.getStackInSlot(lower.getSizeInventory() - 5); - if (timerStack == null) { - return false; + if (chronomatronReplayIndex < chronomatronOrder.size()) { + String chronomatronCurrent = chronomatronOrder.get(chronomatronReplayIndex); + if ((!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.preventMisclicks1 || + chronomatronCurrent.equals(displayName) || Keyboard.getEventKey() == Keyboard.KEY_LSHIFT) && + stack.getItem() != Item.getItemFromBlock(Blocks.stained_glass_pane) && event.slotId != 4 && + event.slotId != 49) { + chronomatronReplayIndex++; + millisLastClick = currentTime; + event.usePickblockInstead(); + return; } + } + event.setCanceled(true); + return; + } + } + if (currentSolver == SolverType.ULTRASEQUENCER) { + ItemStack timerStack = lower.getStackInSlot(lower.getSizeInventory() - 5); + if (timerStack == null) { + return; + } - boolean yepClock = timerStack.getItem() == Items.clock; - if (yepClock) { - UltrasequencerItem current = ultraSequencerOrder.get(ultrasequencerReplayIndex); - if (current == null) { - return true; - } - long currentTime = System.currentTimeMillis(); - if (currentTime - millisLastClick > 150 && - (!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.preventMisclicks1 || - current.containerIndex == slotId || Keyboard.getEventKey() == Keyboard.KEY_LSHIFT) && (slotId < 45 && slotId > 8)) { - ultrasequencerReplayIndex++; - Minecraft.getMinecraft().playerController.windowClick(windowId, slotId, - 2, mode, Minecraft.getMinecraft().thePlayer - ); - millisLastClick = currentTime; - } - /*if (currentTime - millisLastClick > 150) { - if (current.containerIndex == slotId) { - ultrasequencerReplayIndex++; - } - Minecraft.getMinecraft().playerController.windowClick(windowId, slotId, - 2, mode, Minecraft.getMinecraft().thePlayer); - millisLastClick = currentTime; - }*/ - return true; - } else { - return true; - } - } else if (currentSolver == SolverType.SUPERPAIRS) { - lastSlotClicked = slotId; + boolean yepClock = timerStack.getItem() == Items.clock; + if (yepClock) { + UltrasequencerItem current = ultraSequencerOrder.get(ultrasequencerReplayIndex); + long currentTime = System.currentTimeMillis(); + if (current == null) { + event.setCanceled(true); + return; + } + if (currentTime - millisLastClick > 150 && + (!NotEnoughUpdates.INSTANCE.config.enchantingSolvers.preventMisclicks1 || + current.containerIndex == event.slotId || Keyboard.getEventKey() == Keyboard.KEY_LSHIFT) && + (event.slotId < 45 && event.slotId > 8)) { + ultrasequencerReplayIndex++; + millisLastClick = currentTime; + event.usePickblockInstead(); + return; } } + event.setCanceled(true); + } else if (currentSolver == SolverType.SUPERPAIRS) { + lastSlotClicked = event.slotId; } - return false; } public static void processInventoryContents(boolean fromTick) { 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 a14c98e7..f0902921 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java @@ -30,6 +30,7 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.config.Position; import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.core.util.lerp.LerpUtils; +import io.github.moulberry.notenoughupdates.events.SlotClickEvent; import io.github.moulberry.notenoughupdates.listener.RenderListener; import io.github.moulberry.notenoughupdates.options.NEUConfig; import io.github.moulberry.notenoughupdates.overlays.TextOverlay; @@ -862,18 +863,19 @@ public class PetInfoOverlay extends TextOverlay { "alchemy" ); - public static void onStackClick(ItemStack stack, int windowId, int slotId, int mouseButtonClicked, int mode) { - if (mouseButtonClicked != 0 && mouseButtonClicked != 1 && mouseButtonClicked != 2) return; + @SubscribeEvent + public void onStackClick(SlotClickEvent event) { + if (event.clickedButton != 0 && event.clickedButton != 1 && event.clickedButton != 2) return; - int slotIdMod = (slotId - 10) % 9; - if (slotId >= 10 && slotId <= 43 && slotIdMod >= 0 && slotIdMod <= 6 && + int slotIdMod = (event.slotId - 10) % 9; + if (event.slotId >= 10 && event.slotId <= 43 && slotIdMod >= 0 && slotIdMod <= 6 && Minecraft.getMinecraft().currentScreen instanceof GuiChest) { GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; ContainerChest container = (ContainerChest) chest.inventorySlots; IInventory lower = container.getLowerChestInventory(); String containerName = lower.getDisplayName().getUnformattedText(); - if (lower.getSizeInventory() >= 54 && windowId == container.windowId) { + if (lower.getSizeInventory() >= 54 && event.guiContainer.inventorySlots.windowId == container.windowId) { int page = 0; boolean isPets = false; @@ -895,7 +897,7 @@ public class PetInfoOverlay extends TextOverlay { boolean isRemoving = removingStack != null && removingStack.getItem() == Items.dye && removingStack.getItemDamage() == 10; - int newSelected = (slotId - 10) - (slotId - 10) / 9 * 2 + page * 28; + int newSelected = (event.slotId - 10) - (event.slotId - 10) / 9 * 2 + page * 28; lastPetSelect = System.currentTimeMillis(); @@ -908,7 +910,7 @@ public class PetInfoOverlay extends TextOverlay { } else { setCurrentPet(newSelected); - Pet pet = getPetFromStack(stack.getTagCompound()); + Pet pet = getPetFromStack(event.slot.getStack().getTagCompound()); if (pet != null) { config.petMap.put(config.selectedPet, pet); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java index 3955c363..24183f9a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java @@ -24,6 +24,7 @@ import com.google.gson.GsonBuilder; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.config.KeybindHelper; import io.github.moulberry.notenoughupdates.core.util.render.RenderUtils; +import io.github.moulberry.notenoughupdates.events.SlotClickEvent; import io.github.moulberry.notenoughupdates.mixins.AccessorGuiContainer; import io.github.moulberry.notenoughupdates.util.SBInfo; import net.minecraft.client.Minecraft; @@ -43,7 +44,6 @@ import net.minecraft.util.ResourceLocation; import net.minecraftforge.client.event.GuiScreenEvent; import net.minecraftforge.fml.common.eventhandler.EventPriority; import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; -import org.apache.commons.lang3.tuple.Triple; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; @@ -58,7 +58,6 @@ import java.io.InputStreamReader; import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; import java.util.HashMap; -import java.util.function.Consumer; public class SlotLocking { private static final SlotLocking INSTANCE = new SlotLocking(); @@ -455,22 +454,21 @@ public class SlotLocking { } } - public void onWindowClick( - Slot slotIn, - int slotId, - int clickedButton, - int clickType, - Consumer> consumer - ) { - LockedSlot locked = getLockedSlot(slotIn); + @SubscribeEvent + public void onWindowClick(SlotClickEvent slotClickEvent) { + LockedSlot locked = getLockedSlot(slotClickEvent.slot); if (locked == null) { return; - } else if (locked.locked || (clickType == 2 && SlotLocking.getInstance().isSlotIndexLocked(clickedButton))) { - consumer.accept(null); - } else if (NotEnoughUpdates.INSTANCE.config.slotLocking.enableSlotBinding && clickType == 1 && + } + if (locked.locked || + (slotClickEvent.clickType == 2 && SlotLocking.getInstance().isSlotIndexLocked(slotClickEvent.clickedButton))) { + slotClickEvent.setCanceled(true); + return; + } + if (NotEnoughUpdates.INSTANCE.config.slotLocking.enableSlotBinding + && slotClickEvent.clickType == 1 && locked.boundTo != -1) { - GuiContainer container = (GuiContainer) Minecraft.getMinecraft().currentScreen; - Slot boundSlot = container.inventorySlots.getSlotFromInventory( + Slot boundSlot = slotClickEvent.guiContainer.inventorySlots.getSlotFromInventory( Minecraft.getMinecraft().thePlayer.inventory, locked.boundTo ); @@ -481,29 +479,37 @@ public class SlotLocking { LockedSlot boundLocked = getLockedSlot(boundSlot); - int id = slotIn.getSlotIndex(); - if (id >= 9 && locked.boundTo >= 0 && locked.boundTo < 8) { - if (!boundLocked.locked) { - consumer.accept(Triple.of(slotId, locked.boundTo, 2)); - if (boundLocked == DEFAULT_LOCKED_SLOT) { - LockedSlot[] lockedSlots = getDataForProfile(); - lockedSlots[locked.boundTo] = new LockedSlot(); - lockedSlots[locked.boundTo].boundTo = id; - } else { - boundLocked.boundTo = id; - } + int from, to; + int id = slotClickEvent.slot.getSlotIndex(); + if (id >= 9 && 0 <= locked.boundTo && locked.boundTo < 8 && !boundLocked.locked) { + from = id; + to = locked.boundTo; + if (boundLocked == DEFAULT_LOCKED_SLOT) { + LockedSlot[] lockedSlots = getDataForProfile(); + lockedSlots[locked.boundTo] = new LockedSlot(); + lockedSlots[locked.boundTo].boundTo = id; + } else { + boundLocked.boundTo = id; } - } else if (id >= 0 && id < 8 && locked.boundTo >= 9 && locked.boundTo <= 39) { + } else if (0 <= id && id < 8 && locked.boundTo >= 9 && locked.boundTo <= 39) { if (boundLocked.locked || boundLocked.boundTo != id) { locked.boundTo = -1; + return; } else { - int boundTo = boundSlot.slotNumber; - consumer.accept(Triple.of(boundTo, id, 2)); + from = boundSlot.slotNumber; + to = id; } + } else { + return; } + Minecraft.getMinecraft().playerController.windowClick( + slotClickEvent.guiContainer.inventorySlots.windowId, + from, to, 2, Minecraft.getMinecraft().thePlayer + ); + slotClickEvent.setCanceled(true); } else if (NotEnoughUpdates.INSTANCE.config.slotLocking.enableSlotBinding && locked.boundTo != -1 && NotEnoughUpdates.INSTANCE.config.slotLocking.bindingAlsoLocks) { - consumer.accept(null); + slotClickEvent.setCanceled(true); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiChest.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiChest.java index 1b6b5c61..94b1c704 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiChest.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiChest.java @@ -60,7 +60,7 @@ public class MixinGuiChest { private static final String TARGET_SBADRAWSTRING = "Lcodes/biscuit/skyblockaddons/asm/hooks/GuiChestHook;" + "drawString(Lnet/minecraft/client/gui/FontRenderer;Ljava/lang/String;III)I"; - @Redirect(method = "drawGuiContainerForegroundLayer", at = @At(value = "INVOKE", target = TARGET_SBADRAWSTRING, remap = false)) + @Redirect(method = "drawGuiContainerForegroundLayer", at = @At(value = "INVOKE", target = TARGET_SBADRAWSTRING, remap = false), expect = 0) public int drawGuiContainerForegroundLayer_SBA_drawString( FontRenderer fontRenderer, String text, diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java index a24f4c84..81918939 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java @@ -21,14 +21,13 @@ package io.github.moulberry.notenoughupdates.mixins; import io.github.moulberry.notenoughupdates.NEUOverlay; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.events.SlotClickEvent; import io.github.moulberry.notenoughupdates.listener.RenderListener; import io.github.moulberry.notenoughupdates.miscfeatures.AbiphoneWarning; -import io.github.moulberry.notenoughupdates.miscfeatures.AntiCoopAdd; import io.github.moulberry.notenoughupdates.miscfeatures.AuctionBINWarning; import io.github.moulberry.notenoughupdates.miscfeatures.AuctionSortModeWarning; import io.github.moulberry.notenoughupdates.miscfeatures.BetterContainers; import io.github.moulberry.notenoughupdates.miscfeatures.EnchantingSolvers; -import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; import io.github.moulberry.notenoughupdates.miscfeatures.SlotLocking; import io.github.moulberry.notenoughupdates.miscgui.GuiCustomEnchant; import io.github.moulberry.notenoughupdates.miscgui.StorageOverlay; @@ -60,7 +59,6 @@ import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; import org.spongepowered.asm.mixin.injection.callback.LocalCapture; import java.util.Set; -import java.util.concurrent.atomic.AtomicBoolean; @Mixin(GuiContainer.class) public abstract class MixinGuiContainer extends GuiScreen { @@ -98,7 +96,8 @@ public abstract class MixinGuiContainer extends GuiScreen { if (tag.hasKey("SkullOwner") && tag.getCompoundTag("SkullOwner").hasKey("Name")) { String tagName = tag.getCompoundTag("SkullOwner").getString("Name"); String displayName = Utils.cleanColour(cc.inventorySlots.get(22).getStack().getDisplayName()); - if (displayName.length() - tagName.length() >= 0 && tagName.equals(displayName.substring(displayName.length() - tagName.length()))) { + if (displayName.length() - tagName.length() >= 0 && tagName.equals(displayName.substring( + displayName.length() - tagName.length()))) { ci.cancel(); this.zLevel = 100.0F; @@ -127,7 +126,8 @@ public abstract class MixinGuiContainer extends GuiScreen { else if (!($this instanceof GuiChest)) BetterContainers.profileViewerStackIndex = -1; - if (slot.getStack() == null && NotEnoughUpdates.INSTANCE.overlay.searchMode && RenderListener.drawingGuiScreen && NotEnoughUpdates.INSTANCE.isOnSkyblock()) { + if (slot.getStack() == null && NotEnoughUpdates.INSTANCE.overlay.searchMode && RenderListener.drawingGuiScreen && + NotEnoughUpdates.INSTANCE.isOnSkyblock()) { GlStateManager.pushMatrix(); GlStateManager.translate(0, 0, 100 + Minecraft.getMinecraft().getRenderItem().zLevel); GlStateManager.depthMask(false); @@ -303,74 +303,20 @@ public abstract class MixinGuiContainer extends GuiScreen { @Inject(method = "handleMouseClick", at = @At(value = "HEAD"), cancellable = true) public void handleMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType, CallbackInfo ci) { + if (slotIn == null) return; GuiContainer $this = (GuiContainer) (Object) this; - - if (AuctionBINWarning.getInstance().onMouseClick(slotIn, slotId, clickedButton, clickType)) { - ci.cancel(); - return; - } - - if (AbiphoneWarning.getInstance().onMouseClick(slotIn, slotId, clickedButton, clickType)) { + SlotClickEvent event = new SlotClickEvent($this, slotIn, slotId, clickedButton, clickType); + event.post(); + if (event.isCanceled()) { ci.cancel(); return; } - - if (AntiCoopAdd.onMouseClick(slotIn, slotId, clickedButton, clickType)) { - ci.cancel(); - return; - } - - AtomicBoolean ret = new AtomicBoolean(false); - SlotLocking.getInstance().onWindowClick(slotIn, slotId, clickedButton, clickType, (tuple) -> { + if (event.usePickblockInstead) { + $this.mc.playerController.windowClick( + $this.inventorySlots.windowId, + slotId, 2, 3, $this.mc.thePlayer + ); ci.cancel(); - - if (tuple == null) { - ret.set(true); - } else { - int newSlotId = tuple.getLeft(); - int newClickedButton = tuple.getMiddle(); - int newClickedType = tuple.getRight(); - - ret.set(true); - $this.mc.playerController.windowClick( - $this.inventorySlots.windowId, - newSlotId, - newClickedButton, - newClickedType, - $this.mc.thePlayer - ); - } - }); - if (ret.get()) return; - - if (slotIn != null && slotIn.getStack() != null) { - if (EnchantingSolvers.onStackClick(slotIn.getStack(), $this.inventorySlots.windowId, - slotId, clickedButton, clickType - )) { - ci.cancel(); - } else { - PetInfoOverlay.onStackClick(slotIn.getStack(), $this.inventorySlots.windowId, - slotId, clickedButton, clickType - ); - } - } - if (slotIn != null && BetterContainers.isOverriding() && (BetterContainers.isBlankStack( - slotIn.slotNumber, - slotIn.getStack() - ) || - BetterContainers.isButtonStack(slotIn.slotNumber, slotIn.getStack()))) { - BetterContainers.clickSlot(slotIn.getSlotIndex()); - - if (BetterContainers.isBlankStack(slotIn.slotNumber, slotIn.getStack())) { - GuiContainer chest = ((GuiContainer) Minecraft.getMinecraft().currentScreen); - Minecraft.getMinecraft().playerController.windowClick( - chest.inventorySlots.windowId, - slotId, 2, 3, Minecraft.getMinecraft().thePlayer - ); - ci.cancel(); - } else { - Utils.playPressSound(); - } } } } -- cgit From 3d627400e94235df69327fe248f5c6f4fff07382 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Thu, 6 Oct 2022 07:33:58 +1100 Subject: fix crash if profile specific is null (#342) --- .../io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java index 541a76e8..6244c32c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/Navigation.java @@ -208,6 +208,7 @@ public class Navigation { if (event.phase != TickEvent.Phase.START) return; if (Minecraft.getMinecraft().theWorld == null) return; if (Minecraft.getMinecraft().thePlayer == null) return; + if (neu.config.getProfileSpecific() == null) return; if (Minecraft.getMinecraft().currentScreen instanceof GuiChest && RenderListener.inventoryLoaded) { GuiChest currentScreen = (GuiChest) Minecraft.getMinecraft().currentScreen; -- cgit From 116b8257be57eb1599127355fd9b60d87b087876 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 7 Oct 2022 06:06:03 +1100 Subject: Fix crash with pet overlay (#344) --- .../moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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 f0902921..776e3647 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/PetInfoOverlay.java @@ -910,9 +910,11 @@ public class PetInfoOverlay extends TextOverlay { } else { setCurrentPet(newSelected); - Pet pet = getPetFromStack(event.slot.getStack().getTagCompound()); - if (pet != null) { - config.petMap.put(config.selectedPet, pet); + if (event.slot.getStack() != null && event.slot.getStack().getTagCompound() != null) { + Pet pet = getPetFromStack(event.slot.getStack().getTagCompound()); + if (pet != null) { + config.petMap.put(config.selectedPet, pet); + } } } } -- cgit From d823d2ab08cbc41fac67f06a7d38009627d4497e Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 7 Oct 2022 06:06:27 +1100 Subject: Fix custom trade menu (#345) * i love the hypixel network * println("$slot.slotNumber ${slot.stack.displayName}" --- .../java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java index 8a0353d3..16b5015b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java @@ -1078,7 +1078,7 @@ public class TradeWindow { !SlotLocking.getInstance().isSlotLocked(slot)) { Minecraft.getMinecraft().playerController.windowClick( chest.inventorySlots.windowId, - slot.slotNumber, 2, 3, Minecraft.getMinecraft().thePlayer + slot.slotNumber, 0, 0, Minecraft.getMinecraft().thePlayer ); } return; -- cgit From 036d00a64e89ce50574c2cc85965ae10ea00e1cc Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 7 Oct 2022 06:07:11 +1100 Subject: Fix slot binding not working from armour slots (#343) i love minecraft forge for minecraft version 1.8 minor version 9 --- .../github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java index 24183f9a..8a487739 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SlotLocking.java @@ -502,6 +502,10 @@ public class SlotLocking { } else { return; } + if (from == 39) from = 5; + if (from == 38) from = 6; + if (from == 37) from = 7; + if (from == 36) from = 8; Minecraft.getMinecraft().playerController.windowClick( slotClickEvent.guiContainer.inventorySlots.windowId, from, to, 2, Minecraft.getMinecraft().thePlayer -- cgit From 98ec7b09eec00e57632a92a0f9245dc755d386ae Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Thu, 6 Oct 2022 23:51:17 +0200 Subject: Skyblock addons expect=0, and modlist config button (#337) * Skyblock addons expect=0 Synonyms for essential: crucial, main, fundamental, imperative, important, indispensable, vital, necessary, needed, vital, cardinal, principal, required, necessitous (oh wow that one sounds like incestous) * Make modlist config button work * Clean up buildscript * Add version to mock mod manifests as well Courtesy-off: MultiMC * Jitpack metadata --- build.gradle.kts | 85 ++++++++-------------- buildSrc/build.gradle.kts | 26 +++++++ buildSrc/src/main/kotlin/neubs/buildflags.kt | 56 ++++++++++++++ buildSrc/src/main/kotlin/neubs/publishing.kt | 62 ++++++++++++++++ buildSrc/src/main/kotlin/neubs/versioning.kt | 54 ++++++++++++++ jitpack.yml | 4 + .../notenoughupdates/NotEnoughUpdates.java | 4 +- .../core/config/MoulConfigGuiForgeInterop.java | 69 ++++++++++++++++++ src/main/resources/META-INF/mods.toml | 2 +- src/main/resources/fabric.mod.json | 2 +- 10 files changed, 307 insertions(+), 57 deletions(-) create mode 100644 buildSrc/build.gradle.kts create mode 100644 buildSrc/src/main/kotlin/neubs/buildflags.kt create mode 100644 buildSrc/src/main/kotlin/neubs/publishing.kt create mode 100644 buildSrc/src/main/kotlin/neubs/versioning.kt create mode 100644 jitpack.yml create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/MoulConfigGuiForgeInterop.java diff --git a/build.gradle.kts b/build.gradle.kts index 409a8d51..deb740f5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -18,12 +18,9 @@ */ -import net.fabricmc.loom.task.RemapJarTask -import java.io.ByteArrayOutputStream -import java.nio.file.FileSystems -import java.nio.file.Files -import java.nio.charset.StandardCharsets -import java.util.* +import neubs.NEUBuildFlags +import neubs.applyPublishingInformation +import neubs.setVersionFromEnvironment plugins { idea @@ -31,42 +28,18 @@ plugins { id("gg.essential.loom") version "0.10.0.+" id("dev.architectury.architectury-pack200") version "0.1.3" id("com.github.johnrengelman.shadow") version "7.1.2" + id("io.github.juuxel.loom-quiltflower") version "1.7.3" + `maven-publish` } +apply() + // Build metadata group = "io.github.moulberry" -val baseVersion = "2.1" - - -val buildExtra = mutableListOf() -val buildVersion = properties["BUILD_VERSION"] as? String -if (buildVersion != null) buildExtra.add(buildVersion) -if (properties["CI"] as? String == "true") buildExtra.add("ci") - -val stdout = ByteArrayOutputStream() -val execResult = exec { - commandLine("git", "describe", "--always", "--first-parent", "--abbrev=7") - standardOutput = stdout - isIgnoreExitValue = true -} -if (execResult.exitValue == 0) { - buildExtra.add(String(stdout.toByteArray()).trim()) -} - -val gitDiffStdout = ByteArrayOutputStream() -val gitDiffResult = exec { - commandLine("git", "status", "--porcelain") - standardOutput = gitDiffStdout - isIgnoreExitValue = true -} -if (gitDiffStdout.toByteArray().isNotEmpty()) { - buildExtra.add("dirty") -} - -version = baseVersion + (if (buildExtra.isEmpty()) "" else buildExtra.joinToString(prefix = "+", separator = ".")) +setVersionFromEnvironment("2.1") // Minecraft configuration: loom { @@ -106,6 +79,17 @@ val shadowImplementation by configurations.creating { configurations.implementation.get().extendsFrom(this) } +val shadowApi by configurations.creating { + configurations.implementation.get().extendsFrom(this) +} + +val devEnv by configurations.creating { + configurations.runtimeClasspath.get().extendsFrom(this) + isCanBeResolved = false + isCanBeConsumed = false + isVisible = false +} + dependencies { minecraft("com.mojang:minecraft:1.8.9") mappings("de.oceanlabs.mcp:mcp_stable:22-1.8.9") @@ -115,17 +99,18 @@ dependencies { isTransitive = false // Dependencies of mixin are already bundled by minecraft } annotationProcessor("org.spongepowered:mixin:0.8.4-SNAPSHOT") - shadowImplementation("info.bliki.wiki:bliki-core:3.1.0") + shadowApi("info.bliki.wiki:bliki-core:3.1.0") testImplementation("org.junit.jupiter:junit-jupiter:5.8.2") testAnnotationProcessor("org.spongepowered:mixin:0.8.4-SNAPSHOT") // modImplementation("io.github.notenoughupdates:MoulConfig:0.0.1") - modRuntimeOnly("me.djtheredstoner:DevAuth-forge-legacy:1.1.0") + devEnv("me.djtheredstoner:DevAuth-forge-legacy:1.1.0") } java { + withSourcesJar() toolchain.languageVersion.set(JavaLanguageVersion.of(8)) } @@ -162,7 +147,7 @@ val remapJar by tasks.named("remapJar") { tasks.shadowJar { archiveClassifier.set("dep-dev") - configurations = listOf(shadowImplementation) + configurations = listOf(shadowImplementation, shadowApi) exclude("**/module-info.class", "LICENSE.txt") dependencies { exclude { @@ -175,23 +160,9 @@ tasks.shadowJar { tasks.assemble.get().dependsOn(remapJar) -val generateBuildFlags by tasks.creating { - outputs.upToDateWhen { false } - val t = layout.buildDirectory.file("buildflags.properties") - outputs.file(t) - val props = project.properties.filter { (name, value) -> name.startsWith("neu.buildflags.") } - doLast { - val p = Properties() - p.putAll(props) - t.get().asFile.writer(StandardCharsets.UTF_8).use { - p.store(it, "Store build time configuration for NEU") - } - } -} - tasks.processResources { - from(generateBuildFlags) - filesMatching("mcmod.info") { + from(tasks["generateBuildFlags"]) + filesMatching(listOf("mcmod.info", "fabric.mod.json", "META-INF/mods.toml")) { expand( "version" to project.version, "mcversion" to "1.8.9" ) @@ -201,3 +172,9 @@ tasks.processResources { sourceSets.main { output.setResourcesDir(file("$buildDir/classes/java/main")) } + +applyPublishingInformation( + "deobf" to tasks.jar, + "all" to tasks.remapJar, + "sources" to tasks["sourcesJar"], +) diff --git a/buildSrc/build.gradle.kts b/buildSrc/build.gradle.kts new file mode 100644 index 00000000..5afecadc --- /dev/null +++ b/buildSrc/build.gradle.kts @@ -0,0 +1,26 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +plugins { + `kotlin-dsl` +} + +repositories { + mavenCentral() +} diff --git a/buildSrc/src/main/kotlin/neubs/buildflags.kt b/buildSrc/src/main/kotlin/neubs/buildflags.kt new file mode 100644 index 00000000..6b7ab489 --- /dev/null +++ b/buildSrc/src/main/kotlin/neubs/buildflags.kt @@ -0,0 +1,56 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package neubs + +import org.gradle.api.Plugin +import org.gradle.api.Project +import org.gradle.kotlin.dsl.the +import java.nio.charset.StandardCharsets +import java.util.* + +const val NEU_BUILDFLAGS_PREFIX = "neu.buildflags." + +class NEUBuildFlags : Plugin { + override fun apply(target: Project) { + val props = + target.properties.filterKeys { it.startsWith(NEU_BUILDFLAGS_PREFIX) }.mapValues { it.value as String } + target.extensions.add("buildflags", Extension(props)) + target.tasks.create("generateBuildFlags") { + outputs.upToDateWhen { false } + val t = target.layout.buildDirectory.file("buildflags.properties") + outputs.file(t) + doLast { + val p = Properties() + p.putAll(props) + t.get().asFile.writer(StandardCharsets.UTF_8).use { + p.store(it, "Store build time configuration for NEU") + } + } + + } + } + + class Extension(val props: Map) { + fun bool(name: String) = props["$NEU_BUILDFLAGS_PREFIX$name"] == "true" + } +} + +val Project.buildFlags: NEUBuildFlags.Extension + get() = the() diff --git a/buildSrc/src/main/kotlin/neubs/publishing.kt b/buildSrc/src/main/kotlin/neubs/publishing.kt new file mode 100644 index 00000000..4f9979a1 --- /dev/null +++ b/buildSrc/src/main/kotlin/neubs/publishing.kt @@ -0,0 +1,62 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package neubs + +import org.gradle.api.Project +import org.gradle.api.publish.PublishingExtension +import org.gradle.api.publish.maven.MavenPublication +import org.gradle.kotlin.dsl.configure +import org.gradle.kotlin.dsl.create +import org.gradle.kotlin.dsl.get + +fun Project.applyPublishingInformation( + vararg artifacts: Pair +) { + this.configure { + publications { + create("maven") { + for((name, source) in artifacts) { + artifact(source) { + classifier = name + } + } + pom { + name.set("NotEnoughUpdates") + description.set("A feature rich 1.8.9 Minecraft forge mod for Hypixel Skyblock") + licenses { + license { + name.set("GNU Lesser General Public License") + url.set("https://github.com/NotEnoughUpdates/NotEnoughUpdates/blob/master/COPYING.LESSER") + } + } + developers { + developer { + name.set("Moulberry") + } + developer { + name.set("The NotEnoughUpdates Contributors and Maintainers") + } + } + } + } + } + } + +} diff --git a/buildSrc/src/main/kotlin/neubs/versioning.kt b/buildSrc/src/main/kotlin/neubs/versioning.kt new file mode 100644 index 00000000..254e0012 --- /dev/null +++ b/buildSrc/src/main/kotlin/neubs/versioning.kt @@ -0,0 +1,54 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package neubs + +import org.gradle.api.Project +import java.io.ByteArrayOutputStream + +fun Project.setVersionFromEnvironment(baseVersion: String) { + val buildExtra = mutableListOf() + val buildVersion = properties["BUILD_VERSION"] as? String + if (buildVersion != null) buildExtra.add(buildVersion) + if (System.getenv("CI") == "true") buildExtra.add("ci") + + val stdout = ByteArrayOutputStream() + val execResult = exec { + commandLine("git", "describe", "--always", "--first-parent", "--abbrev=7") + standardOutput = stdout + isIgnoreExitValue = true + } + if (execResult.exitValue == 0) { + buildExtra.add(String(stdout.toByteArray()).trim()) + } + + val gitDiffStdout = ByteArrayOutputStream() + val gitDiffResult = exec { + commandLine("git", "status", "--porcelain") + standardOutput = gitDiffStdout + isIgnoreExitValue = true + } + if (gitDiffStdout.toByteArray().isNotEmpty()) { + buildExtra.add("dirty") + } + + version = baseVersion + (if (buildExtra.isEmpty()) "" else buildExtra.joinToString(prefix = "+", separator = ".")) + +} + diff --git a/jitpack.yml b/jitpack.yml new file mode 100644 index 00000000..6166e3d7 --- /dev/null +++ b/jitpack.yml @@ -0,0 +1,4 @@ +jdk: + - openjdk17 +env: + CI: true diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 7175c7e8..09c910e9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -117,7 +117,9 @@ import java.nio.charset.StandardCharsets; import java.util.HashMap; import java.util.Set; -@Mod(modid = NotEnoughUpdates.MODID, version = NotEnoughUpdates.VERSION, clientSideOnly = true) +@Mod( + modid = NotEnoughUpdates.MODID, version = NotEnoughUpdates.VERSION, clientSideOnly = true, useMetadata = true, + guiFactory = "io.github.moulberry.notenoughupdates.core.config.MoulConfigGuiForgeInterop") public class NotEnoughUpdates { public static final String MODID = "notenoughupdates"; public static final String VERSION = "2.1.0-REL"; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/MoulConfigGuiForgeInterop.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/MoulConfigGuiForgeInterop.java new file mode 100644 index 00000000..40887e54 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/MoulConfigGuiForgeInterop.java @@ -0,0 +1,69 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.core.config; + +import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper; +import io.github.moulberry.notenoughupdates.options.NEUConfigEditor; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.fml.client.IModGuiFactory; +import org.lwjgl.input.Keyboard; + +import java.io.IOException; +import java.util.Set; + +public class MoulConfigGuiForgeInterop implements IModGuiFactory { + @Override + public void initialize(Minecraft minecraft) {} + + @Override + public Class mainConfigGuiClass() { + return WrappedMoulConfig.class; + } + + @Override + public Set runtimeGuiCategories() { + return null; + } + + @Override + public RuntimeOptionGuiHandler getHandlerFor(RuntimeOptionCategoryElement runtimeOptionCategoryElement) { + return null; + } + + public static class WrappedMoulConfig extends GuiScreenElementWrapper { + + private final GuiScreen parent; + + public WrappedMoulConfig(GuiScreen parent) { + super(NEUConfigEditor.editor); + this.parent = parent; + } + + @Override + public void handleKeyboardInput() throws IOException { + if (Keyboard.getEventKeyState() && Keyboard.getEventKey() == Keyboard.KEY_ESCAPE) { + Minecraft.getMinecraft().displayGuiScreen(parent); + return; + } + super.handleKeyboardInput(); + } + } +} diff --git a/src/main/resources/META-INF/mods.toml b/src/main/resources/META-INF/mods.toml index 281faf65..412917d1 100644 --- a/src/main/resources/META-INF/mods.toml +++ b/src/main/resources/META-INF/mods.toml @@ -5,7 +5,7 @@ license = "LGPL" [[mods]] modId="notenoughupdateserrordisplay" -version="99.99" +version="${version}" displayName="NotEnoughUpdates (1.8.9)" description=''' This mod description is only here to warn you about using the wrong version of Minecraft and Forge. diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 8dd63bf3..0123ad91 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -1,6 +1,6 @@ { "id": "notenoughupdates", - "version": "9999.0", + "version": "${version}", "schemaVersion": 1, "entrypoints": { "main": [ -- cgit From 4662a5a792e4dd790a45cd8da158e4464fb1e2dd Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Mon, 10 Oct 2022 05:37:05 +1100 Subject: Last pr before 2.1 i hope (#347) * Changed version so update notifier works for everyone * Added some missed stuff to 2.1.md * Fixed typo * I just had to... fixed name * Blame efe and lulo if that isnt right Co-authored-by: jani270 --- Update Notes/2.1.md | 7 ++++++- .../io/github/moulberry/notenoughupdates/NotEnoughUpdates.java | 2 +- .../notenoughupdates/miscfeatures/updater/AutoUpdater.java | 10 ---------- .../options/seperateSections/CustomArmour.java | 2 +- 4 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index 89f56293..359a56fe 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -113,7 +113,6 @@ - Added power stone feature - hannibal2 - Added abiphone warning - hannibal2 - Added blur limit at 100 - nopo -- Added bazaar sacks profit feature - hannibal2 - Added an option to disable etherwarp overlay when TP is denied - hannibal2 - Added bazaar search overlay - hannibal2 - Added fraction display instead of percentage in slayer and dungeon RNG meter inventory - hannibal2 @@ -121,6 +120,7 @@ - Added showing the amount of dungeon runs or slayer bosses needed for the rng meter to fill up - hannibal2 - Added bazaar prices to enchants in the enchantment table - hannibal2 / nea89 - Added an option to not open the item list when searching containers - Lulonaut +- Made config option in mod settings work - nea89 ### **Bug Fixes:** @@ -159,6 +159,11 @@ - Fixed middle clicking on pets not registering pet swap - nopo - Fixed middle clicking on an item with no id searching for it - nopo - Fixed pets with decimal stats not showing in pv - nopo +- Changed click packets to act like vanilla - nea89/nopo +- Fixed custom trade menu - nopo +- Removed "Last Seen" from /pv as hypixel removed it from the api - jani +- Fixed profile selector in /pv if you have gui scale 5 - nopo +- Fixed Minecraft not going to be able to access the Hypixel api after 18/10/22 - nea89 ### **Other:** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 09c910e9..3f535d68 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -123,7 +123,7 @@ import java.util.Set; public class NotEnoughUpdates { public static final String MODID = "notenoughupdates"; public static final String VERSION = "2.1.0-REL"; - public static final int VERSION_ID = 20100; + public static final int VERSION_ID = 20101; //2.1.1 only so update notif works public static final int PRE_VERSION_ID = 0; public static final int HOTFIX_VERSION_ID = 0; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.java index e7ada16f..389cfc75 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.java @@ -95,16 +95,6 @@ public class AutoUpdater { } updateLoader = getUpdateLoader(url); if (updateLoader == null) { - logProgress(new ChatComponentText( - "Your system does not support auto updates. Please download this update manually. Click here to read more about auto update compatibility (or the link above for manual downloads)") - .setChatStyle( - new ChatStyle() - .setChatHoverEvent(new HoverEvent( - HoverEvent.Action.SHOW_TEXT, - new ChatComponentText("Click here to read about auto update modalities") - )) - .setChatClickEvent(new ClickEvent(ClickEvent.Action.RUN_COMMAND, "/neuupdate updatemodes")) - )); return; } updateLoader.greet(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/CustomArmour.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/CustomArmour.java index d7f82a66..92b4b2ab 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/CustomArmour.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/CustomArmour.java @@ -29,7 +29,7 @@ public class CustomArmour { @Expose @ConfigOption( name = "Enable Equipment Hud", - desc = "Shows an overlay in your inventory showing your 4 extra armour slots" + + desc = "Shows an overlay in your inventory showing your 4 extra armour slots\n" + "\u00A7cRequires Hide Potion Effects to be enabled" ) @ConfigEditorBoolean -- cgit From 90b3225afdd5e43c54e82d73478f2c2f1e046f80 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Mon, 10 Oct 2022 11:20:16 +0000 Subject: Set everyones branch back to master (#348) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../notenoughupdates/NotEnoughUpdates.java | 8 +++++++ .../profileviewer/trophy/TrophyFishPage.java | 26 ++++++++++++---------- 2 files changed, 22 insertions(+), 12 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 3f535d68..39826ded 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -261,6 +261,14 @@ public class NotEnoughUpdates { if (config.profileViewer.pageLayout.size() == 9) { config.profileViewer.pageLayout.add(9); } + + // Remove after 2.1 ig + if ("dangerous".equals(config.apiData.repoBranch) || "rune".equals(config.apiData.repoBranch)) { + config.apiData.repoBranch = "master"; + } else if ("jani270".equals(config.apiData.repoUser)) { + config.apiData.repoUser = "NotEnoughUpdates"; + } + saveConfig(); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java index e6c69649..cda47ffd 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java @@ -26,11 +26,6 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewerPage; import io.github.moulberry.notenoughupdates.util.Utils; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; @@ -43,6 +38,13 @@ import org.apache.commons.lang3.text.WordUtils; import org.apache.commons.lang3.tuple.Pair; import org.lwjgl.opengl.GL11; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; + public class TrophyFishPage extends GuiProfileViewerPage { public static final ResourceLocation pv_elements = new ResourceLocation("notenoughupdates:pv_elements.png"); @@ -339,9 +341,9 @@ public class TrophyFishPage extends GuiProfileViewerPage { private List getTooltip(String name, Map trophyFishRarityIntegerMap) { List tooltip = new ArrayList<>(); - tooltip.add(internalTrophyFish.get(name.toLowerCase().replace(" ", "_")) + WordUtils.capitalize(name.replace("_", " "))); + tooltip.add(internalTrophyFish.get(name.toLowerCase(Locale.US).replace(" ", "_")) + WordUtils.capitalize(name.replace("_", " "))); - List lore = readLoreFromRepo(name.toUpperCase()); + List lore = readLoreFromRepo(name.toUpperCase(Locale.US)); List description = readDescriptionFromLore(lore); tooltip.addAll(description); tooltip.add(" "); @@ -363,7 +365,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { TrophyFish.TrophyFishRarity rarity, EnumChatFormatting color ) { - String name = WordUtils.capitalize(rarity.name().toLowerCase()); + String name = WordUtils.capitalize(rarity.name().toLowerCase(Locale.US)); if (trophyFishRarityIntegerMap == null) { return color + name + ": " + checkX; } @@ -376,7 +378,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { } private ItemStack getItem(String name) { - String repoName = name.toUpperCase().replace(" ", "_") + "_BRONZE"; + String repoName = name.toUpperCase(Locale.US).replace(" ", "_") + "_BRONZE"; JsonObject jsonItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(repoName); return NotEnoughUpdates.INSTANCE.manager.jsonToStack(jsonItem); } @@ -402,7 +404,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { type = s[2]; } try { - trophyFishRarity = TrophyFish.TrophyFishRarity.valueOf(type.toUpperCase()); + trophyFishRarity = TrophyFish.TrophyFishRarity.valueOf(type.toUpperCase(Locale.US)); } catch (IllegalArgumentException ignored) { total.put(WordUtils.capitalize(key), value); continue; @@ -441,7 +443,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { private List fixStringName(List list) { List fixedList = new ArrayList<>(); for (String s : list) { - fixedList.add(s.toLowerCase().replace(" ", "_")); + fixedList.add(s.toLowerCase(Locale.US).replace(" ", "_")); } return fixedList; } @@ -463,7 +465,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { } private List readLoreFromRepo(String name) { - String repoName = name.toUpperCase().replace(" ", "_") + "_BRONZE"; + String repoName = name.toUpperCase(Locale.US).replace(" ", "_") + "_BRONZE"; JsonObject jsonItem = NotEnoughUpdates.INSTANCE.manager.getItemInformation().get(repoName); List list = new ArrayList<>(); -- cgit From 54eea328ad47ff55f3c8498fdc13e61a30200087 Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Tue, 11 Oct 2022 21:43:00 +0200 Subject: Add ability to sign update.json, needed for autoupdates (#354) * Add ability to sign update.json, needed for autoupdates * Remove update from URL --- buildSrc/generate-public-key.sh | 31 ++++++++ buildSrc/moulsign.sh | 26 +++++++ .../commands/misc/UpdateCommand.java | 18 ----- .../miscfeatures/updater/AutoUpdater.java | 9 +++ .../notenoughupdates/util/MoulSigner.java | 80 +++++++++++++++++++++ src/main/resources/moulberry.key | Bin 0 -> 422 bytes 6 files changed, 146 insertions(+), 18 deletions(-) create mode 100755 buildSrc/generate-public-key.sh create mode 100755 buildSrc/moulsign.sh create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/util/MoulSigner.java create mode 100644 src/main/resources/moulberry.key diff --git a/buildSrc/generate-public-key.sh b/buildSrc/generate-public-key.sh new file mode 100755 index 00000000..3f778c53 --- /dev/null +++ b/buildSrc/generate-public-key.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +# Copyright (C) 2022 NotEnoughUpdates contributors +# +# This file is part of NotEnoughUpdates. +# +# NotEnoughUpdates is free software: you can redistribute it +# and/or modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, either +# version 3 of the License, or (at your option) any later version. +# +# NotEnoughUpdates is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with NotEnoughUpdates. If not, see . +# + + +output="$(dirname $(dirname $(readlink -f "$0")))/src/main/resources/moulberry.key" + +echo processing rsa input key from $1, and outputting to $output + +tempfile="$(mktemp)" +ssh-keygen -f "$1" -e -m pkcs8 > "$tempfile" +openssl rsa -pubin -in "$tempfile" -outform der > $output + +echo saved x509 public key at $output + diff --git a/buildSrc/moulsign.sh b/buildSrc/moulsign.sh new file mode 100755 index 00000000..dacb8ec3 --- /dev/null +++ b/buildSrc/moulsign.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Copyright (C) 2022 NotEnoughUpdates contributors +# +# This file is part of NotEnoughUpdates. +# +# NotEnoughUpdates is free software: you can redistribute it +# and/or modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation, either +# version 3 of the License, or (at your option) any later version. +# +# NotEnoughUpdates is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public License +# along with NotEnoughUpdates. If not, see . +# + +echo use key $1, signing file $2 +openssl dgst -sign "$1" "$2" > "$2.asc" +echo signature saved to "$2.asc" + + + diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/UpdateCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/UpdateCommand.java index 36443b27..cac93369 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/UpdateCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/UpdateCommand.java @@ -49,10 +49,6 @@ public class UpdateCommand extends ClientCommandBase { "" + "§e[NEU] §b/neuupdate help - View help.\n" + "§e[NEU] §b/neuupdate check - Check for updates.\n" + - "§e[NEU] §b/neuupdate url - Load an update from an direct download URL.\n" + - " §cONLY DO THIS WITH TRUSTED URLS OR IT MIGHT RESULT IN A RAT!\n" + - "§e[NEU] §b/neuupdate fromartifact - Load an update from an artifact.\n" + - " §cIf you don't know what this is, don't use it.\n" + "" )); @@ -68,20 +64,6 @@ public class UpdateCommand extends ClientCommandBase { case "check": neu.autoUpdater.displayUpdateMessageIfOutOfDate(); break; - case "url": - if (args.length != 2) { - sender.addChatMessage(new ChatComponentText("§e[NEU] §cPlease provide an URL")); - } - URL url; - try { - url = new URL(args[1]); - } catch (MalformedURLException e) { - e.printStackTrace(); - sender.addChatMessage(new ChatComponentText("§e[NEU] §cInvalid URL")); - return; - } - neu.autoUpdater.updateFromURL(url); - break; case "scheduledownload": neu.autoUpdater.scheduleDownload(); break; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.java index 389cfc75..54fcc204 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/updater/AutoUpdater.java @@ -26,6 +26,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; import com.google.gson.JsonSyntaxException; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.util.MoulSigner; import io.github.moulberry.notenoughupdates.util.NotificationHandler; import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; @@ -171,6 +172,14 @@ public class AutoUpdater { File repo = neu.manager.repoLocation; File updateJson = new File(repo, "update.json"); if (updateJson.exists()) { + if (!MoulSigner.verifySignature(updateJson)) { + NotEnoughUpdates.LOGGER.error("update.json found without signature"); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( + "§e[NEU] §cThere has been an error checking for updates. Check the log or join the discord for more information.").setChatStyle( + Utils.createClickStyle( + ClickEvent.Action.OPEN_URL, "https://discord.gg/moulberry"))); + return; + } try { JsonObject o = neu.manager.getJsonFromFile(updateJson); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/MoulSigner.java b/src/main/java/io/github/moulberry/notenoughupdates/util/MoulSigner.java new file mode 100644 index 00000000..6510bc20 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/MoulSigner.java @@ -0,0 +1,80 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.util; + +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import org.apache.commons.io.IOUtils; + +import java.io.File; +import java.io.IOException; +import java.io.InputStream; +import java.security.InvalidKeyException; +import java.security.KeyFactory; +import java.security.NoSuchAlgorithmException; +import java.security.PublicKey; +import java.security.Signature; +import java.security.SignatureException; +import java.security.spec.InvalidKeySpecException; +import java.security.spec.X509EncodedKeySpec; + +public class MoulSigner { + private MoulSigner() {} + + static PublicKey publicKey; + + static { + try (InputStream is = MoulSigner.class.getResourceAsStream("/moulberry.key")) { + byte[] publicKeyBytes = IOUtils.toByteArray(is); + X509EncodedKeySpec x509EncodedKeySpec = new X509EncodedKeySpec(publicKeyBytes); + publicKey = KeyFactory.getInstance("RSA").generatePublic(x509EncodedKeySpec); + } catch (IOException | NullPointerException | NoSuchAlgorithmException | InvalidKeySpecException e) { + NotEnoughUpdates.LOGGER.error("Cannot initialize MoulSigner", e); + } + } + + public static boolean verifySignature(byte[] data, byte[] signatureBytes) { + if (Boolean.getBoolean("neu.noverifysignature")) return true; + if (publicKey == null) { + NotEnoughUpdates.LOGGER.warn("MoulSigner could not be initialized, will fail this request"); + return false; + } + try { + Signature signature = Signature.getInstance("SHA256withRSA"); + signature.initVerify(publicKey); + signature.update(data); + return signature.verify(signatureBytes); + } catch (NoSuchAlgorithmException | InvalidKeyException | SignatureException e) { + NotEnoughUpdates.LOGGER.error("Error while verifying signature. Considering this as invalid signature", e); + return false; + } + } + + public static boolean verifySignature(File file) { + try { + return verifySignature( + IOUtils.toByteArray(file.toURI()), + IOUtils.toByteArray(new File(file.getParentFile(), file.getName() + ".asc").toURI()) + ); + } catch (IOException e) { + NotEnoughUpdates.LOGGER.error("Ran into an IOException while verifying a signature", e); + return false; + } + } +} diff --git a/src/main/resources/moulberry.key b/src/main/resources/moulberry.key new file mode 100644 index 00000000..5a7a3307 Binary files /dev/null and b/src/main/resources/moulberry.key differ -- cgit From c1e711d270693e198781f3b6591f95c14eb5a6d1 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Thu, 13 Oct 2022 22:21:01 +0200 Subject: NPE Fix (#364) prevent an npe Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../notenoughupdates/miscfeatures/CustomItemEffects.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java index c77a4b39..452f8a9b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java @@ -213,12 +213,14 @@ public class CustomItemEffects { @SubscribeEvent public void onGameTick(TickEvent.ClientTickEvent event) { if (event.phase != TickEvent.Phase.END) return; + EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; + if (player == null) return; if (!usingEtherwarp && wasUsingEtherwarp) { - if (Minecraft.getMinecraft().thePlayer.rotationYaw > 0) { - Minecraft.getMinecraft().thePlayer.rotationYaw -= 0.000001; + if (player.rotationYaw > 0) { + player.rotationYaw -= 0.000001; } else { - Minecraft.getMinecraft().thePlayer.rotationYaw += 0.000001; + player.rotationYaw += 0.000001; } } wasUsingEtherwarp = usingEtherwarp; -- cgit From 42db45e304100b0cb523a77ba0a4eeabb8643f40 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sat, 15 Oct 2022 12:46:30 +0000 Subject: Disable neu hax when not in skyblock (#373) Less cheat mod --- .../io/github/moulberry/notenoughupdates/listener/ChatListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java index de37b976..3473124c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java @@ -214,7 +214,7 @@ public class ChatListener { SlayerOverlay.unloadOverlayTimer = System.currentTimeMillis(); } else if (unformatted.startsWith("You consumed a Booster Cookie!")) { CookieWarning.resetNotification(); - } else if (unformatted.startsWith("QUICK MATHS! Solve:")) { + } else if (unformatted.startsWith("QUICK MATHS! Solve:") && NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) { if (Math.random() < 0.2) { if (NotEnoughUpdates.INSTANCE.config.misc.calculationMode == 2) { ClientCommandHandler.instance.executeCommand( -- cgit From df02addf3404f07f245d6e6da8ce3ee8d72bd235 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Sat, 15 Oct 2022 12:48:00 +0000 Subject: Fix pv crash when in f7 (#366) Fix pv crash when your in f7??? --- .../notenoughupdates/profileviewer/GuiProfileViewer.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 094f3892..98f186cb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -767,9 +767,13 @@ public class GuiProfileViewer extends GuiScreen { if (mouseX > x && mouseX < x + 28) { if (mouseY > y && mouseY < y + 32) { - tooltipToDisplay = Collections.singletonList(iPage.stack + if (!iPage.stack .getTooltip(Minecraft.getMinecraft().thePlayer, false) - .get(0)); + .isEmpty()) { + tooltipToDisplay = Collections.singletonList(iPage.stack + .getTooltip(Minecraft.getMinecraft().thePlayer, false) + .get(0)); + } } } } -- cgit From e7c363583a42f86584a0b0f289946357d914f52e Mon Sep 17 00:00:00 2001 From: Vixid <52578495+Vixid1@users.noreply.github.com> Date: Wed, 19 Oct 2022 08:46:27 +0100 Subject: Merge pull request #360 * Fixed buggy cape in /pv --- .../io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java index a72e0a24..a6457df3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java @@ -802,6 +802,9 @@ public class BasicPage extends GuiProfileViewerPage { } private void drawEntityOnScreen(int posX, int posY, int scale, float mouseX, float mouseY, EntityLivingBase ent) { + + ent.onUpdate(); + GlStateManager.enableColorMaterial(); GlStateManager.pushMatrix(); GlStateManager.translate((float) posX, (float) posY, 50.0F); -- cgit From 16d4c5cfe51d65601833c6897c1cca7a852c616c Mon Sep 17 00:00:00 2001 From: Moulberry Date: Wed, 19 Oct 2022 16:14:55 +0800 Subject: reclaim notenoughupdates from the leftoids --- .github/CODE_OF_CONDUCT.md | 3 --- 1 file changed, 3 deletions(-) delete mode 100644 .github/CODE_OF_CONDUCT.md diff --git a/.github/CODE_OF_CONDUCT.md b/.github/CODE_OF_CONDUCT.md deleted file mode 100644 index e91612f1..00000000 --- a/.github/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,3 +0,0 @@ -# Contributor Code of Conduct - -Don't be a jerk. -- cgit From b967e1be50e31decfea30e08b4bf074eaed36e98 Mon Sep 17 00:00:00 2001 From: Nico Mexis Date: Wed, 19 Oct 2022 12:25:41 +0200 Subject: Update workflow actions (#378) --- .github/workflows/build.yml | 6 +++--- .github/workflows/infer.yml | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 639d3965..d610b4d5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -30,7 +30,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 - name: Send discord notification id: sendmsg if: ${{ env.WEBHOOK_URL }} @@ -39,14 +39,14 @@ jobs: env: STATUS: WORKING - name: Set up JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: 17 distribution: temurin cache: gradle - name: Build with Gradle run: chmod +x ./gradlew && ./gradlew clean test remapJar --no-daemon - - uses: actions/upload-artifact@v2 + - uses: actions/upload-artifact@v3 with: path: build/libs/*-dep.jar - name: Update discord notification diff --git a/.github/workflows/infer.yml b/.github/workflows/infer.yml index 365e748b..7a035a42 100644 --- a/.github/workflows/infer.yml +++ b/.github/workflows/infer.yml @@ -8,12 +8,12 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 name: Checkout feature with: ref: ${{ github.event.pull_request.head.sha }} - name: Set up JDK 17 - uses: actions/setup-java@v2 + uses: actions/setup-java@v3 with: java-version: 17 distribution: temurin @@ -27,7 +27,7 @@ jobs: infer capture -- ./gradlew clean test --no-daemon infer analyze cp infer-out/report.json ciwork/report-feature.json - - uses: actions/checkout@v2 + - uses: actions/checkout@v3 name: Checkout base with: ref: ${{ github.event.pull_request.base.sha }} -- cgit From 04f8a44c150ab46997bbde53b8a4cf65aaa39327 Mon Sep 17 00:00:00 2001 From: Vixid <52578495+Vixid1@users.noreply.github.com> Date: Wed, 19 Oct 2022 11:25:53 +0100 Subject: Couple minor bug fixes (#377) --- .../moulberry/notenoughupdates/miscfeatures/DamageCommas.java | 2 +- .../notenoughupdates/profileviewer/ProfileViewer.java | 10 ++++++++++ .../io/github/moulberry/notenoughupdates/util/ItemUtils.java | 2 ++ 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java index b1ab11c1..04d97747 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java @@ -88,7 +88,7 @@ public class DamageCommas { if (matcherNoCrit.matches()) { numbers = matcherNoCrit.group(2).replace(",", ""); prefix = matcherNoCrit.group(1); - suffix = "\u00A7r" + matcherNoCrit.group(3); + suffix = "\u00A7r" + (matcherNoCrit.group(3).contains("♞") ? "\u00A7d" + matcherNoCrit.group(3) : matcherNoCrit.group(3)); } else { replacementMap.put(entity, null); return name; 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 4aeafb9e..a43e2b98 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ProfileViewer.java @@ -1033,6 +1033,7 @@ public class ProfileViewer { if (profileInfo == null) return null; if (profileName == null) profileName = latestProfile; + List coopProfileInfo = getCoopProfileInformation(profileName); if (skyblockInfoCache.containsKey(profileName)) return skyblockInfoCache.get(profileName); JsonObject leveling = Constants.LEVELING; @@ -1062,6 +1063,15 @@ public class ProfileViewer { Utils.getElement(profileInfo, "experience_skill_" + (skillName.equals("social") ? "social2" : skillName)), 0 ); + // Get the coop's social skill experience since social is a shared skill + if (skillName.equals("social")) { + for (JsonObject coopProfile : coopProfileInfo) { + skillExperience += Utils.getElementAsFloat( + Utils.getElement(coopProfile, "experience_skill_social2"), + 0 + ); + } + } totalSkillXP += skillExperience; JsonArray levelingArray = Utils.getElement(leveling, "leveling_xp").getAsJsonArray(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java index 8b81d1b4..6187495c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ItemUtils.java @@ -250,6 +250,7 @@ public class ItemUtils { for (int i = 0; i < newLore.size(); i++) { String cleaned = Utils.cleanColour(newLore.get(i)); if (cleaned.equals("Right-click to add this pet to")) { + if (heldItem == null) newLore.remove(i + 2); newLore.remove(i + 1); newLore.remove(i); secondLastBlankLine = i - 1; @@ -277,6 +278,7 @@ public class ItemUtils { petItemLore.add(""); } petItemLore.add("§a(" + currentPet.candyUsed + "/10) Pet Candy Used"); + if (heldItem == null) petItemLore.add(""); } newLore.addAll(secondLastBlankLine + 1, petItemLore); } -- cgit From 744e2268e5debc773114579d118069cbc8aa288d Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Wed, 19 Oct 2022 03:52:00 -0700 Subject: Update DevTestCommand developer check (#351) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update DevTestCommand.java Update DEV_TESTERS to be UUID based rather than string literals of usernames. Update logic to check for UUIDs rather than usernames. * Add Detection for developer environment Add a check for if they are using a deobfuscatedEnvironment, which would allow them to use the dev commands. Thanks @romangraef Co-Authored-By: Roman / Linnea Gräf * Update DevTestCommand.java * Revert Last Change * Add egirlefe per request * Add efefury per request Co-authored-by: Roman / Linnea Gräf --- .../commands/dev/DevTestCommand.java | 30 ++++++++++++---------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java index 972557c8..c4c8a408 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java @@ -34,6 +34,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.gui.GuiScreen; import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; +import net.minecraft.launchwrapper.Launch; import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; @@ -48,18 +49,20 @@ public class DevTestCommand extends ClientCommandBase { private static final List DEV_TESTERS = Arrays.asList( - "moulberry", - "lucycoconut", - "ironm00n", - "ariyio", - "throwpo", - "lrg89", - "dediamondpro", - "lulonaut", - "craftyoldminer", - "eisengolem", - "whalker", - "ascynx" + "d0e05de7-6067-454d-beae-c6d19d886191", // moulberry + "66502b40-6ac1-4d33-950d-3df110297aab", // lucycoconut + "a5761ff3-c710-4cab-b4f4-3e7f017a8dbf", // ironm00n + "5d5c548a-790c-4fc8-bd8f-d25b04857f44", // ariyio + "53924f1a-87e6-4709-8e53-f1c7d13dc239", // throwpo + "d3cb85e2-3075-48a1-b213-a9bfb62360c1", // lrg89 + "0b4d470f-f2fb-4874-9334-1eaef8ba4804", // dediamondpro + "ebb28704-ed85-43a6-9e24-2fe9883df9c2", // lulonaut + "698e199d-6bd1-4b10-ab0c-52fedd1460dc", // craftyoldminer + "8a9f1841-48e9-48ed-b14f-76a124e6c9df", // eisengolem + "a7d6b3f1-8425-48e5-8acc-9a38ab9b86f7", // whalker + "0ce87d5a-fa5f-4619-ae78-872d9c5e07fe", // ascynx + "a049a538-4dd8-43f8-87d5-03f09d48b4dc", // egirlefe + "7a9dc802-d401-4d7d-93c0-8dd1bc98c70d" // efefury ); private static final String[] DEV_FAIL_STRINGS = { @@ -88,7 +91,8 @@ public class DevTestCommand extends ClientCommandBase { @Override public void processCommand(ICommandSender sender, String[] args) throws CommandException { - if (!DEV_TESTERS.contains(Minecraft.getMinecraft().thePlayer.getName().toLowerCase())) { + if (!DEV_TESTERS.contains(Minecraft.getMinecraft().thePlayer.getUniqueID().toString()) + && !(boolean) Launch.blackboard.get("fml.deobfuscatedEnvironment")) { if (devFailIndex >= DEV_FAIL_STRINGS.length) { throw new Error("L") { @Override -- cgit From abe0de1d3e0a6fbc0d43c51cd5371189fda27e16 Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Wed, 19 Oct 2022 04:46:12 -0700 Subject: Fixed /join not always going to Master Mode (#356) --- .../moulberry/notenoughupdates/commands/dungeon/JoinDungeonCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dungeon/JoinDungeonCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dungeon/JoinDungeonCommand.java index d69f86f3..c1f88942 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dungeon/JoinDungeonCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dungeon/JoinDungeonCommand.java @@ -44,7 +44,7 @@ public class JoinDungeonCommand extends ClientCommandBase { EnumChatFormatting.RED + "Example Usage: /join f7, /join m6 or /join 7")); } else { String cataPrefix = "catacombs"; - if (args[0].startsWith("m")) { + if (args[0].toLowerCase().startsWith("m")) { cataPrefix = "master_catacombs"; } String cmd = "/joindungeon " + cataPrefix + " " + args[0].charAt(args[0].length() - 1); -- cgit From a465173177f859f193ba014c77f0e10e7b9112e4 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 19 Oct 2022 12:12:40 +0000 Subject: Fix crash when a list config option doesnt have that many options (generally from downgrading) (#371) --- .../core/config/gui/GuiOptionEditorDraggableList.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java index 63a932b5..d3b9c04d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDraggableList.java @@ -72,6 +72,10 @@ public class GuiOptionEditorDraggableList extends GuiOptionEditor { int height = super.getHeight() + 13; for (int strIndex : activeText) { + if (strIndex >= exampleText.length) { + activeText.remove((Integer) strIndex); + break; + } String str = exampleText[strIndex]; height += 10 * str.split("\n").length; } -- cgit From 9a5cca0eaba26c40c9e2e88148bda2be161e1d70 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 19 Oct 2022 13:08:31 +0000 Subject: Remove the extra bar textures as fsr never used them (#361) --- .../notenoughupdates/core/GuiElementBoolean.java | 14 +++----------- .../moulberry/notenoughupdates/util/GuiTextures.java | 4 ---- .../resources/assets/notenoughupdates/core/bar_1.png | Bin 2095 -> 0 bytes .../resources/assets/notenoughupdates/core/bar_2.png | Bin 2095 -> 0 bytes .../resources/assets/notenoughupdates/core/bar_3.png | Bin 2095 -> 0 bytes .../resources/assets/notenoughupdates/core/bar_on.png | Bin 2095 -> 0 bytes 6 files changed, 3 insertions(+), 15 deletions(-) delete mode 100644 src/main/resources/assets/notenoughupdates/core/bar_1.png delete mode 100644 src/main/resources/assets/notenoughupdates/core/bar_2.png delete mode 100644 src/main/resources/assets/notenoughupdates/core/bar_3.png delete mode 100644 src/main/resources/assets/notenoughupdates/core/bar_on.png diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementBoolean.java b/src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementBoolean.java index b0586210..11547aaa 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementBoolean.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementBoolean.java @@ -26,7 +26,6 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.util.ResourceLocation; import org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; import java.util.function.Consumer; @@ -63,8 +62,10 @@ public class GuiElementBoolean extends GuiElement { @Override public void render() { GlStateManager.color(1, 1, 1, 1); + Minecraft.getMinecraft().getTextureManager().bindTexture(GuiTextures.BAR); + RenderUtils.drawTexturedRect(x, y, xSize, ySize); + ResourceLocation buttonLoc = GuiTextures.ON; - ResourceLocation barLoc = GuiTextures.BAR_ON; long currentMillis = System.currentTimeMillis(); long deltaMillis = currentMillis - lastMillis; lastMillis = currentMillis; @@ -101,25 +102,16 @@ public class GuiElementBoolean extends GuiElement { int animation = (int) (LerpUtils.sigmoidZeroOne(this.animation / 36f) * 36); if (animation < 3) { buttonLoc = GuiTextures.OFF; - barLoc = GuiTextures.BAR; } else if (animation < 13) { buttonLoc = GuiTextures.ONE; - barLoc = GuiTextures.BAR_ONE; } else if (animation < 23) { buttonLoc = GuiTextures.TWO; - barLoc = GuiTextures.BAR_TWO; } else if (animation < 33) { buttonLoc = GuiTextures.THREE; - barLoc = GuiTextures.BAR_THREE; } - GL11.glTranslatef(0, 0, 100); Minecraft.getMinecraft().getTextureManager().bindTexture(buttonLoc); RenderUtils.drawTexturedRect(x + animation, y, 12, 14); - GL11.glTranslatef(0, 0, -100); - - Minecraft.getMinecraft().getTextureManager().bindTexture(barLoc); - RenderUtils.drawTexturedRect(x, y, xSize, ySize); } @Override diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/GuiTextures.java b/src/main/java/io/github/moulberry/notenoughupdates/util/GuiTextures.java index 3ead5a56..062e65e2 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/GuiTextures.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/GuiTextures.java @@ -101,10 +101,6 @@ public class GuiTextures { new ResourceLocation("notenoughupdates:descending_overlay.png"); public static final ResourceLocation BAR = new ResourceLocation("notenoughupdates:core/bar.png"); - public static final ResourceLocation BAR_ONE = new ResourceLocation("notenoughupdates:core/bar_1.png"); - public static final ResourceLocation BAR_TWO = new ResourceLocation("notenoughupdates:core/bar_2.png"); - public static final ResourceLocation BAR_THREE = new ResourceLocation("notenoughupdates:core/bar_3.png"); - public static final ResourceLocation BAR_ON = new ResourceLocation("notenoughupdates:core/bar_on.png"); public static final ResourceLocation OFF = new ResourceLocation("notenoughupdates:core/toggle_off.png"); public static final ResourceLocation ONE = new ResourceLocation("notenoughupdates:core/toggle_1.png"); public static final ResourceLocation TWO = new ResourceLocation("notenoughupdates:core/toggle_2.png"); diff --git a/src/main/resources/assets/notenoughupdates/core/bar_1.png b/src/main/resources/assets/notenoughupdates/core/bar_1.png deleted file mode 100644 index 664c0f32..00000000 Binary files a/src/main/resources/assets/notenoughupdates/core/bar_1.png and /dev/null differ diff --git a/src/main/resources/assets/notenoughupdates/core/bar_2.png b/src/main/resources/assets/notenoughupdates/core/bar_2.png deleted file mode 100644 index 664c0f32..00000000 Binary files a/src/main/resources/assets/notenoughupdates/core/bar_2.png and /dev/null differ diff --git a/src/main/resources/assets/notenoughupdates/core/bar_3.png b/src/main/resources/assets/notenoughupdates/core/bar_3.png deleted file mode 100644 index 664c0f32..00000000 Binary files a/src/main/resources/assets/notenoughupdates/core/bar_3.png and /dev/null differ diff --git a/src/main/resources/assets/notenoughupdates/core/bar_on.png b/src/main/resources/assets/notenoughupdates/core/bar_on.png deleted file mode 100644 index 664c0f32..00000000 Binary files a/src/main/resources/assets/notenoughupdates/core/bar_on.png and /dev/null differ -- cgit From 537d5e5fa1ae41e0c3bbe43d745a1b683e078a87 Mon Sep 17 00:00:00 2001 From: Ascynx <78341107+Ascynx@users.noreply.github.com> Date: Wed, 19 Oct 2022 18:40:59 +0200 Subject: Will now actually set up the pickaxe cooldown on first world joined (#355) --- .../notenoughupdates/miscfeatures/ItemCooldowns.java | 11 ++++++++++- .../moulberry/notenoughupdates/overlays/MiningOverlay.java | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java index f2b13abc..f68f3c58 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemCooldowns.java @@ -40,6 +40,10 @@ public class ItemCooldowns { private static final Map durabilityOverrideMap = new HashMap<>(); public static long pickaxeUseCooldownMillisRemaining = -1; private static long treecapitatorCooldownMillisRemaining = -1; + + public static boolean firstLoad = true; + public static long firstLoadMillis = 0; + private static long lastMillis = 0; public static long pickaxeCooldown = -1; @@ -57,6 +61,11 @@ public class ItemCooldowns { } long currentTime = System.currentTimeMillis(); + if (firstLoad) { + firstLoadMillis = currentTime; + firstLoad = false; + } + Long key; while ((key = blocksClicked.floorKey(currentTime - 1500)) != null) { @@ -78,7 +87,7 @@ public class ItemCooldowns { } @SubscribeEvent - public void onWorldUnload(WorldEvent.Load event) { + public void onWorldLoad(WorldEvent.Load event) { blocksClicked.clear(); if (pickaxeCooldown > 0) pickaxeUseCooldownMillisRemaining = 60 * 1000; pickaxeCooldown = -1; 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 03fe9eff..4fe3aa8d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java @@ -397,6 +397,12 @@ public class MiningOverlay extends TextTabOverlay { } } + if (ItemCooldowns.firstLoadMillis > 0) { + //set cooldown on first skyblock load. + ItemCooldowns.pickaxeUseCooldownMillisRemaining = 60 * 1000 - (System.currentTimeMillis() - ItemCooldowns.firstLoadMillis); + ItemCooldowns.firstLoadMillis = 0; + } + String pickaxeCooldown; if (ItemCooldowns.pickaxeUseCooldownMillisRemaining <= 0) { pickaxeCooldown = DARK_AQUA + "Pickaxe CD: \u00a7aReady"; -- cgit From 2d29717e7d83f851df40410540515fae51bb7550 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Wed, 19 Oct 2022 23:39:37 +0200 Subject: contributing (#381) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- CONTRIBUTING.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index e7c4b379..3e388cf5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,10 +2,10 @@ ## Before you contribute -- Please check your feature / bug isn't already fixed in one of our pre-releases or on [the development branch](https://github.com/NotEnoughUpdates/NotEnoughUpdates/tree/master/). +- Please check your feature / bug isn't already fixed in one of our pre-releases, on the [development branch](https://github.com/NotEnoughUpdates/NotEnoughUpdates/tree/master/) or in an open [pull request](https://github.com/NotEnoughUpdates/NotEnoughUpdates/pulls) - Consider joining our [Discord](https://discord.gg/moulberry) to check in on newest developments by other people, or to get help with problems you encounter. -- Please check that your feature idea complies with the [Hypixel Rules](https://hypixel.net/rules) -- Check that your feature idea isn't already done in other mods. (E.g. Dungeon Solver) +- Please check that your feature idea complies with the [Hypixel Rules](https://hypixel.net/rules). (See these Hypixel forum posts for extra information: [Mods in SkyBlock](https://hypixel.net/threads/regarding-the-recent-announcement-with-mods-in-skyblock.4045481/), [QoL Modifications](https://hypixel.net/threads/update-to-disallowed-modifications-qol-modifications.4043482/), [Modifications Sending Invalid Clicks](https://hypixel.net/threads/update-regarding-modifications-sending-invalid-clicks.5130489/)) +- Make sure that your feature idea is not already implemented in another non-paid mod. (E.g. Dungeon Solver) ## Setting up a development environment -- cgit From 90d3fcd1667f12fe0bfe3e311c4739266274a620 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Wed, 19 Oct 2022 21:40:19 +0000 Subject: Added optifine to /neustats (#380) --- .../io/github/moulberry/notenoughupdates/commands/dev/StatsCommand.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/StatsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/StatsCommand.java index 756afc88..943adda6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/StatsCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/StatsCommand.java @@ -31,6 +31,7 @@ import net.minecraft.util.BlockPos; import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraftforge.common.ForgeVersion; +import net.minecraftforge.fml.client.FMLClientHandler; import net.minecraftforge.fml.common.Loader; import org.lwjgl.opengl.Display; import org.lwjgl.opengl.GL11; @@ -164,6 +165,7 @@ public class StatsCommand extends ClientCommandBase { builder.append("FPS", String.valueOf(Minecraft.getDebugFPS())); builder.append("Loaded Mods", String.valueOf(activeModCount)); builder.append("Forge", ForgeVersion.getVersion()); + builder.append("Optifine", FMLClientHandler.instance().hasOptifine() ? "TRUE" : "FALSE"); builder.category("Neu Settings"); builder.append("API Key", NotEnoughUpdates.INSTANCE.config.apiData.apiKey.isEmpty() ? "FALSE" : "TRUE"); builder.append("On Skyblock", NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() ? "TRUE" : "FALSE"); -- cgit From 498b8d8a7dbef859cd5829fceee7f83dbe69d870 Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Wed, 19 Oct 2022 15:07:27 -0700 Subject: Miscellaneous Typos (#339) Co-authored-by: MicrocontrollersDev <66657148+MicrocontrollersDev@users.noreply.github.com> --- .../notenoughupdates/commands/dev/DevTestCommand.java | 2 +- .../notenoughupdates/commands/dev/StatsCommand.java | 2 +- .../notenoughupdates/commands/help/HelpCommand.java | 16 ++++++++-------- .../notenoughupdates/commands/misc/AhCommand.java | 4 ++-- .../notenoughupdates/commands/misc/CosmeticsCommand.java | 2 +- .../notenoughupdates/commands/misc/CustomizeCommand.java | 2 +- .../notenoughupdates/commands/misc/UpdateCommand.java | 2 +- .../notenoughupdates/commands/profile/PeekCommand.java | 8 ++++---- .../commands/profile/ViewProfileCommand.java | 8 ++++---- .../notenoughupdates/miscgui/CalendarOverlay.java | 6 +++--- .../options/seperateSections/AHTweaks.java | 4 ++-- .../options/seperateSections/ApiData.java | 2 +- .../options/seperateSections/Calendar.java | 2 +- .../options/seperateSections/Dungeons.java | 2 +- .../options/seperateSections/ImprovedSBMenu.java | 6 +++--- .../options/seperateSections/LocationEdit.java | 2 +- .../notenoughupdates/options/seperateSections/Misc.java | 10 +++++----- .../options/seperateSections/TradeMenu.java | 2 +- .../notenoughupdates/overlays/MiningOverlay.java | 2 +- .../notenoughupdates/profileviewer/BasicPage.java | 2 +- .../notenoughupdates/profileviewer/GuiProfileViewer.java | 2 +- src/main/resources/mcmod.info | 2 +- 22 files changed, 45 insertions(+), 45 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java index c4c8a408..138486c3 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/DevTestCommand.java @@ -191,7 +191,7 @@ public class DevTestCommand extends ClientCommandBase { "Opening gui: " + NotEnoughUpdates.INSTANCE.openGui)); } catch (InstantiationException | IllegalAccessException | ClassNotFoundException | ClassCastException e) { e.printStackTrace(); - Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("Failed to open this gui.")); + Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText("Failed to open this GUI.")); } } if (args.length == 1 && args[0].equalsIgnoreCase("center")) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/StatsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/StatsCommand.java index 943adda6..e9d4eb44 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/StatsCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/dev/StatsCommand.java @@ -168,7 +168,7 @@ public class StatsCommand extends ClientCommandBase { builder.append("Optifine", FMLClientHandler.instance().hasOptifine() ? "TRUE" : "FALSE"); builder.category("Neu Settings"); builder.append("API Key", NotEnoughUpdates.INSTANCE.config.apiData.apiKey.isEmpty() ? "FALSE" : "TRUE"); - builder.append("On Skyblock", NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() ? "TRUE" : "FALSE"); + builder.append("On SkyBlock", NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard() ? "TRUE" : "FALSE"); builder.append( "Mod Version", Loader.instance().getIndexedModList().get(NotEnoughUpdates.MODID).getDisplayVersion() diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/HelpCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/HelpCommand.java index 7655f561..49123f45 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/help/HelpCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/help/HelpCommand.java @@ -38,7 +38,7 @@ public class HelpCommand extends ClientCommandBase { public void processCommand(ICommandSender sender, String[] args) { ArrayList neuHelpMessages = Lists.newArrayList( "\u00a75\u00a7lNotEnoughUpdates commands", - "\u00a76/neu \u00a77- Opens the main neu GUI.", + "\u00a76/neu \u00a77- Opens the main NEU GUI.", "\u00a76/pv \u00a7b?{name} \u00a72\u2D35 \u00a7r\u00a77- Opens the profile viewer", "\u00a76/neusouls {on/off/clear/unclear} \u00a7r\u00a77- Shows waypoints to fairy souls.", "\u00a76/neubuttons \u00a7r\u00a77- Opens a GUI which allows you to customize inventory buttons.", @@ -46,19 +46,19 @@ public class HelpCommand extends ClientCommandBase { "\u00a76/join {floor} \u00a7r\u00a77- Short Command to join a Dungeon. \u00a7lNeed a Party of 5 People\u00a7r\u00a77 {4/f7/m5}.", "\u00a76/neucosmetics \u00a7r\u00a77- Opens the cosmetic GUI.", "\u00a76/neurename \u00a7r\u00a77- Opens the NEU Item Customizer.", - "\u00a76/cata \u00a7b?{name} \u00a72\u2D35 \u00a7r\u00a77- Opens the profile viewer's catacombs page.", - "\u00a76/neulinks \u00a7r\u00a77- Shows links to neu/moulberry.", + "\u00a76/cata \u00a7b?{name} \u00a72\u2D35 \u00a7r\u00a77- Opens the profile viewer's Catacombs page.", + "\u00a76/neulinks \u00a7r\u00a77- Shows links to NEU/Moulberry.", "\u00a76/neuoverlay \u00a7r\u00a77- Opens GUI Editor for quickcommands and searchbar.", - "\u00a76/neuah \u00a7r\u00a77- Opens neu's custom ah GUI.", - "\u00a76/neucalendar \u00a7r\u00a77- Opens neu's custom calendar GUI.", + "\u00a76/neuah \u00a7r\u00a77- Opens NEU's custom auction house GUI.", + "\u00a76/neucalendar \u00a7r\u00a77- Opens NEU's custom calendar GUI.", "\u00a76/neucalc \u00a7r\u00a77- Run calculations.", "", "\u00a76\u00a7lOld commands:", - "\u00a76/peek \u00a7b?{user} \u00a72\u2D35 \u00a7r\u00a77- Shows quickly stats for a user.", + "\u00a76/peek \u00a7b?{user} \u00a72\u2D35 \u00a7r\u00a77- Shows quick stats for a user.", "", "\u00a76\u00a7lDebug commands:", "\u00a76/neustats \u00a7r\u00a77- Copies helpful info to the clipboard.", - "\u00a76/neustats modlist \u00a7r\u00a77- Copies modlist info to clipboard.", + "\u00a76/neustats modlist \u00a7r\u00a77- Copies mod list info to clipboard.", "\u00a76/neuresetrepo \u00a7r\u00a77- Deletes all repo files.", "\u00a76/neureloadrepo \u00a7r\u00a77- Debug command with repo.", "", @@ -81,7 +81,7 @@ public class HelpCommand extends ClientCommandBase { } String[] helpInfo = { "", - "\u00a77Commands marked with a \u00a72\"\u2D35\"\u00a77 require are api key. You can set your api key via \"/api new\" or by manually putting it in the api field in \"/neu\"", + "\u00a77Commands marked with a \u00a72\"\u2D35\"\u00a77 require an api key. You can set your api key via \"/api new\" or by manually putting it in the api field in \"/neu\"", "", "\u00a77Arguments marked with a \u00a7b\"?\"\u00a77 are optional.", "", diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/AhCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/AhCommand.java index bd8abf1d..d51d4d2e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/AhCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/AhCommand.java @@ -39,11 +39,11 @@ public class AhCommand extends ClientCommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + - "You must be on Skyblock to use this feature.")); + "You must be on SkyBlock to use this feature.")); } else if (NotEnoughUpdates.INSTANCE.config.apiData.apiKey == null || NotEnoughUpdates.INSTANCE.config.apiData.apiKey.trim().isEmpty()) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + - "Can't open NeuAH, apikey is not set. Run /api new and put the result in settings.")); + "Can't open NEU AH: an api key is not set. Run /api new and put the result in settings.")); } else { NotEnoughUpdates.INSTANCE.openGui = new CustomAHGui(); NotEnoughUpdates.INSTANCE.manager.auctionManager.customAH.lastOpen = System.currentTimeMillis(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/CosmeticsCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/CosmeticsCommand.java index f74b5813..67430ffa 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/CosmeticsCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/CosmeticsCommand.java @@ -39,7 +39,7 @@ public class CosmeticsCommand extends ClientCommandBase { public void processCommand(ICommandSender sender, String[] args) throws CommandException { if (!OpenGlHelper.isFramebufferEnabled() && NotEnoughUpdates.INSTANCE.config.notifications.doFastRenderNotif) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + - "NEU cosmetics do not work with OF Fast Render. Go to ESC > Options > Video Settings > Performance > Fast Render to disable it.")); + "NEU Cosmetics do not work with OptiFine Fast Render. Go to ESC > Options > Video Settings > Performance > Fast Render to disable it.")); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/CustomizeCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/CustomizeCommand.java index cca6535e..2b184fa0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/CustomizeCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/CustomizeCommand.java @@ -54,7 +54,7 @@ public class CustomizeCommand extends ClientCommandBase { String heldUUID = NotEnoughUpdates.INSTANCE.manager.getUUIDForItem(held); if (heldUUID == null) { - sender.addChatMessage(new ChatComponentText("\u00a7cHeld item does not have UUID, cannot be customized")); + sender.addChatMessage(new ChatComponentText("\u00a7cHeld item does not have a UUID, so it cannot be customized")); return; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/UpdateCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/UpdateCommand.java index cac93369..81cf7e8f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/UpdateCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/UpdateCommand.java @@ -68,7 +68,7 @@ public class UpdateCommand extends ClientCommandBase { neu.autoUpdater.scheduleDownload(); break; case "updatemodes": - sender.addChatMessage(new ChatComponentText("§e[NEU] §bTo ensure we do not accidentally corrupt your mod folder, we can only offer support for autoupdates on system with certain capabilities for file deletions (specifically unix systems). You can still manually update your files")); + sender.addChatMessage(new ChatComponentText("§e[NEU] §bTo ensure we do not accidentally corrupt your mod folder, we can only offer support for auto-updates on system with certain capabilities for file deletions (specifically unix systems). You can still manually update your files")); break; default: displayHelp(sender); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java index 75e779fc..c1c184f6 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java @@ -68,7 +68,7 @@ public class PeekCommand extends ClientCommandBase { NotEnoughUpdates.profileViewer.getProfileByName(name, profile -> { if (profile == null) { Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText( - EnumChatFormatting.RED + "[PEEK] Unknown player or the api is down."), id); + EnumChatFormatting.RED + "[PEEK] Unknown player or the Hypixel API is down."), id); } else { profile.resetCache(); @@ -78,12 +78,12 @@ public class PeekCommand extends ClientCommandBase { if (peekScheduledFuture != null && !peekScheduledFuture.isDone()) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText( - EnumChatFormatting.RED + "[PEEK] New peek command run, cancelling old one.")); + EnumChatFormatting.RED + "[PEEK] New peek command was run, cancelling old one.")); peekScheduledFuture.cancel(true); } Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText( - EnumChatFormatting.YELLOW + "[PEEK] Getting the player's Skyblock profile(s)..."), id); + EnumChatFormatting.YELLOW + "[PEEK] Getting the player's SkyBlock profile(s)..."), id); long startTime = System.currentTimeMillis(); peekScheduledFuture = peekCommandExecutorService.schedule(new Runnable() { @@ -287,7 +287,7 @@ public class PeekCommand extends ClientCommandBase { } else if (overallScore > 2) { overall = EnumChatFormatting.YELLOW + "Ender Non"; } else if (overallScore > 1) { - overall = EnumChatFormatting.RED + "Played Skyblock"; + overall = EnumChatFormatting.RED + "Played SkyBlock"; } Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(g + "Overall score: " + diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/ViewProfileCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/ViewProfileCommand.java index e4ca497c..887cd28f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/ViewProfileCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/ViewProfileCommand.java @@ -39,18 +39,18 @@ public class ViewProfileCommand extends ClientCommandBase { public static final Consumer RUNNABLE = (args) -> { if (!OpenGlHelper.isFramebufferEnabled()) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + - "Some parts of the profile viewer do not work with OF Fast Render. Go to ESC > Options > Video Settings > Performance > Fast Render to disable it.")); + "Some parts of the profile viewer do not work with OptiFine Fast Render. Go to ESC > Options > Video Settings > Performance > Fast Render to disable it.")); } if (NotEnoughUpdates.INSTANCE.config.apiData.apiKey == null || NotEnoughUpdates.INSTANCE.config.apiData.apiKey.trim().isEmpty()) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + - "Can't view profile, apikey is not set. Run /api new and put the result in settings.")); + "Can't view profile, an API key is not set. Run /api new and put the result in settings.")); } else if (args.length == 0) { NotEnoughUpdates.profileViewer.getProfileByName(Minecraft.getMinecraft().thePlayer.getName(), profile -> { if (profile == null) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + - "Invalid player name/api key. Maybe api is down? Try /api new.")); + "Invalid player name/API key. Maybe the API is down? Try /api new.")); } else { profile.resetCache(); NotEnoughUpdates.INSTANCE.openGui = new GuiProfileViewer(profile); @@ -63,7 +63,7 @@ public class ViewProfileCommand extends ClientCommandBase { NotEnoughUpdates.profileViewer.getProfileByName(args[0], profile -> { if (profile == null) { Minecraft.getMinecraft().thePlayer.addChatMessage(new ChatComponentText(EnumChatFormatting.RED + - "Invalid player name/api key. Maybe api is down? Try /api new.")); + "Invalid player name/api key. Maybe the API is down? Try /api new.")); } else { profile.resetCache(); NotEnoughUpdates.INSTANCE.openGui = new GuiProfileViewer(profile); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java index b1a3dca9..5f5c4832 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java @@ -1332,7 +1332,7 @@ public class CalendarOverlay { if (mouseY >= guiTop + ySize + 2 && mouseY <= guiTop + ySize + 18) { tooltipToDisplay = new ArrayList<>(); tooltipToDisplay.add(EnumChatFormatting.AQUA + "NEU Calendar Help"); - tooltipToDisplay.add(EnumChatFormatting.YELLOW + "This calendar displays various skyblock events"); + tooltipToDisplay.add(EnumChatFormatting.YELLOW + "This calendar displays various SkyBlock events"); tooltipToDisplay.add(EnumChatFormatting.YELLOW + "'Daily' events are events that happen frequently"); tooltipToDisplay.add(EnumChatFormatting.YELLOW + "'Special' events are events that happen infrequently"); tooltipToDisplay.add(EnumChatFormatting.YELLOW + ""); @@ -1344,8 +1344,8 @@ public class CalendarOverlay { tooltipToDisplay.add(EnumChatFormatting.YELLOW + "is about to start and when it does start"); tooltipToDisplay.add(EnumChatFormatting.YELLOW + ""); tooltipToDisplay.add(EnumChatFormatting.DARK_GRAY + "In order to show crop types for Jacob's Farming"); - tooltipToDisplay.add(EnumChatFormatting.DARK_GRAY + "contest, visit the full skyblock calendar and go all"); - tooltipToDisplay.add(EnumChatFormatting.DARK_GRAY + "the way to the end of the skyblock year"); + tooltipToDisplay.add(EnumChatFormatting.DARK_GRAY + "contest, visit the full SkyBlock calendar and go all"); + tooltipToDisplay.add(EnumChatFormatting.DARK_GRAY + "the way to the end of the SkyBlock year"); Utils.drawHoveringText(tooltipToDisplay, mouseX, mouseY, width, height, -1, fr); tooltipToDisplay = null; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/AHTweaks.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/AHTweaks.java index 298ddeda..0068b531 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/AHTweaks.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/AHTweaks.java @@ -81,7 +81,7 @@ public class AHTweaks { @Expose @ConfigOption( name = "Enable Undercut BIN Warning", - desc = "Ask for confirmation when BINing an item for below X% of lowestbin" + desc = "Ask for confirmation when BINing an item for below X% of lowest bin" ) @ConfigEditorBoolean @ConfigAccordionId(id = 1) @@ -90,7 +90,7 @@ public class AHTweaks { @Expose @ConfigOption( name = "Enable Overcut BIN Warning", - desc = "Ask for confirmation when BINing an item for over X% of lowestbin" + desc = "Ask for confirmation when BINing an item for over X% of lowest bin" ) @ConfigEditorBoolean @ConfigAccordionId(id = 1) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ApiData.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ApiData.java index 9ed09ac3..e52b7d34 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ApiData.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ApiData.java @@ -31,7 +31,7 @@ public class ApiData { @Expose @ConfigOption( name = "Api Key", - desc = "Hypixel api key\nYou can run §a/api new§r to autofill this value." + desc = "Hypixel API key\nYou can run §a/api new§r to autofill this value." ) @ConfigEditorText public String apiKey = ""; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Calendar.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Calendar.java index fe593f56..f1debe28 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Calendar.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Calendar.java @@ -28,7 +28,7 @@ public class Calendar { @Expose @ConfigOption( name = "Event Notifications", - desc = "Display notifications for skyblock calendar events" + desc = "Display notifications for SkyBlock calendar events" ) @ConfigEditorBoolean public boolean eventNotifications = true; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java index c94bd181..3d84cebe 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java @@ -54,7 +54,7 @@ public class Dungeons { @Expose @ConfigOption( name = "Edit Dungeon Map", - desc = "The NEU dungeon map has it's own editor (/neumap).\n" + + desc = "The NEU dungeon map has its own editor (/neumap).\n" + "Click the button on the left to open it" ) @ConfigEditorButton( diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ImprovedSBMenu.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ImprovedSBMenu.java index 8216c892..bdb73fa9 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ImprovedSBMenu.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ImprovedSBMenu.java @@ -28,7 +28,7 @@ public class ImprovedSBMenu { @Expose @ConfigOption( name = "Enable Improved SB Menus", - desc = "Change the way that skyblock menus (eg. /sbmenu) look" + desc = "Change the way that SkyBlock menus (eg. /sbmenu) look" ) @ConfigEditorBoolean public boolean enableSbMenus = true; @@ -36,7 +36,7 @@ public class ImprovedSBMenu { @Expose @ConfigOption( name = "Menu Background Style", - desc = "Change the style of the background of skyblock menus" + desc = "Change the style of the background of SkyBlock menus" ) @ConfigEditorDropdown( values = { @@ -49,7 +49,7 @@ public class ImprovedSBMenu { @Expose @ConfigOption( name = "Button Background Style", - desc = "Change the style of the foreground elements in skyblock menus" + desc = "Change the style of the foreground elements in SkyBlock menus" ) @ConfigEditorDropdown( values = { 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 42316592..48214481 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 @@ -118,7 +118,7 @@ public class LocationEdit { @Expose @ConfigOption( name = "Edit Dwarven Overlay Position", - desc = "Change the position of the Dwarven Mines information Overlay (commisions, powder & forge statuses)" + desc = "Change the position of the Dwarven Mines information Overlay (commissions, powder & forge statuses)" ) @ConfigEditorButton( runnableId = 1, diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java index c6f00182..34495ae4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java @@ -33,8 +33,8 @@ import org.lwjgl.input.Keyboard; public class Misc { @Expose @ConfigOption( - name = "Only Show on Skyblock", - desc = "The item list and some other GUI elements will only show on skyblock" + name = "Only Show on SkyBlock", + desc = "The item list and some other GUI elements will only show on SkyBlock" ) @ConfigEditorBoolean public boolean onlyShowOnSkyblock = true; @@ -42,7 +42,7 @@ public class Misc { @Expose @ConfigOption( name = "Hide Potion Effects", - desc = "Hide the potion effects inside your inventory while on skyblock" + desc = "Hide the potion effects inside your inventory while on SkyBlock" ) @ConfigEditorBoolean public boolean hidePotionEffect = true; @@ -126,7 +126,7 @@ public class Misc { @Expose @ConfigOption( name = "Damage Indicator Style", - desc = "Change Skyblock damage indicators to use shortened numbers\n" + + desc = "Change SkyBlock damage indicators to use shortened numbers\n" + "\u00A7cSome old animations mods break this feature" ) @ConfigEditorBoolean @@ -145,7 +145,7 @@ public class Misc { @ConfigOption( name = "Edit Enchant Colours", - desc = "Change the colours of certain skyblock enchants (/neuec)" + desc = "Change the colours of certain SkyBlock enchants (/neuec)" ) @ConfigEditorButton(runnableId = 8, buttonText = "Open") public boolean editEnchantColoursButton = true; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TradeMenu.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TradeMenu.java index d2b4e0bb..88f713c4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TradeMenu.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TradeMenu.java @@ -27,7 +27,7 @@ public class TradeMenu { @Expose @ConfigOption( name = "Enable Custom Trade Menu", - desc = "When trading with other players in skyblock, display a special GUI designed to prevent scamming" + desc = "When trading with other players in SkyBlock, display a special GUI designed to prevent scamming" ) @ConfigEditorBoolean public boolean enableCustomTrade = true; 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 4fe3aa8d..60d9b607 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningOverlay.java @@ -258,7 +258,7 @@ public class MiningOverlay extends TextTabOverlay { // These strings will be displayed one after the other when the player list is disabled String mithrilPowder = RED + "[NEU] Failed to get data from your tablist"; - String gemstonePowder = RED + "Please enable player list info in your skyblock settings"; + String gemstonePowder = RED + "Please enable player list info in your SkyBlock settings"; int forgeInt = 0; boolean commissions = false; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java index a6457df3..806b1bff 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java @@ -271,7 +271,7 @@ public class BasicPage extends GuiProfileViewerPage { getInstance().tooltipToDisplay.add( EnumChatFormatting.RED + "is where we get the amount of IRL money you"); getInstance().tooltipToDisplay.add( - EnumChatFormatting.RED + "theoretically have on skyblock in net worth."); + EnumChatFormatting.RED + "theoretically have on SkyBlock in net worth."); } else { getInstance().tooltipToDisplay.add(EnumChatFormatting.GRAY + "[SHIFT for Info]"); } 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 98f186cb..8e4dc634 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -738,7 +738,7 @@ public class GuiProfileViewer extends GuiScreen { break; case NO_SKYBLOCK: Utils.drawStringCentered( - EnumChatFormatting.RED + "No skyblock data found!", + EnumChatFormatting.RED + "No SkyBlock data found!", Minecraft.getMinecraft().fontRendererObj, guiLeft + sizeX / 2f, guiTop + 101, diff --git a/src/main/resources/mcmod.info b/src/main/resources/mcmod.info index 70f63a48..55b5f9c6 100644 --- a/src/main/resources/mcmod.info +++ b/src/main/resources/mcmod.info @@ -2,7 +2,7 @@ { "modid": "notenoughupdates", "name": "NotEnoughUpdates", - "description": "Mod that shows recipes and useful info for Hypixel's Skyblock gamemode.", + "description": "Mod that shows recipes and useful info for Hypixel's SkyBlock gamemode.", "version": "${version}", "mcversion": "${mcversion}", "url": "https://github.com/NotEnoughUpdates/NotEnoughUpdates/", -- cgit From 4a2fd29dc58c4eff427571409c03141f13272be9 Mon Sep 17 00:00:00 2001 From: Ascynx <78341107+Ascynx@users.noreply.github.com> Date: Thu, 20 Oct 2022 02:42:25 +0200 Subject: If above 100% of price will show actual added percentage (#369) --- .../moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java | 2 +- .../moulberry/notenoughupdates/options/seperateSections/AHTweaks.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java index ad9df7af..75813700 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AuctionBINWarning.java @@ -234,7 +234,7 @@ public class AuctionBINWarning extends GuiElement { ); TextRenderUtils.drawStringCenteredScaledMaxWidth( "\u00a76" + sellingPriceStr + "\u00a7r coins?" + - (lowestPrice > 0 ? "(\u00a7" + (isALoss ? "c-" : "a+") + buyPercentage + "%\u00a7r)" : ""), + (lowestPrice > 0 ? "(\u00a7" + (isALoss ? "c-" : "a+") + (buyPercentage >= 100 ? buyPercentage - 100 : buyPercentage) + "%\u00a7r)" : ""), Minecraft.getMinecraft().fontRendererObj, width / 2, height / 2 - 45 + 59, diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/AHTweaks.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/AHTweaks.java index 0068b531..f6aac507 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/AHTweaks.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/AHTweaks.java @@ -112,7 +112,7 @@ public class AHTweaks { @Expose @ConfigOption( name = "Overcut Warning Threshold", - desc = "Threshold for BIN warning\nExample: 50% means warn if sell price is 50% higher than lowest bin" + desc = "Threshold for BIN warning\nExample: 50% means warn if sell price is 50% higher than lowest bin\n\u00A7c\u00a7lWARNING: \u00A7r\u00A7c100% will if above lbin always trigger, 0% instead will never trigger" ) @ConfigEditorSlider( minValue = 0.0f, -- cgit From a12916560627d10a198a8835b97240374368c66a Mon Sep 17 00:00:00 2001 From: Josh <84826384+sharkey300@users.noreply.github.com> Date: Wed, 19 Oct 2022 17:43:09 -0700 Subject: added fishing ding for main lobby lava fishing (#352) --- .../github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 13a078a2..fff8d269 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/FishingHelper.java @@ -400,7 +400,7 @@ public class FishingHelper { return false; } - if ((particleType == EnumParticleTypes.WATER_WAKE || particleType == EnumParticleTypes.SMOKE_NORMAL) && Math.abs( + if ((particleType == EnumParticleTypes.WATER_WAKE || particleType == EnumParticleTypes.SMOKE_NORMAL || particleType == EnumParticleTypes.FLAME) && Math.abs( yOffset - 0.01f) < 0.001f) { double angle1 = calculateAngleFromOffsets(xOffset, -zOffset); double angle2 = calculateAngleFromOffsets(-xOffset, zOffset); -- cgit From 58509dd21c282d4e0cf2b0efb6095fcef93b21a1 Mon Sep 17 00:00:00 2001 From: Cobble8 <41165207+Cobble8@users.noreply.github.com> Date: Wed, 19 Oct 2022 20:45:51 -0400 Subject: Made it so the user could customize how long the mod waits before pau… (#359) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../options/seperateSections/SkillOverlays.java | 52 ++ .../overlays/CombatSkillOverlay.java | 2 +- .../notenoughupdates/overlays/FarmingOverlay.java | 544 --------------------- .../overlays/FarmingSkillOverlay.java | 544 +++++++++++++++++++++ .../overlays/FishingSkillOverlay.java | 2 +- .../overlays/MiningSkillOverlay.java | 2 +- .../notenoughupdates/overlays/OverlayManager.java | 4 +- 7 files changed, 601 insertions(+), 549 deletions(-) delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingOverlay.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java 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 943417e6..ca970a84 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 @@ -98,6 +98,19 @@ public class SkillOverlays { @ConfigAccordionId(id = 0) public boolean useBZPrice = true; + @Expose + @ConfigOption( + name = "Pause Timer", + desc = "How many seconds does it wait before pausing" + ) + @ConfigAccordionId(id = 0) + @ConfigEditorSlider( + minValue = 1, + maxValue = 20, + minStep = 1 + ) + public int farmingPauseTimer = 3; + @Expose @ConfigOption( name = "Edit Farming Overlay Position", @@ -157,6 +170,19 @@ public class SkillOverlays { @ConfigAccordionId(id = 1) public List miningText = new ArrayList<>(Arrays.asList(0, 8, 1, 2, 3, 4, 5, 7)); + @Expose + @ConfigOption( + name = "Pause Timer", + desc = "How many seconds does it wait before pausing" + ) + @ConfigAccordionId(id = 1) + @ConfigEditorSlider( + minValue = 1, + maxValue = 20, + minStep = 1 + ) + public int miningPauseTimer = 3; + @Expose @ConfigOption( name = "Edit Mining Overlay Position", @@ -218,6 +244,19 @@ public class SkillOverlays { @ConfigAccordionId(id = 3) public List fishingText = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6)); + @Expose + @ConfigOption( + name = "Pause Timer", + desc = "How many seconds does it wait before pausing" + ) + @ConfigAccordionId(id = 3) + @ConfigEditorSlider( + minValue = 1, + maxValue = 20, + minStep = 1 + ) + public int fishingPauseTimer = 3; + @Expose @ConfigOption( name = "Edit Fishing Overlay Position", @@ -312,6 +351,19 @@ public class SkillOverlays { @ConfigAccordionId(id = 4) public List combatText = new ArrayList<>(Arrays.asList(0, 6, 1, 2, 3, 4, 5)); + @Expose + @ConfigOption( + name = "Pause Timer", + desc = "How many seconds does it wait before pausing" + ) + @ConfigAccordionId(id = 4) + @ConfigEditorSlider( + minValue = 1, + maxValue = 20, + minStep = 1 + ) + public int combatPauseTimer = 3; + @Expose @ConfigOption( name = "Edit Combat Overlay Position", diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java index d73b5eb2..45ce0098 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/CombatSkillOverlay.java @@ -179,7 +179,7 @@ public class CombatSkillOverlay float delta = totalXp - lastTotalXp; if (delta > 0 && delta < 1000) { - xpGainTimer = 3; + xpGainTimer = NotEnoughUpdates.INSTANCE.config.skillOverlays.combatPauseTimer; xpGainQueue.add(0, delta); while (xpGainQueue.size() > 30) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingOverlay.java deleted file mode 100644 index 970c74ab..00000000 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingOverlay.java +++ /dev/null @@ -1,544 +0,0 @@ -/* - * Copyright (C) 2022 NotEnoughUpdates contributors - * - * This file is part of NotEnoughUpdates. - * - * NotEnoughUpdates is free software: you can redistribute it - * and/or modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation, either - * version 3 of the License, or (at your option) any later version. - * - * NotEnoughUpdates is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public License - * along with NotEnoughUpdates. If not, see . - */ - -package io.github.moulberry.notenoughupdates.overlays; - -import com.google.gson.JsonObject; -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 FarmingOverlay extends TextOverlay { - private long lastUpdate = -1; - private int counterLast = -1; - private int counter = -1; - private int cultivatingLast = -1; - private int cultivating = -1; - private int cultivatingTier = -1; - private String cultivatingTierAmount = "1"; - private int Farming = -1; - private int Alch = -1; - private int Foraging = -1; - private double Coins = -1; - private float cropsPerSecondLast = 0; - private float cropsPerSecond = 0; - private final LinkedList counterQueue = new LinkedList<>(); - - private XPInformation.SkillInfo skillInfo = null; - private XPInformation.SkillInfo skillInfoLast = null; - - private float lastTotalXp = -1; - private boolean isFarming = false; - private final LinkedList xpGainQueue = new LinkedList<>(); - private float xpGainHourLast = -1; - private float xpGainHour = -1; - - private int xpGainTimer = 0; - - private String skillType = "Farming"; - - public FarmingOverlay( - Position position, - Supplier> dummyStrings, - Supplier 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.farmingOverlay) { - counter = -1; - overlayStrings = null; - return; - } - - lastUpdate = System.currentTimeMillis(); - counterLast = counter; - cultivatingLast = cultivating; - xpGainHourLast = xpGainHour; - counter = -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("mined_crops", 99)) { - counter = ea.getInteger("mined_crops"); - cultivating = ea.getInteger("farmed_cultivating"); - counterQueue.add(0, counter); - } else if (ea.hasKey("farmed_cultivating", 99)) { - counter = ea.getInteger("farmed_cultivating"); - cultivating = ea.getInteger("farmed_cultivating"); - counterQueue.add(0, counter); - } - } - } - - if (cultivating < 1000) { - cultivatingTier = 1; - } else if (cultivating < 5000) { - cultivatingTier = 2; - } else if (cultivating < 25000) { - cultivatingTier = 3; - } else if (cultivating < 100000) { - cultivatingTier = 4; - } else if (cultivating < 300000) { - cultivatingTier = 5; - } else if (cultivating < 1500000) { - cultivatingTier = 6; - } else if (cultivating < 5000000) { - cultivatingTier = 7; - } else if (cultivating < 20000000) { - cultivatingTier = 8; - } else if (cultivating < 100000000) { - cultivatingTier = 9; - } else if (cultivating > 100000000) { - cultivatingTier = 10; - } - - switch (cultivatingTier) { - case 1: - cultivatingTierAmount = "1,000"; - break; - case 2: - cultivatingTierAmount = "5,000"; - break; - case 3: - cultivatingTierAmount = "25,000"; - break; - case 4: - cultivatingTierAmount = "100,000"; - break; - case 5: - cultivatingTierAmount = "300,000"; - break; - case 6: - cultivatingTierAmount = "1,500,000"; - break; - case 7: - cultivatingTierAmount = "5,000,000"; - break; - case 8: - cultivatingTierAmount = "20,000,000"; - break; - case 9: - cultivatingTierAmount = "100,000,000"; - break; - case 10: - cultivatingTierAmount = "Maxed"; - break; - } - - String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); - if (internalname != null && internalname.startsWith("THEORETICAL_HOE_WARTS")) { - skillType = "Alchemy"; - Farming = 0; - Alch = 1; - Foraging = 0; - } else if (internalname != null && internalname.startsWith("TREECAPITATOR_AXE") || - (internalname != null && internalname.startsWith("JUNGLE_AXE"))) { - skillType = "Foraging"; - Farming = 0; - Alch = 0; - Foraging = 1; - } else { - skillType = "Farming"; - Farming = 1; - Alch = 0; - Foraging = 0; - } - - if (!NotEnoughUpdates.INSTANCE.config.skillOverlays.useBZPrice || internalname != null && (internalname.equals( - "TREECAPITATOR_AXE")) || internalname != null && (internalname.equals("JUNGLE_AXE"))) { - if ((internalname != null && internalname.equals("COCO_CHOPPER"))) { - Coins = 3; - } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_POTATO") || - (internalname != null && internalname.startsWith("THEORETICAL_HOE_CARROT")) || - (internalname != null && internalname.equals("CACTUS_KNIFE")) || - (internalname != null && internalname.startsWith("THEORETICAL_HOE_WHEAT"))) { - Coins = 1; - } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_CANE") - || (internalname != null && internalname.equals("TREECAPITATOR_AXE")) - || (internalname != null && internalname.startsWith("THEORETICAL_HOE_WARTS")) - || (internalname != null && internalname.equals("JUNGLE_AXE"))) { - Coins = 2; - } else if ((internalname != null && internalname.equals("PUMPKIN_DICER")) || - (internalname != null && internalname.equals("FUNGI_CUTTER"))) { - Coins = 4; - } else if ((internalname != null && internalname.equals("MELON_DICER"))) { - Coins = 0.5; - } else { - Coins = 0; - } - } - if (NotEnoughUpdates.INSTANCE.config.skillOverlays.useBZPrice) { - if (internalname != null && internalname.startsWith("THEORETICAL_HOE_WARTS")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_NETHER_STALK"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_POTATO")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_POTATO"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_CARROT")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_CARROT"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_CANE")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_SUGAR"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } else if (internalname != null && internalname.startsWith("PUMPKIN_DICER")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_PUMPKIN"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } else if (internalname != null && internalname.startsWith("FUNGI_CUTTER")) { - JsonObject red = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_RED_MUSHROOM"); - JsonObject brown = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_BROWN_MUSHROOM"); - if (red != null && brown != null) { - if (red.has("curr_sell") && (brown.has("curr_sell"))) { - double crop = (red.get("curr_sell").getAsFloat() + red.get("curr_sell").getAsFloat()) / 2; - Coins = crop / 160; - } - } - } else if (internalname != null && internalname.startsWith("MELON_DICER")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_MELON"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_WHEAT")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_HAY_BLOCK"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 1296; - } - } - } else if (internalname != null && internalname.startsWith("CACTUS_KNIFE")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_CACTUS_GREEN"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } - } - - 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(); - - isFarming = 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(); - - isFarming = true; - } else if (delta <= 0) { - isFarming = false; - } - } - - lastTotalXp = totalXp; - } - - while (counterQueue.size() >= 4) { - counterQueue.removeLast(); - } - - if (counterQueue.isEmpty()) { - cropsPerSecond = -1; - cropsPerSecondLast = 0; - } else { - cropsPerSecondLast = cropsPerSecond; - int last = counterQueue.getLast(); - int first = counterQueue.getFirst(); - - cropsPerSecond = (first - last) / 3f; - } - - if (counter != -1) { - overlayStrings = new ArrayList<>(); - } else { - overlayStrings = null; - } - - } - - @Override - public void updateFrequent() { - super.updateFrequent(); - - if (counter < 0) { - overlayStrings = null; - } else { - HashMap lineMap = new HashMap<>(); - - overlayStrings = new ArrayList<>(); - - NumberFormat format = NumberFormat.getIntegerInstance(); - - if (counter >= 0 && cultivating != counter) { - int counterInterp = (int) interp(counter, counterLast); - - lineMap.put( - 0, - EnumChatFormatting.AQUA + "Counter: " + EnumChatFormatting.YELLOW + format.format(counterInterp) - ); - } - - if (counter >= 0) { - if (cropsPerSecondLast == cropsPerSecond && cropsPerSecond <= 0) { - lineMap.put( - 1, - EnumChatFormatting.AQUA + (Foraging == 1 ? "Logs/m: " : "Crops/m: ") + EnumChatFormatting.YELLOW + "N/A" - ); - } else { - float cpsInterp = interp(cropsPerSecond, cropsPerSecondLast); - - lineMap.put( - 1, - EnumChatFormatting.AQUA + (Foraging == 1 ? "Logs/m: " : "Crops/m: ") + EnumChatFormatting.YELLOW + - String.format("%,.2f", cpsInterp * 60) - ); - } - } - - if (counter >= 0 && Coins > 0) { - if (cropsPerSecondLast == cropsPerSecond && cropsPerSecond <= 0) { - lineMap.put(10, EnumChatFormatting.AQUA + "Coins/m: " + EnumChatFormatting.YELLOW + "N/A"); - } else { - float cpsInterp = interp(cropsPerSecond, cropsPerSecondLast); - - lineMap.put(10, EnumChatFormatting.AQUA + "Coins/m: " + EnumChatFormatting.YELLOW + - String.format("%,.2f", (cpsInterp * 60) * Coins)); - } - } - - if (cultivatingTier <= 9 && cultivating > 0) { - int counterInterp = (int) interp(cultivating, cultivatingLast); - lineMap.put( - 9, - EnumChatFormatting.AQUA + "Cultivating: " + EnumChatFormatting.YELLOW + format.format(counterInterp) + "/" + - cultivatingTierAmount - ); - } - if (cultivatingTier == 10) { - int counterInterp = (int) interp(cultivating, cultivatingLast); - lineMap.put( - 9, - EnumChatFormatting.AQUA + "Cultivating: " + EnumChatFormatting.YELLOW + format.format(counterInterp) - ); - } - - float xpInterp = xpGainHour; - if (xpGainHourLast == xpGainHour && xpGainHour <= 0) { - lineMap.put(5, EnumChatFormatting.AQUA + "XP/h: " + EnumChatFormatting.YELLOW + "N/A"); - } else { - xpInterp = interp(xpGainHour, xpGainHourLast); - - lineMap.put(5, EnumChatFormatting.AQUA + "XP/h: " + EnumChatFormatting.YELLOW + - format.format(xpInterp) + (isFarming ? "" : EnumChatFormatting.RED + " (PAUSED)")); - } - - if (skillInfo != null && skillInfo.level < 60) { - StringBuilder levelStr = new StringBuilder(EnumChatFormatting.AQUA + skillType + ": "); - - 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(2, levelStr.toString()); - lineMap.put(3, EnumChatFormatting.AQUA + "Current XP: " + EnumChatFormatting.YELLOW + format.format(current)); - if (remaining < 0) { - lineMap.put(4, EnumChatFormatting.AQUA + "Remaining XP: " + EnumChatFormatting.YELLOW + "MAXED!"); - lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + "MAXED!"); - } else { - lineMap.put( - 4, - EnumChatFormatting.AQUA + "Remaining XP: " + EnumChatFormatting.YELLOW + format.format(remaining) - ); - if (xpGainHour < 1000) { - lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + "N/A"); - } else { - lineMap.put( - 7, - EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + - Utils.prettyTime((long) (remaining) * 1000 * 60 * 60 / (long) xpInterp) - ); - } - } - - } - - if (skillInfo != null && skillInfo.level == 60 || Alch == 1 && skillInfo != null && skillInfo.level == 50) { - int current = (int) skillInfo.currentXp; - if (skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { - current = (int) interp(current, skillInfoLast.currentXp); - } - - if (Alch == 0) { - lineMap.put( - 2, - EnumChatFormatting.AQUA + "Farming: " + EnumChatFormatting.YELLOW + "60 " + EnumChatFormatting.RED + - "(Maxed)" - ); - } else if (Foraging == 1) { - lineMap.put( - 2, - EnumChatFormatting.AQUA + "Foraging: " + EnumChatFormatting.YELLOW + "50 " + EnumChatFormatting.RED + - "(Maxed)" - ); - } else { - lineMap.put( - 2, - EnumChatFormatting.AQUA + "Alch: " + EnumChatFormatting.YELLOW + "50 " + EnumChatFormatting.RED + "(Maxed)" - ); - } - lineMap.put(3, EnumChatFormatting.AQUA + "Current XP: " + EnumChatFormatting.YELLOW + format.format(current)); - - } - - float yaw = Minecraft.getMinecraft().thePlayer.rotationYawHead; - float pitch = Minecraft.getMinecraft().thePlayer.rotationPitch; - yaw %= 360; - if (yaw < 0) yaw += 360; - if (yaw > 180) yaw -= 360; - pitch %= 360; - if (pitch < 0) pitch += 360; - if (pitch > 180) pitch -= 360; - - lineMap.put(6, EnumChatFormatting.AQUA + "Yaw: " + EnumChatFormatting.YELLOW + - String.format("%.2f", yaw) + EnumChatFormatting.BOLD + "\u1D52"); - - lineMap.put(8, EnumChatFormatting.AQUA + "Pitch: " + EnumChatFormatting.YELLOW + - String.format("%.2f", pitch) + EnumChatFormatting.BOLD + "\u1D52"); - - for (int strIndex : NotEnoughUpdates.INSTANCE.config.skillOverlays.farmingText) { - 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/FarmingSkillOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java new file mode 100644 index 00000000..39b64136 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java @@ -0,0 +1,544 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.overlays; + +import com.google.gson.JsonObject; +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 FarmingSkillOverlay extends TextOverlay { + private long lastUpdate = -1; + private int counterLast = -1; + private int counter = -1; + private int cultivatingLast = -1; + private int cultivating = -1; + private int cultivatingTier = -1; + private String cultivatingTierAmount = "1"; + private int Farming = -1; + private int Alch = -1; + private int Foraging = -1; + private double Coins = -1; + private float cropsPerSecondLast = 0; + private float cropsPerSecond = 0; + private final LinkedList counterQueue = new LinkedList<>(); + + private XPInformation.SkillInfo skillInfo = null; + private XPInformation.SkillInfo skillInfoLast = null; + + private float lastTotalXp = -1; + private boolean isFarming = false; + private final LinkedList xpGainQueue = new LinkedList<>(); + private float xpGainHourLast = -1; + private float xpGainHour = -1; + + private int xpGainTimer = 0; + + private String skillType = "Farming"; + + public FarmingSkillOverlay( + Position position, + Supplier> dummyStrings, + Supplier 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.farmingOverlay) { + counter = -1; + overlayStrings = null; + return; + } + + lastUpdate = System.currentTimeMillis(); + counterLast = counter; + cultivatingLast = cultivating; + xpGainHourLast = xpGainHour; + counter = -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("mined_crops", 99)) { + counter = ea.getInteger("mined_crops"); + cultivating = ea.getInteger("farmed_cultivating"); + counterQueue.add(0, counter); + } else if (ea.hasKey("farmed_cultivating", 99)) { + counter = ea.getInteger("farmed_cultivating"); + cultivating = ea.getInteger("farmed_cultivating"); + counterQueue.add(0, counter); + } + } + } + + if (cultivating < 1000) { + cultivatingTier = 1; + } else if (cultivating < 5000) { + cultivatingTier = 2; + } else if (cultivating < 25000) { + cultivatingTier = 3; + } else if (cultivating < 100000) { + cultivatingTier = 4; + } else if (cultivating < 300000) { + cultivatingTier = 5; + } else if (cultivating < 1500000) { + cultivatingTier = 6; + } else if (cultivating < 5000000) { + cultivatingTier = 7; + } else if (cultivating < 20000000) { + cultivatingTier = 8; + } else if (cultivating < 100000000) { + cultivatingTier = 9; + } else if (cultivating > 100000000) { + cultivatingTier = 10; + } + + switch (cultivatingTier) { + case 1: + cultivatingTierAmount = "1,000"; + break; + case 2: + cultivatingTierAmount = "5,000"; + break; + case 3: + cultivatingTierAmount = "25,000"; + break; + case 4: + cultivatingTierAmount = "100,000"; + break; + case 5: + cultivatingTierAmount = "300,000"; + break; + case 6: + cultivatingTierAmount = "1,500,000"; + break; + case 7: + cultivatingTierAmount = "5,000,000"; + break; + case 8: + cultivatingTierAmount = "20,000,000"; + break; + case 9: + cultivatingTierAmount = "100,000,000"; + break; + case 10: + cultivatingTierAmount = "Maxed"; + break; + } + + String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); + if (internalname != null && internalname.startsWith("THEORETICAL_HOE_WARTS")) { + skillType = "Alchemy"; + Farming = 0; + Alch = 1; + Foraging = 0; + } else if (internalname != null && internalname.startsWith("TREECAPITATOR_AXE") || + (internalname != null && internalname.startsWith("JUNGLE_AXE"))) { + skillType = "Foraging"; + Farming = 0; + Alch = 0; + Foraging = 1; + } else { + skillType = "Farming"; + Farming = 1; + Alch = 0; + Foraging = 0; + } + + if (!NotEnoughUpdates.INSTANCE.config.skillOverlays.useBZPrice || internalname != null && (internalname.equals( + "TREECAPITATOR_AXE")) || internalname != null && (internalname.equals("JUNGLE_AXE"))) { + if ((internalname != null && internalname.equals("COCO_CHOPPER"))) { + Coins = 3; + } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_POTATO") || + (internalname != null && internalname.startsWith("THEORETICAL_HOE_CARROT")) || + (internalname != null && internalname.equals("CACTUS_KNIFE")) || + (internalname != null && internalname.startsWith("THEORETICAL_HOE_WHEAT"))) { + Coins = 1; + } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_CANE") + || (internalname != null && internalname.equals("TREECAPITATOR_AXE")) + || (internalname != null && internalname.startsWith("THEORETICAL_HOE_WARTS")) + || (internalname != null && internalname.equals("JUNGLE_AXE"))) { + Coins = 2; + } else if ((internalname != null && internalname.equals("PUMPKIN_DICER")) || + (internalname != null && internalname.equals("FUNGI_CUTTER"))) { + Coins = 4; + } else if ((internalname != null && internalname.equals("MELON_DICER"))) { + Coins = 0.5; + } else { + Coins = 0; + } + } + if (NotEnoughUpdates.INSTANCE.config.skillOverlays.useBZPrice) { + if (internalname != null && internalname.startsWith("THEORETICAL_HOE_WARTS")) { + JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_NETHER_STALK"); + if (crop != null) { + if (crop.has("curr_sell")) { + Coins = crop.get("curr_sell").getAsFloat() / 160; + } + } + } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_POTATO")) { + JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_POTATO"); + if (crop != null) { + if (crop.has("curr_sell")) { + Coins = crop.get("curr_sell").getAsFloat() / 160; + } + } + } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_CARROT")) { + JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_CARROT"); + if (crop != null) { + if (crop.has("curr_sell")) { + Coins = crop.get("curr_sell").getAsFloat() / 160; + } + } + } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_CANE")) { + JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_SUGAR"); + if (crop != null) { + if (crop.has("curr_sell")) { + Coins = crop.get("curr_sell").getAsFloat() / 160; + } + } + } else if (internalname != null && internalname.startsWith("PUMPKIN_DICER")) { + JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_PUMPKIN"); + if (crop != null) { + if (crop.has("curr_sell")) { + Coins = crop.get("curr_sell").getAsFloat() / 160; + } + } + } else if (internalname != null && internalname.startsWith("FUNGI_CUTTER")) { + JsonObject red = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_RED_MUSHROOM"); + JsonObject brown = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_BROWN_MUSHROOM"); + if (red != null && brown != null) { + if (red.has("curr_sell") && (brown.has("curr_sell"))) { + double crop = (red.get("curr_sell").getAsFloat() + red.get("curr_sell").getAsFloat()) / 2; + Coins = crop / 160; + } + } + } else if (internalname != null && internalname.startsWith("MELON_DICER")) { + JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_MELON"); + if (crop != null) { + if (crop.has("curr_sell")) { + Coins = crop.get("curr_sell").getAsFloat() / 160; + } + } + } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_WHEAT")) { + JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_HAY_BLOCK"); + if (crop != null) { + if (crop.has("curr_sell")) { + Coins = crop.get("curr_sell").getAsFloat() / 1296; + } + } + } else if (internalname != null && internalname.startsWith("CACTUS_KNIFE")) { + JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_CACTUS_GREEN"); + if (crop != null) { + if (crop.has("curr_sell")) { + Coins = crop.get("curr_sell").getAsFloat() / 160; + } + } + } + } + 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 = NotEnoughUpdates.INSTANCE.config.skillOverlays.farmingPauseTimer; + + 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(); + + isFarming = 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(); + + isFarming = true; + } else if (delta <= 0) { + isFarming = false; + } + } + + lastTotalXp = totalXp; + } + + while (counterQueue.size() >= 4) { + counterQueue.removeLast(); + } + + if (counterQueue.isEmpty()) { + cropsPerSecond = -1; + cropsPerSecondLast = 0; + } else { + cropsPerSecondLast = cropsPerSecond; + int last = counterQueue.getLast(); + int first = counterQueue.getFirst(); + + cropsPerSecond = (first - last) / 3f; + } + + if (counter != -1) { + overlayStrings = new ArrayList<>(); + } else { + overlayStrings = null; + } + + } + + @Override + public void updateFrequent() { + super.updateFrequent(); + + if (counter < 0) { + overlayStrings = null; + } else { + HashMap lineMap = new HashMap<>(); + + overlayStrings = new ArrayList<>(); + + NumberFormat format = NumberFormat.getIntegerInstance(); + + if (counter >= 0 && cultivating != counter) { + int counterInterp = (int) interp(counter, counterLast); + + lineMap.put( + 0, + EnumChatFormatting.AQUA + "Counter: " + EnumChatFormatting.YELLOW + format.format(counterInterp) + ); + } + + if (counter >= 0) { + if (cropsPerSecondLast == cropsPerSecond && cropsPerSecond <= 0) { + lineMap.put( + 1, + EnumChatFormatting.AQUA + (Foraging == 1 ? "Logs/m: " : "Crops/m: ") + EnumChatFormatting.YELLOW + "N/A" + ); + } else { + float cpsInterp = interp(cropsPerSecond, cropsPerSecondLast); + + lineMap.put( + 1, + EnumChatFormatting.AQUA + (Foraging == 1 ? "Logs/m: " : "Crops/m: ") + EnumChatFormatting.YELLOW + + String.format("%,.2f", cpsInterp * 60) + ); + } + } + + if (counter >= 0 && Coins > 0) { + if (cropsPerSecondLast == cropsPerSecond && cropsPerSecond <= 0) { + lineMap.put(10, EnumChatFormatting.AQUA + "Coins/m: " + EnumChatFormatting.YELLOW + "N/A"); + } else { + float cpsInterp = interp(cropsPerSecond, cropsPerSecondLast); + + lineMap.put(10, EnumChatFormatting.AQUA + "Coins/m: " + EnumChatFormatting.YELLOW + + String.format("%,.2f", (cpsInterp * 60) * Coins)); + } + } + + if (cultivatingTier <= 9 && cultivating > 0) { + int counterInterp = (int) interp(cultivating, cultivatingLast); + lineMap.put( + 9, + EnumChatFormatting.AQUA + "Cultivating: " + EnumChatFormatting.YELLOW + format.format(counterInterp) + "/" + + cultivatingTierAmount + ); + } + if (cultivatingTier == 10) { + int counterInterp = (int) interp(cultivating, cultivatingLast); + lineMap.put( + 9, + EnumChatFormatting.AQUA + "Cultivating: " + EnumChatFormatting.YELLOW + format.format(counterInterp) + ); + } + + float xpInterp = xpGainHour; + if (xpGainHourLast == xpGainHour && xpGainHour <= 0) { + lineMap.put(5, EnumChatFormatting.AQUA + "XP/h: " + EnumChatFormatting.YELLOW + "N/A"); + } else { + xpInterp = interp(xpGainHour, xpGainHourLast); + + lineMap.put(5, EnumChatFormatting.AQUA + "XP/h: " + EnumChatFormatting.YELLOW + + format.format(xpInterp) + (isFarming ? "" : EnumChatFormatting.RED + " (PAUSED)")); + } + + if (skillInfo != null && skillInfo.level < 60) { + StringBuilder levelStr = new StringBuilder(EnumChatFormatting.AQUA + skillType + ": "); + + 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(2, levelStr.toString()); + lineMap.put(3, EnumChatFormatting.AQUA + "Current XP: " + EnumChatFormatting.YELLOW + format.format(current)); + if (remaining < 0) { + lineMap.put(4, EnumChatFormatting.AQUA + "Remaining XP: " + EnumChatFormatting.YELLOW + "MAXED!"); + lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + "MAXED!"); + } else { + lineMap.put( + 4, + EnumChatFormatting.AQUA + "Remaining XP: " + EnumChatFormatting.YELLOW + format.format(remaining) + ); + if (xpGainHour < 1000) { + lineMap.put(7, EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + "N/A"); + } else { + lineMap.put( + 7, + EnumChatFormatting.AQUA + "ETA: " + EnumChatFormatting.YELLOW + + Utils.prettyTime((long) (remaining) * 1000 * 60 * 60 / (long) xpInterp) + ); + } + } + + } + + if (skillInfo != null && skillInfo.level == 60 || Alch == 1 && skillInfo != null && skillInfo.level == 50) { + int current = (int) skillInfo.currentXp; + if (skillInfoLast != null && skillInfo.currentXpMax == skillInfoLast.currentXpMax) { + current = (int) interp(current, skillInfoLast.currentXp); + } + + if (Alch == 0) { + lineMap.put( + 2, + EnumChatFormatting.AQUA + "Farming: " + EnumChatFormatting.YELLOW + "60 " + EnumChatFormatting.RED + + "(Maxed)" + ); + } else if (Foraging == 1) { + lineMap.put( + 2, + EnumChatFormatting.AQUA + "Foraging: " + EnumChatFormatting.YELLOW + "50 " + EnumChatFormatting.RED + + "(Maxed)" + ); + } else { + lineMap.put( + 2, + EnumChatFormatting.AQUA + "Alch: " + EnumChatFormatting.YELLOW + "50 " + EnumChatFormatting.RED + "(Maxed)" + ); + } + lineMap.put(3, EnumChatFormatting.AQUA + "Current XP: " + EnumChatFormatting.YELLOW + format.format(current)); + + } + + float yaw = Minecraft.getMinecraft().thePlayer.rotationYawHead; + float pitch = Minecraft.getMinecraft().thePlayer.rotationPitch; + yaw %= 360; + if (yaw < 0) yaw += 360; + if (yaw > 180) yaw -= 360; + pitch %= 360; + if (pitch < 0) pitch += 360; + if (pitch > 180) pitch -= 360; + + lineMap.put(6, EnumChatFormatting.AQUA + "Yaw: " + EnumChatFormatting.YELLOW + + String.format("%.2f", yaw) + EnumChatFormatting.BOLD + "\u1D52"); + + lineMap.put(8, EnumChatFormatting.AQUA + "Pitch: " + EnumChatFormatting.YELLOW + + String.format("%.2f", pitch) + EnumChatFormatting.BOLD + "\u1D52"); + + for (int strIndex : NotEnoughUpdates.INSTANCE.config.skillOverlays.farmingText) { + 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/FishingSkillOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FishingSkillOverlay.java index 717ff944..b1143042 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FishingSkillOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FishingSkillOverlay.java @@ -180,7 +180,7 @@ public class FishingSkillOverlay float delta = totalXp - lastTotalXp; if (delta > 0 && delta < 1000) { - xpGainTimer = 3; + xpGainTimer = NotEnoughUpdates.INSTANCE.config.skillOverlays.fishingPauseTimer; xpGainQueue.add(0, delta); while (xpGainQueue.size() > 30) { 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 a20b1d27..4422e3ad 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningSkillOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/MiningSkillOverlay.java @@ -172,7 +172,7 @@ public class MiningSkillOverlay float delta = totalXp - lastTotalXp; if (delta > 0 && delta < 1000) { - xpGainTimer = 3; + xpGainTimer = NotEnoughUpdates.INSTANCE.config.skillOverlays.miningPauseTimer; xpGainQueue.add(0, delta); while (xpGainQueue.size() > 30) { 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 fef11a45..d580b556 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java @@ -30,7 +30,7 @@ public class OverlayManager { public static Class dontRenderOverlay = null; public static MiningOverlay miningOverlay; - public static FarmingOverlay farmingOverlay; + public static FarmingSkillOverlay farmingOverlay; public static FishingSkillOverlay fishingSkillOverlay; public static MiningSkillOverlay miningSkillOverlay; public static CombatSkillOverlay combatSkillOverlay; @@ -106,7 +106,7 @@ public class OverlayManager { "\u00a7bXP/h: \u00a7e238,129", "\u00a7bYaw: \u00a7e68.25\u00a7l\u1D52" ); - farmingOverlay = new FarmingOverlay(NotEnoughUpdates.INSTANCE.config.skillOverlays.farmingPosition, () -> { + farmingOverlay = new FarmingSkillOverlay(NotEnoughUpdates.INSTANCE.config.skillOverlays.farmingPosition, () -> { List strings = new ArrayList<>(); for (int i : NotEnoughUpdates.INSTANCE.config.skillOverlays.farmingText) { if (i >= 0 && i < farmingDummy.size()) strings.add(farmingDummy.get(i)); -- cgit From fd98e0040d84164f28a48d5f2d454fe11ae366c0 Mon Sep 17 00:00:00 2001 From: u9g Date: Thu, 20 Oct 2022 21:02:54 -0400 Subject: [Calculator] Add exponent operator and % postfix (#374) * [Calculator] Add exponent operator * [Calculator] Add percent postfix * Add new suggestions --- .../notenoughupdates/util/Calculator.java | 33 ++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java index 10bfa6a9..b39a05f4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java @@ -48,8 +48,8 @@ public class Calculator { int tokenLength; } - static String binops = "+-*/x"; - static String postops = "mkbts"; + static String binops = "+-*/^x"; + static String postops = "mkbts%"; static String digits = "0123456789"; static void readDigitsInto(Token token, String source, boolean decimals) { @@ -150,6 +150,8 @@ public class Calculator { case "/": case "x": return 1; + case "^": + return 2; } throw new CalculatorException("Unknown operator " + token.operatorValue, token.tokenStart, token.tokenLength); } @@ -160,6 +162,7 @@ public class Calculator { Deque op = new ArrayDeque<>(); List out = new ArrayList<>(); + boolean nextMultiplyShouldBePower = false; for (Token currentlyShunting : toShunt) { switch (currentlyShunting.type) { @@ -167,6 +170,17 @@ public class Calculator { out.add(currentlyShunting); break; case BINOP: + Token next = toShunt.get(toShunt.indexOf(currentlyShunting) + 1); + if (currentlyShunting.operatorValue.equals("^")) { + if (next.numericValue > 999) { + throw new CalculatorException(next.numericValue + " is too large, pick a power less than 1000", next.tokenStart, next.tokenLength); + } + } else if (next != null && currentlyShunting.operatorValue.equals("*") && next.operatorValue != null && next.operatorValue.equals("*")) { + nextMultiplyShouldBePower = true; + continue; + } else if (nextMultiplyShouldBePower && currentlyShunting.operatorValue.equals("*")) { + currentlyShunting.operatorValue = "^"; + } int p = getPrecedence(currentlyShunting); while (!op.isEmpty()) { Token l = op.peek(); @@ -230,6 +244,18 @@ public class Calculator { BigDecimal right = values.pop().setScale(2, RoundingMode.HALF_UP); BigDecimal left = values.pop().setScale(2, RoundingMode.HALF_UP); switch (command.operatorValue.intern()) { + case "^": + if (right.compareTo(new BigDecimal(1000)) >= 0) { + Token rightToken = rpnTokens.get(rpnTokens.indexOf(command) - 1); + throw new CalculatorException(right + " is too large, pick a power less than 1000", rightToken.tokenStart, rightToken.tokenLength); + } + + if (right.doubleValue() != right.intValue()) { + Token rightToken = rpnTokens.get(rpnTokens.indexOf(command) - 1); + throw new CalculatorException(right + " has a decimal, pick a power that is non-decimal", rightToken.tokenStart, rightToken.tokenLength); + } + values.push(left.pow(right.intValue()).setScale(2, RoundingMode.HALF_UP)); + break; case "x": case "*": values.push(left.multiply(right).setScale(2, RoundingMode.HALF_UP)); @@ -280,6 +306,9 @@ public class Calculator { case "t": values.push(p.multiply(new BigDecimal("1000000000000")).setScale(2, RoundingMode.HALF_UP)); break; + case "%": + values.push(p.setScale(3, RoundingMode.HALF_UP).divide(new BigDecimal(100), RoundingMode.HALF_UP).setScale(2, RoundingMode.HALF_UP)); + break; default: throw new CalculatorException( "Unknown operation " + command.operatorValue, -- cgit From 8e60019903e227bc5bde2e470dc0ec3145f5102c Mon Sep 17 00:00:00 2001 From: Jejebecarte <69335633+Jejebecarte@users.noreply.github.com> Date: Fri, 21 Oct 2022 12:03:25 +1100 Subject: refactor: change ProfileViewer 'Your Skills' tab to 'Skills' (#383) Just a minor error I noticed while using the mod, given you're not always viewing your own profile. --- .../moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 8e4dc634..501af179 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -1262,7 +1262,7 @@ public class GuiProfileViewer extends GuiScreen { LOADING(), INVALID_NAME(), NO_SKYBLOCK(), - BASIC(0, Items.paper, "§9Your Skills"), + BASIC(0, Items.paper, "§9Skills"), DUNGEON(1, Item.getItemFromBlock(Blocks.deadbush), "§eDungeoneering"), EXTRA(2, Items.book, "§7Profile Stats"), INVENTORIES(3, Item.getItemFromBlock(Blocks.ender_chest), "§bStorage"), -- cgit From 877878bc802d7f09841aed6d6de2f60dbab48f6d Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Thu, 20 Oct 2022 18:04:08 -0700 Subject: NEU/NEU vs Moulberry/NEU Contributor note (#385) --- CONTRIBUTING.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 3e388cf5..f46b50c8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,5 +1,8 @@ # Contributing +## Quick Note +Ever since Moulberry has stopped working on NEU, other contributors have been working on new features and fixes for the mod. If you are interested in contributing yourself, make a pull request to [NotEnoughUpdates/NotEnoughUpdates](https://github.com/NotEnoughUpdates/NotEnoughUpdates) to contribute to the prereleases, which eventually will be merged in bulk to [Moulberry/NotEnoughUpdates](https://github.com/Moulberry/NotEnoughUpdates) for major releases. + ## Before you contribute - Please check your feature / bug isn't already fixed in one of our pre-releases, on the [development branch](https://github.com/NotEnoughUpdates/NotEnoughUpdates/tree/master/) or in an open [pull request](https://github.com/NotEnoughUpdates/NotEnoughUpdates/pulls) -- cgit From 549d95150c664c581a04ca11a90c169cd98f735d Mon Sep 17 00:00:00 2001 From: Vixid <52578495+Vixid1@users.noreply.github.com> Date: Fri, 21 Oct 2022 02:11:40 +0100 Subject: Trophy Fish Total Count (#338) * Added trophy fish total count to each trophy fish. Also formatted the numbers for readability. * Removed double brackets. Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../profileviewer/trophy/TrophyFishPage.java | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java index cda47ffd..7fc9bd0d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java @@ -26,6 +26,14 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewerPage; import io.github.moulberry.notenoughupdates.util.Utils; + +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.LinkedHashMap; +import java.util.List; +import java.util.Locale; +import java.util.Map; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; @@ -121,6 +129,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { } }; private static final ResourceLocation TROPHY_FISH_TEXTURE = new ResourceLocation("notenoughupdates:pv_trophy_fish_tab.png"); + private static final NumberFormat NUMBER_FORMAT = NumberFormat.getInstance(Locale.US); private static final String checkX = "§c✖"; private static final String check = "§a✔"; private final Map total = new HashMap<>(); @@ -357,6 +366,8 @@ public class TrophyFishPage extends GuiProfileViewerPage { tooltip.add(display(trophyFishRarityIntegerMap, TrophyFish.TrophyFishRarity.GOLD, EnumChatFormatting.GOLD)); tooltip.add(display(trophyFishRarityIntegerMap, TrophyFish.TrophyFishRarity.SILVER, EnumChatFormatting.GRAY)); tooltip.add(display(trophyFishRarityIntegerMap, TrophyFish.TrophyFishRarity.BRONZE, EnumChatFormatting.DARK_GRAY)); + tooltip.add(" "); + tooltip.add(EnumChatFormatting.GRAY + "Total: " + EnumChatFormatting.GOLD + NUMBER_FORMAT.format(trophyFishList.get(name).getTotal())); return tooltip; } @@ -371,7 +382,7 @@ public class TrophyFishPage extends GuiProfileViewerPage { } if (trophyFishRarityIntegerMap.containsKey(rarity)) { - return color + name + ": " + EnumChatFormatting.GOLD + trophyFishRarityIntegerMap.get(rarity); + return color + name + ": " + EnumChatFormatting.GOLD + NUMBER_FORMAT.format(trophyFishRarityIntegerMap.get(rarity)); } else { return color + name + ": " + checkX; } -- cgit From ebf61799fb28c971d94a02815924018b0964dea4 Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Fri, 21 Oct 2022 03:21:35 +0200 Subject: Prepare next version and add missing patch notes (#386) Prepare next Version and add missing patch notes --- Update Notes/2.1.1.md | 19 +++++++++++++++++++ build.gradle.kts | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 Update Notes/2.1.1.md diff --git a/Update Notes/2.1.1.md b/Update Notes/2.1.1.md new file mode 100644 index 00000000..f4270ba7 --- /dev/null +++ b/Update Notes/2.1.1.md @@ -0,0 +1,19 @@ +# These are the change notes for NEU 2.1 + + +### **Major Changes:** + + + +### **Minor Changes:** + + - Fix /join command not working for uppercase floors - walker or whalker + - Remove custom option toggle textures in /neu - nopo + - Fix Pickaxe Cooldown not being correct on first join - Ascynx + - Fix social exp not being correct in /pv - Vixid + - Fix a crash when downgrading from future NEU versions - nopo + - Unify writing conventions for "SkyBlock" and similar - walker or whalker + - Add fishing helper to fishing in the main lobby - sharkey300 + - Allow custom delays until skill overlays pause - cobble8 + - Add exponent and percentage to calculator - u9g + - Add total trophy fish count to /pv - Vixid diff --git a/build.gradle.kts b/build.gradle.kts index deb740f5..defc1052 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -39,7 +39,7 @@ apply() group = "io.github.moulberry" -setVersionFromEnvironment("2.1") +setVersionFromEnvironment("2.1.1") // Minecraft configuration: loom { -- cgit From 19175cb01395cd0a74714a0202152a0d52a561d4 Mon Sep 17 00:00:00 2001 From: Ascynx <78341107+Ascynx@users.noreply.github.com> Date: Fri, 21 Oct 2022 03:25:08 +0200 Subject: Ctrl + Z and (Ctrl + Y and Ctrl + Shift + Z) support (#358) * Ctrl + Z and Ctrl + Y support currently for Bazaar and AH search along with the search bar. (might have issues as my brain jumbled up during the making of this and also probably missing a few places that could use it.) * Ctrl + Z and Ctrl + Y support but on a bigger scale Removed it from Auction and Bazaar search and created a new mixin for GuiTextField containing the Undo (Ctrl + z) and Redo (Ctrl + y) action. * Ctrl + shift + Z for redo and stack cut. After redo/undo if you type a character or remove one it will cut the stack to that index (won't be able to rewind what you already rewound before.) * Moved the undo/redo detection to MixinGuiTextField#addToStack * Added an override for if something goes wrong see misc > "Enable text field tweaks" Also removed the space that hannibal wanted gone. :) * i hate files changed with only new lines Co-authored-by: nopo --- .../moulberry/notenoughupdates/NEUOverlay.java | 2 +- .../notenoughupdates/mixins/MixinGuiTextField.java | 136 +++++++++++++++++++++ .../options/seperateSections/Misc.java | 8 ++ src/main/resources/mixins.notenoughupdates.json | 3 +- 4 files changed, 147 insertions(+), 2 deletions(-) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiTextField.java diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java index 14078069..2f55c338 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUOverlay.java @@ -1035,7 +1035,7 @@ public class NEUOverlay extends Gui { return false; } - if (Keyboard.isKeyDown(Keyboard.KEY_Y) && NotEnoughUpdates.INSTANCE.config.hidden.dev) { + if ((Keyboard.isKeyDown(Keyboard.KEY_Y) && !Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) && NotEnoughUpdates.INSTANCE.config.hidden.dev) { displayInformationPane(new DevInfoPane(this, manager)); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiTextField.java b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiTextField.java new file mode 100644 index 00000000..55a5a098 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiTextField.java @@ -0,0 +1,136 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.mixins; + +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import net.minecraft.client.gui.GuiTextField; +import org.lwjgl.input.Keyboard; +import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; +import org.spongepowered.asm.mixin.injection.At; +import org.spongepowered.asm.mixin.injection.Inject; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; +import org.spongepowered.asm.mixin.injection.callback.LocalCapture; + +import java.util.ArrayList; + +@Mixin(GuiTextField.class) +public abstract class MixinGuiTextField { + + private final ArrayList stringStack = new ArrayList() { + { + //allows the ability to undo the entire textField + add(""); + } + }; + private int currentStringStackIndex = -1; + + @Shadow private int maxStringLength; + + @Shadow + private String text; + + @Shadow + public abstract void setCursorPositionEnd(); + + @Shadow + public abstract void setText(String string); + + private void addToStack(String string) { + if (currentStringStackIndex != -1 && currentStringStackIndex != stringStack.size() - 1) { + //did redo/undo before + stringStack.subList(currentStringStackIndex, stringStack.size()).clear(); + } + if (stringStack.size() > 20) { + stringStack.remove(0); + } + stringStack.add(string); + currentStringStackIndex = stringStack.size() - 1; + } + + @Inject(method = "setText", at = @At("TAIL"), locals = LocalCapture.CAPTURE_FAILSOFT) + public void setText_stringStack(String string, CallbackInfo ci) { + if (NotEnoughUpdates.INSTANCE.config.misc.textFieldTweaksEnabled) { + addToStack(string.length() > this.maxStringLength ? string.substring(0, this.maxStringLength) : string); + } + } + + @Inject(method = "writeText", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiTextField;moveCursorBy(I)V"), locals = LocalCapture.CAPTURE_FAILSOFT) + public void writeText_stringStack(String string, CallbackInfo ci, String string2, String string3, int i, int j, int l) { + if (NotEnoughUpdates.INSTANCE.config.misc.textFieldTweaksEnabled) { + addToStack(string2); + } + } + + @Inject(method = "deleteFromCursor", at = @At(value = "INVOKE", target = "Lcom/google/common/base/Predicate;apply(Ljava/lang/Object;)Z"), locals = LocalCapture.PRINT) + public void deleteFromCursor_stringStack(int i, CallbackInfo ci, boolean bl, int j, int k, String string) { + if (NotEnoughUpdates.INSTANCE.config.misc.textFieldTweaksEnabled) { + addToStack(string); + } + } + + @Inject(method = "textboxKeyTyped", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/GuiScreen;isKeyComboCtrlA(I)Z"), cancellable = true) + public void textboxKeyTyped_stringStack(char c, int i, CallbackInfoReturnable cir) { + if (NotEnoughUpdates.INSTANCE.config.misc.textFieldTweaksEnabled) { + if (Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)) { + if (currentStringStackIndex == -1 && stringStack.size() > 0) { + currentStringStackIndex = stringStack.size() - 1; + } + + if (Keyboard.isKeyDown(Keyboard.KEY_Y) || (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT) && Keyboard.isKeyDown( + Keyboard.KEY_Z))) { + //go forward in action stack + if (currentStringStackIndex != stringStack.size() - 1) { + text = stringStack.get(currentStringStackIndex + 1); + currentStringStackIndex += 1; + setCursorPositionEnd(); + } + cir.setReturnValue(true); + } else if (Keyboard.isKeyDown(Keyboard.KEY_Z)) { + //go back in action stack + if (!stringStack.isEmpty() && currentStringStackIndex > 0 && stringStack.get(currentStringStackIndex - 1) != + null) { + text = stringStack.get(currentStringStackIndex - 1); + currentStringStackIndex -= 1; + setCursorPositionEnd(); + } + cir.setReturnValue(true); + } + } + } + } + + @Inject(method = "setMaxStringLength", at = @At(value = "INVOKE", target = "Ljava/lang/String;length()I")) + public void setMaxStringLength_stringStack(int i, CallbackInfo ci) { + //will remove the possibility of creating a bug in the matrix (untested) + if (NotEnoughUpdates.INSTANCE.config.misc.textFieldTweaksEnabled) { + for (int j = 0; j < stringStack.size(); j++) { + String string = stringStack.get(j); + if (string.length() > i) { + stringStack.set(j, string.substring(0, j)); + if (j < currentStringStackIndex) { + currentStringStackIndex -= 1; + } + } + } + } + } +} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java index 34495ae4..86c4c5dd 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java @@ -237,4 +237,12 @@ public class Misc { @ConfigEditorBoolean public boolean coopWarning = true; + @Expose + @ConfigOption( + name = "Enable text field tweaks", + desc = "Allows the use of ctrl + z, ctrl + y and ctrl + Lshift + z in text fields" + ) + @ConfigEditorBoolean + public boolean textFieldTweaksEnabled = true; + } diff --git a/src/main/resources/mixins.notenoughupdates.json b/src/main/resources/mixins.notenoughupdates.json index ed1ba55a..53595874 100644 --- a/src/main/resources/mixins.notenoughupdates.json +++ b/src/main/resources/mixins.notenoughupdates.json @@ -51,6 +51,7 @@ "AccessorGuiContainer", "AccessorGuiEditSign", "AccessorMinecraft", - "MixinGuiEditSign" + "MixinGuiEditSign", + "MixinGuiTextField" ] } -- cgit From 42264cc4f41096801074227d82ab8fec2907461c Mon Sep 17 00:00:00 2001 From: Walker Selby Date: Thu, 20 Oct 2022 18:25:37 -0700 Subject: Optimize and Cleanup FarmingSkillOverlay (#384) * Merged if-else and switch statement checking effectively the same thing to one check * Rewrote logic to prevent checking "internalname != null" 26 times in a single if block. Simplified logic to increase readability and efficiency * Fix parenthesis error --- .../overlays/FarmingSkillOverlay.java | 218 ++++++++------------- 1 file changed, 80 insertions(+), 138 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java index 39b64136..08cbb189 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/FarmingSkillOverlay.java @@ -45,9 +45,9 @@ public class FarmingSkillOverlay extends TextOverlay { private int cultivating = -1; private int cultivatingTier = -1; private String cultivatingTierAmount = "1"; - private int Farming = -1; - private int Alch = -1; - private int Foraging = -1; + private int Farming = 1; + private int Alch = 0; + private int Foraging = 0; private double Coins = -1; private float cropsPerSecondLast = 0; private float cropsPerSecond = 0; @@ -62,6 +62,8 @@ public class FarmingSkillOverlay extends TextOverlay { private float xpGainHourLast = -1; private float xpGainHour = -1; + private final int ENCH_SIZE = 160; + private final int ENCH_BLOCK_SIZE = 1296; private int xpGainTimer = 0; private String skillType = "Farming"; @@ -84,6 +86,14 @@ public class FarmingSkillOverlay extends TextOverlay { return interp; } + private double getCoinsBz(String enchCropName, int numItemsForEnch) { + JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo(enchCropName); + if (crop != null && crop.has("curr_sell")) { + return crop.get("curr_sell").getAsFloat() / numItemsForEnch; + } + return 0; + } + @Override public void update() { if (!NotEnoughUpdates.INSTANCE.config.skillOverlays.farmingOverlay) { @@ -121,169 +131,101 @@ public class FarmingSkillOverlay extends TextOverlay { if (cultivating < 1000) { cultivatingTier = 1; + cultivatingTierAmount = "1,000"; } else if (cultivating < 5000) { cultivatingTier = 2; + cultivatingTierAmount = "5,000"; } else if (cultivating < 25000) { cultivatingTier = 3; + cultivatingTierAmount = "25,000"; } else if (cultivating < 100000) { cultivatingTier = 4; + cultivatingTierAmount = "100,000"; } else if (cultivating < 300000) { cultivatingTier = 5; + cultivatingTierAmount = "300,000"; } else if (cultivating < 1500000) { cultivatingTier = 6; + cultivatingTierAmount = "1,500,000"; } else if (cultivating < 5000000) { cultivatingTier = 7; + cultivatingTierAmount = "5,000,000"; } else if (cultivating < 20000000) { cultivatingTier = 8; + cultivatingTierAmount = "20,000,000"; } else if (cultivating < 100000000) { cultivatingTier = 9; + cultivatingTierAmount = "100,000,000"; } else if (cultivating > 100000000) { cultivatingTier = 10; - } - - switch (cultivatingTier) { - case 1: - cultivatingTierAmount = "1,000"; - break; - case 2: - cultivatingTierAmount = "5,000"; - break; - case 3: - cultivatingTierAmount = "25,000"; - break; - case 4: - cultivatingTierAmount = "100,000"; - break; - case 5: - cultivatingTierAmount = "300,000"; - break; - case 6: - cultivatingTierAmount = "1,500,000"; - break; - case 7: - cultivatingTierAmount = "5,000,000"; - break; - case 8: - cultivatingTierAmount = "20,000,000"; - break; - case 9: - cultivatingTierAmount = "100,000,000"; - break; - case 10: - cultivatingTierAmount = "Maxed"; - break; + cultivatingTierAmount = "Maxed"; } String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); - if (internalname != null && internalname.startsWith("THEORETICAL_HOE_WARTS")) { - skillType = "Alchemy"; - Farming = 0; - Alch = 1; - Foraging = 0; - } else if (internalname != null && internalname.startsWith("TREECAPITATOR_AXE") || - (internalname != null && internalname.startsWith("JUNGLE_AXE"))) { - skillType = "Foraging"; - Farming = 0; - Alch = 0; - Foraging = 1; - } else { + if (internalname != null) { + + //Set default skilltype to Farming and get BZprice config value + boolean useBZPrice = NotEnoughUpdates.INSTANCE.config.skillOverlays.useBZPrice; skillType = "Farming"; - Farming = 1; - Alch = 0; - Foraging = 0; - } - if (!NotEnoughUpdates.INSTANCE.config.skillOverlays.useBZPrice || internalname != null && (internalname.equals( - "TREECAPITATOR_AXE")) || internalname != null && (internalname.equals("JUNGLE_AXE"))) { - if ((internalname != null && internalname.equals("COCO_CHOPPER"))) { - Coins = 3; - } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_POTATO") || - (internalname != null && internalname.startsWith("THEORETICAL_HOE_CARROT")) || - (internalname != null && internalname.equals("CACTUS_KNIFE")) || - (internalname != null && internalname.startsWith("THEORETICAL_HOE_WHEAT"))) { - Coins = 1; - } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_CANE") - || (internalname != null && internalname.equals("TREECAPITATOR_AXE")) - || (internalname != null && internalname.startsWith("THEORETICAL_HOE_WARTS")) - || (internalname != null && internalname.equals("JUNGLE_AXE"))) { + //WARTS + if (internalname.startsWith("THEORETICAL_HOE_WARTS")) { + skillType = "Alchemy"; + Farming = 0; + Alch = 1; + Foraging = 0; + Coins = useBZPrice ? getCoinsBz("ENCHANTED_NETHER_STALK", ENCH_SIZE) : 2; + + //WOOD + } else if (internalname.equals("TREECAPITATOR_AXE") || internalname.equalsIgnoreCase("JUNGLE_AXE")) { + skillType = "Foraging"; + Farming = 0; + Alch = 0; + Foraging = 1; Coins = 2; - } else if ((internalname != null && internalname.equals("PUMPKIN_DICER")) || - (internalname != null && internalname.equals("FUNGI_CUTTER"))) { - Coins = 4; - } else if ((internalname != null && internalname.equals("MELON_DICER"))) { - Coins = 0.5; + + //COCOA + } else if (internalname.equals("COCO_CHOPPER")) { + Coins = useBZPrice ? getCoinsBz("ENCHANTED_COCOA", ENCH_SIZE) : 3; + + //CACTUS + } else if (internalname.equals("CACTUS_KNIFE")) { + Coins = useBZPrice ? getCoinsBz("ENCHANTED_CACTUS_GREEN", ENCH_SIZE) : 2; + + //CANE + } else if (internalname.startsWith("THEORETICAL_HOE_CANE")) { + Coins = useBZPrice ? getCoinsBz("ENCHANTED_SUGAR", ENCH_SIZE) : 2; + + //CARROT + } else if (internalname.startsWith("THEORETICAL_HOE_CARROT")) { + Coins = useBZPrice ? getCoinsBz("ENCHANTED_CARROT", ENCH_SIZE) : 1; + + //POTATO + } else if (internalname.startsWith("THEORETICAL_HOE_POTATO")) { + Coins = useBZPrice ? getCoinsBz("ENCHANTED_POTATO", ENCH_SIZE) : 1; + + //MUSHROOM + } else if (internalname.equals("FUNGI_CUTTER")) { + Coins = useBZPrice ? ((getCoinsBz("ENCHANTED_RED_MUSHROOM", ENCH_SIZE) + + getCoinsBz("ENCHANTED_BROWN_MUSHROOM", ENCH_SIZE))/2) : 4; + + //PUMPKIN + } else if (internalname.equals("PUMPKIN_DICER")) { + Coins = useBZPrice ? getCoinsBz("ENCHANTED_PUMPKIN", ENCH_SIZE) : 4; + + //MELON + } else if (internalname.equals("MELON_DICER")) { + Coins = useBZPrice ? getCoinsBz("ENCHANTED_MELON", ENCH_SIZE) : 0.5; + + //WHEAT + } else if (internalname.startsWith("THEORETICAL_HOE_WHEAT")) { + Coins = useBZPrice ? getCoinsBz("ENCHANTED_HAY_BLOCK", ENCH_BLOCK_SIZE) : 1; + } else { Coins = 0; } } - if (NotEnoughUpdates.INSTANCE.config.skillOverlays.useBZPrice) { - if (internalname != null && internalname.startsWith("THEORETICAL_HOE_WARTS")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_NETHER_STALK"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_POTATO")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_POTATO"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_CARROT")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_CARROT"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_CANE")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_SUGAR"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } else if (internalname != null && internalname.startsWith("PUMPKIN_DICER")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_PUMPKIN"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } else if (internalname != null && internalname.startsWith("FUNGI_CUTTER")) { - JsonObject red = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_RED_MUSHROOM"); - JsonObject brown = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_BROWN_MUSHROOM"); - if (red != null && brown != null) { - if (red.has("curr_sell") && (brown.has("curr_sell"))) { - double crop = (red.get("curr_sell").getAsFloat() + red.get("curr_sell").getAsFloat()) / 2; - Coins = crop / 160; - } - } - } else if (internalname != null && internalname.startsWith("MELON_DICER")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_MELON"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } else if (internalname != null && internalname.startsWith("THEORETICAL_HOE_WHEAT")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_HAY_BLOCK"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 1296; - } - } - } else if (internalname != null && internalname.startsWith("CACTUS_KNIFE")) { - JsonObject crop = NotEnoughUpdates.INSTANCE.manager.auctionManager.getBazaarInfo("ENCHANTED_CACTUS_GREEN"); - if (crop != null) { - if (crop.has("curr_sell")) { - Coins = crop.get("curr_sell").getAsFloat() / 160; - } - } - } - } + skillInfoLast = skillInfo; skillInfo = XPInformation.getInstance().getSkillInfo(skillType); if (skillInfo != null) { -- cgit From 218e8048e345f4792cc1b696570fae29ac532ef8 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 21 Oct 2022 02:40:16 +0000 Subject: Remove messages in chat if they are under a set skyblock level (#322) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Remove messages in chat if they are under a set skyblock level * 🤓 "not future proof. what if someone gets sb level 1000" * 2.1.1.md * Update Update Notes/2.1.1.md Co-authored-by: Roman / Linnea Gräf --- Update Notes/2.1.1.md | 1 + .../moulberry/notenoughupdates/listener/ChatListener.java | 8 ++++++++ .../notenoughupdates/options/seperateSections/Misc.java | 12 ++++++++++++ 3 files changed, 21 insertions(+) diff --git a/Update Notes/2.1.1.md b/Update Notes/2.1.1.md index f4270ba7..1f4e0311 100644 --- a/Update Notes/2.1.1.md +++ b/Update Notes/2.1.1.md @@ -17,3 +17,4 @@ - Allow custom delays until skill overlays pause - cobble8 - Add exponent and percentage to calculator - u9g - Add total trophy fish count to /pv - Vixid + - Allow hiding messages below a set skyblock level - nopo diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java index 3473124c..e3a3edad 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java @@ -53,6 +53,8 @@ public class ChatListener { private final NotEnoughUpdates neu; private static final Pattern SLAYER_XP = Pattern.compile( " (Spider|Zombie|Wolf|Enderman|Blaze) Slayer LVL (\\d) - (?:Next LVL in ([\\d,]+) XP!|LVL MAXED OUT!)"); + + private static final Pattern SKYBLOCK_LVL_MESSAGE = Pattern.compile("\\[(\\d{1,4})\\] .*"); AtomicBoolean missingRecipe = new AtomicBoolean(false); public ChatListener(NotEnoughUpdates neu) { @@ -254,5 +256,11 @@ public class ChatListener { unformatted.startsWith(" ") || unformatted.startsWith("✦") || unformatted.equals( " You've earned a Crystal Loot Bundle!")) OverlayManager.crystalHollowOverlay.message(unformatted); + Matcher LvlMatcher = SKYBLOCK_LVL_MESSAGE.matcher(unformatted); + if (LvlMatcher.matches()) { + if (Integer.parseInt(LvlMatcher.group(1)) < NotEnoughUpdates.INSTANCE.config.misc.filterChatLevel && NotEnoughUpdates.INSTANCE.config.misc.filterChatLevel != 0) { + e.setCanceled(true); + } + } } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java index 86c4c5dd..568f852e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java @@ -237,6 +237,18 @@ public class Misc { @ConfigEditorBoolean public boolean coopWarning = true; + @Expose + @ConfigOption( + name = "Filter Skyblock Levels in Chat", + desc = "Requires the \"SkyBlock Levels in Chat\" skyblock setting to be on" + ) + @ConfigEditorSlider( + minValue = 0, + maxValue = 300, + minStep = 10 + ) + public int filterChatLevel = 0; + @Expose @ConfigOption( name = "Enable text field tweaks", -- cgit From bbf48864fa4894352964f28be11d6686d49052ad Mon Sep 17 00:00:00 2001 From: Vixid <52578495+Vixid1@users.noreply.github.com> Date: Fri, 21 Oct 2022 07:10:32 +0100 Subject: Entity Scale and Party and Guild chat social options (#363) 363/merge --- .../notenoughupdates/listener/ChatListener.java | 50 ++++++++++++++--- .../miscfeatures/entityviewer/EntityViewer.java | 63 ++++++++++++++++++++-- .../moulberry/notenoughupdates/util/Utils.java | 17 ++++++ 3 files changed, 119 insertions(+), 11 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java index e3a3edad..d4e98ba7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java @@ -33,6 +33,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.event.ClickEvent; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatComponentTranslation; +import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; import net.minecraftforge.client.ClientCommandHandler; @@ -110,29 +111,62 @@ public class ChatListener { private IChatComponent replaceSocialControlsWithPV(IChatComponent chatComponent) { - if (NotEnoughUpdates.INSTANCE.config.misc.replaceSocialOptions1 > 0 && chatComponent.getChatStyle() != null && + if (NotEnoughUpdates.INSTANCE.config.misc.replaceSocialOptions1 > 0 && + ((chatComponent.getChatStyle() != null && chatComponent.getChatStyle().getChatClickEvent() != null && - chatComponent.getChatStyle().getChatClickEvent().getAction() == ClickEvent.Action.RUN_COMMAND && + chatComponent.getChatStyle().getChatClickEvent().getAction() == ClickEvent.Action.RUN_COMMAND) || + // Party and guild chat components are different from global chats, so need to check for them here + (!chatComponent.getSiblings().isEmpty() && chatComponent.getSiblings().get(0).getChatStyle() != null && + chatComponent.getSiblings().get(0).getChatStyle().getChatClickEvent() != null && + chatComponent.getSiblings().get(0).getChatStyle().getChatClickEvent().getAction() == ClickEvent.Action.RUN_COMMAND)) && NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) { - if (chatComponent.getChatStyle().getChatClickEvent().getValue().startsWith("/socialoptions")) { - String username = chatComponent.getChatStyle().getChatClickEvent().getValue().substring(15); + + String startsWith = null; + boolean partyOrGuildChat = false; + + if (chatComponent.getSiblings().get(0).getChatStyle().getChatClickEvent().getValue().startsWith("/viewprofile")) { + startsWith = "/viewprofile"; + partyOrGuildChat = true; + } else if (chatComponent.getChatStyle().getChatClickEvent().getValue().startsWith("/socialoptions")) { + startsWith = "/socialoptions"; + } + + if (startsWith != null) { + String username = partyOrGuildChat ? + Utils.getNameFromChatComponent(chatComponent) : + chatComponent.getChatStyle().getChatClickEvent().getValue().substring(15); + if (NotEnoughUpdates.INSTANCE.config.misc.replaceSocialOptions1 == 1) { - chatComponent.setChatStyle(Utils.createClickStyle( + + ChatStyle pvClickStyle = Utils.createClickStyle( ClickEvent.Action.RUN_COMMAND, "/pv " + username, "" + EnumChatFormatting.YELLOW + "Click to open " + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + username + EnumChatFormatting.RESET + EnumChatFormatting.YELLOW + "'s profile in " + EnumChatFormatting.DARK_PURPLE + EnumChatFormatting.BOLD + "NEU's" + EnumChatFormatting.RESET + EnumChatFormatting.YELLOW + " profile viewer." - )); + ); + + if (partyOrGuildChat) { + chatComponent.getSiblings().get(0).setChatStyle(pvClickStyle); + } else { + chatComponent.setChatStyle(pvClickStyle); + } return chatComponent; } else if (NotEnoughUpdates.INSTANCE.config.misc.replaceSocialOptions1 == 2) { - chatComponent.setChatStyle(Utils.createClickStyle( + + ChatStyle ahClickStyle = Utils.createClickStyle( ClickEvent.Action.RUN_COMMAND, "/ah " + username, "" + EnumChatFormatting.YELLOW + "Click to open " + EnumChatFormatting.AQUA + EnumChatFormatting.BOLD + username + EnumChatFormatting.RESET + EnumChatFormatting.YELLOW + "'s /ah page" - )); + ); + + if (partyOrGuildChat) { + chatComponent.getSiblings().get(0).setChatStyle(ahClickStyle); + } else { + chatComponent.setChatStyle(ahClickStyle); + } return chatComponent; } } // wanted to add this for guild but guild uses uuid :sad: diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EntityViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EntityViewer.java index 367d62d3..2f091304 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EntityViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/entityviewer/EntityViewer.java @@ -27,8 +27,10 @@ import io.github.moulberry.notenoughupdates.util.Utils; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.FontRenderer; import net.minecraft.client.gui.GuiScreen; -import net.minecraft.client.gui.inventory.GuiInventory; import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.client.renderer.OpenGlHelper; +import net.minecraft.client.renderer.RenderHelper; +import net.minecraft.client.renderer.entity.RenderManager; import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.boss.EntityDragon; import net.minecraft.entity.boss.EntityWither; @@ -63,6 +65,7 @@ import net.minecraft.entity.passive.EntitySquid; import net.minecraft.entity.passive.EntityVillager; import net.minecraft.entity.passive.EntityWolf; import net.minecraft.util.ResourceLocation; +import org.lwjgl.input.Keyboard; import java.io.IOException; import java.io.InputStreamReader; @@ -224,9 +227,23 @@ public class EntityViewer extends GuiScreen { float bottomOffset = 0F; EntityLivingBase stack = entity; while (true) { - + if (stack instanceof EntityDragon) { + if (Keyboard.isKeyDown(Keyboard.KEY_SPACE)) { + scale = 35; + bottomOffset = 0F; + } + else { + scale = 10; + bottomOffset = 2F; + } + } else if (stack instanceof EntityWither) { + scale = 20; + } else if (stack instanceof EntityGhast) { + scale = 8; + bottomOffset = 4F; + } stack.ticksExisted = Minecraft.getMinecraft().thePlayer.ticksExisted; - GuiInventory.drawEntityOnScreen( + drawEntityOnScreen( posX, (int) (posY - bottomOffset * scale), scale, @@ -242,4 +259,44 @@ public class EntityViewer extends GuiScreen { } } + + // Need this to flip the ender dragon and make it follow mouse correctly + public static void drawEntityOnScreen(int posX, int posY, int scale, float mouseX, float mouseY, EntityLivingBase ent) { + GlStateManager.enableColorMaterial(); + GlStateManager.pushMatrix(); + GlStateManager.translate((float)posX, (float)posY, 50.0F); + GlStateManager.scale((float)(-scale), (float)scale, (float)scale); + GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F); + float f = ent.renderYawOffset; + float g = ent.rotationYaw; + float h = ent.rotationPitch; + float i = ent.prevRotationYawHead; + float j = ent.rotationYawHead; + GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F); + RenderHelper.enableStandardItemLighting(); + GlStateManager.rotate((ent instanceof EntityDragon) ? 45.0F : -135.0F, 0.0F, 1.0F, 0.0F); + GlStateManager.rotate((ent instanceof EntityDragon) ? ((float)Math.atan(mouseY / 40.0F)) * 20.0F : -((float)Math.atan(mouseY / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F); + ent.renderYawOffset = (float)Math.atan(mouseX / 40.0F) * 20.0F; + ent.rotationYaw = (float)Math.atan(mouseX / 40.0F) * 40.0F; + ent.rotationPitch = -((float)Math.atan(mouseY / 40.0F)) * 20.0F; + ent.rotationYawHead = ent.rotationYaw; + ent.prevRotationYawHead = ent.rotationYaw; + GlStateManager.translate(0.0F, 0.0F, 0.0F); + RenderManager renderManager = Minecraft.getMinecraft().getRenderManager(); + renderManager.setPlayerViewY(180.0F); + renderManager.setRenderShadow(false); + renderManager.renderEntityWithPosYaw(ent, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F); + renderManager.setRenderShadow(true); + ent.renderYawOffset = f; + ent.rotationYaw = g; + ent.rotationPitch = h; + ent.prevRotationYawHead = i; + ent.rotationYawHead = j; + GlStateManager.popMatrix(); + RenderHelper.disableStandardItemLighting(); + GlStateManager.disableRescaleNormal(); + GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit); + GlStateManager.disableTexture2D(); + GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); + } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java index 2267cbea..1ee24ec8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Utils.java @@ -57,6 +57,7 @@ import net.minecraft.network.play.client.C0DPacketCloseWindow; import net.minecraft.util.ChatComponentText; import net.minecraft.util.ChatStyle; import net.minecraft.util.EnumChatFormatting; +import net.minecraft.util.IChatComponent; import net.minecraft.util.Matrix4f; import net.minecraft.util.ResourceLocation; import net.minecraft.util.StatCollector; @@ -1999,4 +2000,20 @@ public class Utils { public static String getLastOpenChestName() { return SBInfo.getInstance().lastOpenChestName; } + + public static String getNameFromChatComponent(IChatComponent chatComponent) { + String unformattedText = cleanColour(chatComponent.getSiblings().get(0).getUnformattedText()); + String username = unformattedText.substring(unformattedText.indexOf(">") + 2, unformattedText.indexOf(":")); + // If the first character is a square bracket the user has a rank + // So we get the username from the space after the closing square bracket (end of their rank) + if (username.charAt(0) == '[') { + username = username.substring(unformattedText.indexOf(" ") + 2); + } + // If we still get any square brackets it means the user was talking in guild chat with a guild rank + // So we get the username up to the space before the guild rank + if (username.contains("[") || username.contains("]")) { + username = username.substring(0, unformattedText.indexOf(" ")); + } + return username; + } } -- cgit From 0a5c62857747c80ce039fcef182c7098a4a0503a Mon Sep 17 00:00:00 2001 From: Vixid <52578495+Vixid1@users.noreply.github.com> Date: Fri, 21 Oct 2022 07:19:22 +0100 Subject: Faction Town Board Quests added to Todo Overlay (#370) 370/merge --- .../notenoughupdates/options/NEUConfig.java | 2 + .../options/seperateSections/MiscOverlays.java | 15 ++++++- .../notenoughupdates/overlays/OverlayManager.java | 3 +- .../notenoughupdates/overlays/TimersOverlay.java | 49 ++++++++++++++++++++++ .../moulberry/notenoughupdates/util/SBInfo.java | 8 ++++ 5 files changed, 75 insertions(+), 2 deletions(-) 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 4d04bfbc..a1561658 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java @@ -573,6 +573,8 @@ public class NEUConfig extends Config { @Expose public long dailyHeavyPearlCompleted = 0L; @Expose + public long questBoardCompleted = 0L; + @Expose public HashMap savedEquipment = new HashMap<>(); @Expose public int magicalPower = 0; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java index 18b89733..e3edfcd4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java @@ -77,10 +77,11 @@ public class MiscOverlays { "\u00a73Mithril Powder: \u00a7e3h38m", "\u00a73Gemstone Powder: \u00a7e3h38m", "\u00a73Heavy Pearls: \u00a7e3h38m", + "\u00a73Crimson Isle Quests: \u00a7e3h38m", } ) @ConfigAccordionId(id = 0) - public List todoText2 = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9)); + public List todoText2 = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10)); @ConfigOption( name = "Show Only If Soon", @@ -211,6 +212,18 @@ public class MiscOverlays { public int dailyHeavyPearlDisplay = 0; + @Expose + @ConfigOption( + name = "Crimson Isle Quests Display", + desc = "Change the way the crimson isle quests display\n" + + "Only when ready, When very Soon, When soon, When kinda soon or always." + ) + @ConfigAccordionId(id = 1) + @ConfigEditorDropdown( + values = {"Only when ready", "When very Soon", "When soon", "When Kinda Soon", "Always"} + ) + public int questBoardDisplay = 0; + @ConfigOption( name = "Colours", desc = "" 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 d580b556..84684558 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java @@ -60,7 +60,8 @@ public class OverlayManager { "\u00a73Commissions: \u00a7e3h38m", "\u00a73Experiments: \u00a7e3h38m", "\u00a73Mithril Powder: \u00a7e3h38m", - "\u00a73Gemstone Powder: \u00a7e3h38m" + "\u00a73Gemstone Powder: \u00a7e3h38m", + "\u00a73Crimson Isle Quests: \u00a7e3h38m" ); textOverlays.add( timersOverlay = new TimersOverlay(NotEnoughUpdates.INSTANCE.config.miscOverlays.todoPosition, () -> { 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 4d82ebaf..730cb17f 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/TimersOverlay.java @@ -130,6 +130,7 @@ public class TimersOverlay extends TextTabOverlay { private static final ItemStack COMMISSIONS_ICON = new ItemStack(Items.iron_pickaxe); private static final ItemStack EXPERIMENTS_ICON = new ItemStack(Items.enchanted_book); private static final ItemStack COOKIE_ICON = new ItemStack(Items.cookie); + private static final ItemStack QUEST_ICON = new ItemStack(Items.sign); @Override protected void renderLine(String line, Vector2f position, boolean dummy) { @@ -212,6 +213,9 @@ public class TimersOverlay extends TextTabOverlay { .getItemInformation() .get("HEAVY_PEARL")); break; + case "Crimson Isle Quests": + icon = QUEST_ICON; + break; } if (icon != null) { @@ -388,6 +392,10 @@ public class TimersOverlay extends TextTabOverlay { hidden.godPotionDuration = 0; } + if (SBInfo.getInstance().completedQuests != null && SBInfo.getInstance().completedQuests.size() == 5) { + hidden.questBoardCompleted = currentTime; + } + if (!NotEnoughUpdates.INSTANCE.config.miscOverlays.todoOverlay2) { overlayStrings = null; return; @@ -819,6 +827,47 @@ public class TimersOverlay extends TextTabOverlay { ); } + if (hidden.questBoardCompleted < midnightReset) { + map.put( + 10, + DARK_AQUA + "Crimson Isle Quests: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.readyColour] + "Ready!" + ); + } else if ( + NotEnoughUpdates.INSTANCE.config.miscOverlays.questBoardDisplay >= DISPLAYTYPE.VERYSOON.ordinal() && + (hidden.questBoardCompleted < (midnightReset - TimeEnums.HALFANHOUR.time))) { + map.put( + 10, + DARK_AQUA + "Crimson Isle Quests: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.verySoonColour] + + Utils.prettyTime(timeDiffMidnightNow) + ); + } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.questBoardDisplay >= DISPLAYTYPE.SOON.ordinal() && + (hidden.questBoardCompleted < (midnightReset - TimeEnums.HOUR.time))) { + map.put( + 10, + DARK_AQUA + "Crimson Isle Quests: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.soonColour] + + Utils.prettyTime(timeDiffMidnightNow) + ); + } else if ( + NotEnoughUpdates.INSTANCE.config.miscOverlays.questBoardDisplay >= DISPLAYTYPE.KINDASOON.ordinal() && + (hidden.questBoardCompleted < (midnightReset - (TimeEnums.HOUR.time * 3)))) { + map.put( + 10, + DARK_AQUA + "Crimson Isle Quests: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.kindaSoonColour] + + Utils.prettyTime(timeDiffMidnightNow) + ); + } else if (NotEnoughUpdates.INSTANCE.config.miscOverlays.questBoardDisplay >= DISPLAYTYPE.ALWAYS.ordinal()) { + map.put( + 10, + DARK_AQUA + "Crimson Isle Quests: " + + EnumChatFormatting.values()[NotEnoughUpdates.INSTANCE.config.miscOverlays.defaultColour] + + Utils.prettyTime(timeDiffMidnightNow) + ); + } + overlayStrings = new ArrayList<>(); for (int index : NotEnoughUpdates.INSTANCE.config.miscOverlays.todoText2) { if (map.containsKey(index)) { 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 f3a09fcc..d78a6988 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -284,6 +284,8 @@ public class SBInfo { private static final String profilePrefix = "\u00a7r\u00a7e\u00a7lProfile: \u00a7r\u00a7a"; private static final String skillsPrefix = "\u00a7r\u00a7e\u00a7lSkills: \u00a7r\u00a7a"; + private static final String completedFactionQuests = "\u00a7r \u00a7r\u00a7a"; + public ArrayList completedQuests = new ArrayList<>(); private static final Pattern SKILL_LEVEL_PATTERN = Pattern.compile("([^0-9:]+) (\\d{1,2})"); @@ -320,6 +322,12 @@ public class SBInfo { } catch (Exception ignored) { } } + } else if (name.startsWith(completedFactionQuests)) { + if (completedQuests.isEmpty()) { + completedQuests.add(name); + } else if (!completedQuests.contains(name)) { + completedQuests.add(name); + } } } } catch (Exception e) { -- cgit From d1f618d8e952ee2ac2cba4b97df7677773c66472 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 21 Oct 2022 06:32:47 +0000 Subject: Fix dungeon page going blank (#382) 382/merge --- .../moulberry/notenoughupdates/profileviewer/DungeonPage.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java index 15a70ded..6d59db27 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/DungeonPage.java @@ -124,7 +124,6 @@ public class DungeonPage extends GuiProfileViewerPage { ProfileViewer.Profile profile = GuiProfileViewer.getProfile(); String profileId = GuiProfileViewer.getProfileId(); JsonObject hypixelInfo = profile.getHypixelProfile(); - if (hypixelInfo == null) return; JsonObject profileInfo = profile.getProfileInformation(profileId); if (profileInfo == null) return; @@ -443,7 +442,10 @@ public class DungeonPage extends GuiProfileViewerPage { //Random stats - float secrets = Utils.getElementAsFloat(Utils.getElement(hypixelInfo, "achievements.skyblock_treasure_hunter"), 0); + float secrets = -1; + if (hypixelInfo != null) { + secrets = Utils.getElementAsFloat(Utils.getElement(hypixelInfo, "achievements.skyblock_treasure_hunter"), 0); + } float totalRunsF = 0; float totalRunsF5 = 0; for (int i = 1; i <= 7; i++) { @@ -507,14 +509,14 @@ public class DungeonPage extends GuiProfileViewerPage { ); Utils.renderAlignedString( EnumChatFormatting.YELLOW + "Secrets (Total) ", - EnumChatFormatting.WHITE + StringUtils.shortNumberFormat(secrets), + EnumChatFormatting.WHITE + (secrets == -1 ? "?" : StringUtils.shortNumberFormat(secrets)), x, miscTopY + 20, sectionWidth ); Utils.renderAlignedString( EnumChatFormatting.YELLOW + "Secrets (/Run) ", - EnumChatFormatting.WHITE.toString() + (Math.round(secrets / Math.max(1, totalRuns) * 100) / 100f), + EnumChatFormatting.WHITE.toString() + (secrets == -1 ? "?" : (Math.round(secrets / Math.max(1, totalRuns) * 100) / 100f)), x, miscTopY + 30, sectionWidth -- cgit From 280a89cdbf086e53bcd6985e1ddd48b6aa718087 Mon Sep 17 00:00:00 2001 From: kr45732 <52721908+kr45732@users.noreply.github.com> Date: Fri, 21 Oct 2022 02:34:05 -0400 Subject: Me when I read NEU code (#350) 350/merge --- .../notenoughupdates/listener/RenderListener.java | 42 +++++++++++----------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java index 6460e1ed..a49b9e6d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -1239,6 +1239,7 @@ public class RenderListener { if (stack.getTagCompound().getCompoundTag("display").hasKey("Lore", 9)) { int stars = Utils.getNumberOfStars(stack); if (stars == 0) continue; + String starsStr = "" + stars; NBTTagList lore = stack.getTagCompound().getCompoundTag("display").getTagList("Lore", 8); int costIndex = 10000; @@ -1251,38 +1252,39 @@ public class RenderListener { if (entry.equals("§7Cost")) { costIndex = j; } + if (j > costIndex) { entry = entry.trim(); - int index = entry.lastIndexOf('x'); - String item, amountString; - if (index < 0) { - item = entry.trim() + " x1"; - amountString = "x1"; - } else { - amountString = entry.substring(index); - item = entry.substring(0, index).trim(); + + int countIndex = entry.lastIndexOf(" §8x"); + + String upgradeName = entry; + String amount = "1"; + if (countIndex != -1) { + upgradeName = entry.substring(0, countIndex); + // +4 to account for " §8x" + amount = entry.substring(countIndex + 4); } - item = item.substring(0, item.length() - 3); - int amount = Integer.parseInt(amountString.trim().replace("x", "").replace(",", "")); - if (item.endsWith("Essence")) { - int index2 = entry.indexOf("Essence"); - String type = item.substring(0, index2).trim().substring(2); - newEntry.add("type", new JsonPrimitive(type)); - newEntry.add(String.valueOf(stars), new JsonPrimitive(amount)); + + if (upgradeName.endsWith(" Essence")) { + // First 2 chars are control code + // [EssenceCount, EssenceType, "Essence"] + String[] upgradeNameSplit = upgradeName.substring(2).split(" "); + newEntry.addProperty("type", upgradeNameSplit[1]); + newEntry.addProperty(starsStr, Integer.parseInt(upgradeNameSplit[0].replace(",", ""))); } else { - String itemString = item + " §8x" + amount; if (!newEntry.has("items")) { newEntry.add("items", new JsonObject()); } - if (!newEntry.get("items").getAsJsonObject().has(String.valueOf(stars))) { - newEntry.get("items").getAsJsonObject().add(String.valueOf(stars), new JsonArray()); + if (!newEntry.get("items").getAsJsonObject().has(starsStr)) { + newEntry.get("items").getAsJsonObject().add(starsStr, new JsonArray()); } newEntry .get("items") .getAsJsonObject() - .get(String.valueOf(stars)) + .get(starsStr) .getAsJsonArray() - .add(new JsonPrimitive(itemString)); + .add(new JsonPrimitive(upgradeName + (upgradeName.contains("Coins") ? "" : (" §8x" + amount)))); } } } -- cgit From 44fad457f0a066b0378b3cb615fd389d8d2a0850 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Fri, 21 Oct 2022 15:51:44 +0800 Subject: Soopy networth option in pv (#303) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../commands/profile/PeekCommand.java | 41 ++++++- .../options/seperateSections/ProfileViewer.java | 8 ++ .../notenoughupdates/profileviewer/BasicPage.java | 50 ++++++++- .../profileviewer/ProfileViewer.java | 122 +++++++++++++++++++++ .../moulberry/notenoughupdates/util/ApiUtil.java | 21 ++++ 5 files changed, 235 insertions(+), 7 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java index c1c184f6..77377917 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/profile/PeekCommand.java @@ -39,6 +39,7 @@ import java.util.Arrays; import java.util.List; import java.util.Map; import java.util.Random; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executors; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.ScheduledFuture; @@ -72,7 +73,7 @@ public class PeekCommand extends ClientCommandBase { } else { profile.resetCache(); - if (peekCommandExecutorService == null) { + if (peekCommandExecutorService == null || peekCommandExecutorService.isTerminated()) { peekCommandExecutorService = Executors.newSingleThreadScheduledExecutor(); } @@ -105,13 +106,32 @@ public class PeekCommand extends ClientCommandBase { boolean isMe = name.equalsIgnoreCase("moulberry"); PlayerStats.Stats stats = profile.getStats(null); - if (stats == null) return; + if (stats == null) { + peekScheduledFuture = peekCommandExecutorService.schedule(this, 200, TimeUnit.MILLISECONDS); + return; + } Map skyblockInfo = profile.getSkyblockInfo(null); + if (NotEnoughUpdates.INSTANCE.config.profileViewer.useSoopyNetworth) { + Minecraft.getMinecraft().ingameGUI.getChatGUI().printChatMessageWithOptionalDeletion(new ChatComponentText( + EnumChatFormatting.YELLOW + "[PEEK] Getting the player's Skyblock networth..."), id); + + CountDownLatch countDownLatch = new CountDownLatch(1); + + profile.getSoopyNetworth(null, () -> countDownLatch.countDown()); + + try { //Wait for async network request + countDownLatch.await(10, TimeUnit.SECONDS); + } catch (InterruptedException e) {} + + //Now it's waited for network request the data should be cached (accessed in nw section) + } + Minecraft.getMinecraft().ingameGUI .getChatGUI() .printChatMessageWithOptionalDeletion(new ChatComponentText(EnumChatFormatting.GREEN + " " + - EnumChatFormatting.STRIKETHROUGH + "-=-" + EnumChatFormatting.RESET + EnumChatFormatting.GREEN + " " + + EnumChatFormatting.STRIKETHROUGH + "-=-" + EnumChatFormatting.RESET + EnumChatFormatting.GREEN + + " " + Utils.getElementAsString(profile.getHypixelProfile().get("displayname"), name) + "'s Info " + EnumChatFormatting.STRIKETHROUGH + "-=-"), id); @@ -195,7 +215,7 @@ public class PeekCommand extends ClientCommandBase { 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) + g+ "-" + + wolfPrefix + (int) Math.floor(wolf) + g + "-" + endermanPrefix + (int) Math.floor(enderman) + g + "-" + blazePrefix + (int) Math.floor(blaze))); } @@ -238,7 +258,18 @@ public class PeekCommand extends ClientCommandBase { float bankBalance = Utils.getElementAsFloat(Utils.getElement(profileInfo, "banking.balance"), -1); float purseBalance = Utils.getElementAsFloat(Utils.getElement(profileInfo, "coin_purse"), 0); - long networth = profile.getNetWorth(null); + long networth; + if (NotEnoughUpdates.INSTANCE.config.profileViewer.useSoopyNetworth) { + ProfileViewer.Profile.SoopyNetworthData nwData = profile.getSoopyNetworth(null, () -> {}); + if (nwData == null) { + networth = -2l; + } else { + networth = nwData.getTotal(); + } + } else { + networth = profile.getNetWorth(null); + } + float money = Math.max(bankBalance + purseBalance, networth); EnumChatFormatting moneyPrefix = money > 50 * 1000 * 1000 ? (money > 200 * 1000 * 1000 diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ProfileViewer.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ProfileViewer.java index 673e1015..951438fb 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ProfileViewer.java @@ -94,4 +94,12 @@ public class ProfileViewer { ) @ConfigEditorBoolean public boolean showPronounsInPv = BuildFlags.ENABLE_PRONOUNS_IN_PV_BY_DEFAULT; + + @Expose + @ConfigOption( + name = "Use Soopy Networth", + desc = "Replaces NEU networth with Soopy networth in /pv and /peek" + ) + @ConfigEditorBoolean + public boolean useSoopyNetworth = true; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java index 806b1bff..a0a78938 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java @@ -49,6 +49,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; +import org.apache.commons.lang3.text.WordUtils; import org.lwjgl.input.Keyboard; import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; @@ -225,7 +226,31 @@ public class BasicPage extends GuiProfileViewerPage { } } - long networth = profile.getNetWorth(profileId); + long networth; + ArrayList nwCategoryHover = new ArrayList<>(); + if (NotEnoughUpdates.INSTANCE.config.profileViewer.useSoopyNetworth) { + ProfileViewer.Profile.SoopyNetworthData nwData = profile.getSoopyNetworth(profileId, () -> {}); + if (nwData == null) { + networth = -2l; + } else { + networth = nwData.getTotal(); + + for (String category : nwData.getCategories()) { + if (nwData.getCategory(category) == 0) continue; + + nwCategoryHover.add(EnumChatFormatting.GREEN + + WordUtils.capitalizeFully(category.replace("_", " ")) + + ": " + + EnumChatFormatting.GOLD + + GuiProfileViewer.numberFormat.format(nwData.getCategory(category))); + } + + nwCategoryHover.add(""); + } + } else { + networth = profile.getNetWorth(profileId); + } + if (networth > 0) { Utils.drawStringCentered( EnumChatFormatting.GREEN + "Net Worth: " + EnumChatFormatting.GOLD + @@ -245,7 +270,7 @@ public class BasicPage extends GuiProfileViewerPage { .get("avg_buy") .getAsDouble() ); - String networthIRLMoney = Long.toString(Math.round(((networthInCookies * 325) / 675) * 4.99)); + String networthIRLMoney = GuiProfileViewer.numberFormat.format(Math.round(((networthInCookies * 325) / 675) * 4.99)); if ( mouseX > guiLeft + 8 && mouseX < guiLeft + 8 + fr.getStringWidth("Net Worth: " + GuiProfileViewer.numberFormat.format(networth)) @@ -262,7 +287,9 @@ public class BasicPage extends GuiProfileViewerPage { networthIRLMoney ); getInstance().tooltipToDisplay.add(""); + if (Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) { + getInstance().tooltipToDisplay.addAll(nwCategoryHover); getInstance().tooltipToDisplay.add(EnumChatFormatting.RED + "This is calculated using the current"); getInstance().tooltipToDisplay.add( EnumChatFormatting.RED + "price of booster cookies on bazaar and the price"); @@ -282,7 +309,26 @@ public class BasicPage extends GuiProfileViewerPage { } } } catch (Exception ignored) { + ignored.printStackTrace(); } + } else { + //Networth is under 0 + //If = -1 -> an error occured + //If = -2 -> still loading networth + + String stateStr = EnumChatFormatting.RED + "An error occured"; + if (networth == -2) { + stateStr = EnumChatFormatting.YELLOW + "Loading..."; + } + + Utils.drawStringCentered( + EnumChatFormatting.GREEN + "Net Worth: " + stateStr, + fr, + guiLeft + 63, + guiTop + 38, + true, + 0 + ); } if (status != null) { 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 a43e2b98..b32d3648 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 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.Base64; import java.util.Collections; +import java.util.Comparator; import java.util.HashMap; import java.util.LinkedHashMap; import java.util.List; @@ -646,9 +647,11 @@ public class ProfileViewer { private final HashMap stats = new HashMap<>(); private final HashMap passiveStats = new HashMap<>(); private final HashMap networth = new HashMap<>(); + private final HashMap soopyNetworth = new HashMap<>(); private final AtomicBoolean updatingSkyblockProfilesState = new AtomicBoolean(false); private final AtomicBoolean updatingGuildInfoState = new AtomicBoolean(false); private final AtomicBoolean updatingPlayerStatusState = new AtomicBoolean(false); + private final AtomicBoolean updatingSoopyNetworth = new AtomicBoolean(false); private final AtomicBoolean updatingBingoInfo = new AtomicBoolean(false); private final Pattern COLL_TIER_PATTERN = Pattern.compile("_(-?\\d+)"); private String latestProfile = null; @@ -717,6 +720,125 @@ public class ProfileViewer { return bingoInformation != null ? bingoInformation : null; } + public class SoopyNetworthData { + private HashMap categoryWorth; + private Long totalWorth; + private String[] keys; + + SoopyNetworthData(JsonObject nwData) { + categoryWorth = new HashMap<>(); + + if (nwData == null || nwData.isJsonNull()) { + totalWorth = -1l; + keys = new String[0]; + return; + } + if (nwData.get("total").isJsonNull()) { + totalWorth = -1l; + keys = new String[0]; + return; + } + + totalWorth = nwData.get("total").getAsLong(); + for (Map.Entry entry : nwData.get("categories").getAsJsonObject().entrySet()) { + if (entry.getValue().isJsonNull()) { + continue; + } + categoryWorth.put(entry.getKey(), entry.getValue().getAsLong()); + } + + //Sort keys based on category value + keys = categoryWorth.keySet().stream().sorted(Comparator.comparingLong(k->getCategory((String) k)).reversed()).toArray(String[]::new); + } + + private SoopyNetworthData setLoading() { + totalWorth = -2l; + return this; + } + + public long getTotal() { + return totalWorth; + } + + public long getCategory(String name) { + if (categoryWorth.containsKey(name)) return categoryWorth.get(name); + return 0; + } + + public String[] getCategories() { + return keys; + } + } + + /** + * Returns SoopyNetworthData with total = -1 if error + * Returns null if still loading + */ + public SoopyNetworthData getSoopyNetworth(String profileName, Runnable callback) { + if (profileName == null) profileName = latestProfile; + if (soopyNetworth.get(profileName) != null) { + callback.run(); + return soopyNetworth.get(profileName); + } + + JsonArray playerInfo = getSkyblockProfiles(() -> {}); + if (playerInfo == null) return null; //Not sure how to support the callback in these cases + if (updatingSoopyNetworth.get()) return new SoopyNetworthData(null).setLoading(); //It shouldent really matter tho as these should never occur in /peek + updatingSoopyNetworth.set(true); + + manager.apiUtils + .request() + .url("https://soopy.dev/api/v2/player_networth/" + this.uuid) + .method("POST") + .postData("application/json", skyblockProfiles.toString()) + .requestJson() + .handle((jsonObject, throwable) -> { + if (throwable != null) throwable.printStackTrace(); + if (throwable != null || !jsonObject.has("success") || !jsonObject.get("success").getAsBoolean()) { + //Something went wrong + //Set profile networths to null to indicate that + for (int i = 0; i < skyblockProfiles.size(); i++) { + if (!skyblockProfiles.get(i).isJsonObject()) { + return null; + } + JsonObject profile = skyblockProfiles.get(i).getAsJsonObject(); + + String cuteName = profile.get("cute_name").getAsString(); + + soopyNetworth.put(cuteName, new SoopyNetworthData(null)); + } + updatingSoopyNetworth.set(false); + callback.run(); + return null; + } + + //Success, update networth data + for (int i = 0; i < skyblockProfiles.size(); i++) { + if (!skyblockProfiles.get(i).isJsonObject()) { + return null; + } + JsonObject profile = skyblockProfiles.get(i).getAsJsonObject(); + + String cuteName = profile.get("cute_name").getAsString(); + String profileId = profile.get("profile_id").getAsString(); + + SoopyNetworthData networth; + if (jsonObject.getAsJsonObject("data").get(profileId).isJsonNull()) { + networth = new SoopyNetworthData(null); + } else { + networth = new SoopyNetworthData(jsonObject.getAsJsonObject("data").get(profileId).getAsJsonObject()); + } + + soopyNetworth.put(cuteName, networth); + } + + updatingSoopyNetworth.set(false); + callback.run(); + return null; + }); + return null; + } + public long getNetWorth(String profileName) { if (profileName == null) profileName = latestProfile; if (networth.get(profileName) != null) return networth.get(profileName); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java b/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java index 8c594911..7818c3c0 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/ApiUtil.java @@ -33,6 +33,7 @@ import javax.net.ssl.SSLContext; import javax.net.ssl.TrustManagerFactory; import java.io.IOException; import java.io.InputStream; +import java.io.OutputStream; import java.net.HttpURLConnection; import java.net.MalformedURLException; import java.net.URISyntaxException; @@ -82,6 +83,8 @@ public class ApiUtil { private String baseUrl = null; private boolean shouldGunzip = false; private String method = "GET"; + private String postData = null; + private String postContentType = null; public Request method(String method) { this.method = method; @@ -108,6 +111,12 @@ public class ApiUtil { return this; } + public Request postData(String contentType, String data) { + this.postContentType = contentType; + this.postData = data; + return this; + } + private CompletableFuture buildUrl() { CompletableFuture fut = new CompletableFuture<>(); try { @@ -140,6 +149,18 @@ public class ApiUtil { conn.setConnectTimeout(10000); conn.setReadTimeout(10000); conn.setRequestProperty("User-Agent", USER_AGENT); + if (this.postContentType != null) { + conn.setRequestProperty("Content-Type", this.postContentType); + } + if (this.postData != null) { + conn.setDoOutput(true); + OutputStream os = conn.getOutputStream(); + try { + os.write(this.postData.getBytes("utf-8")); + } finally { + os.close(); + } + } inputStream = conn.getInputStream(); -- cgit From 5f2cfe2d07e0ddfc4f600d6ea31bad11d896e72f Mon Sep 17 00:00:00 2001 From: efefury <69400149+efefury@users.noreply.github.com> Date: Fri, 21 Oct 2022 08:18:32 +0000 Subject: misc pv changes (#314) --- .../notenoughupdates/profileviewer/BasicPage.java | 108 ++++++++++-- .../notenoughupdates/profileviewer/ExtraPage.java | 185 +++++++-------------- .../profileviewer/GuiProfileViewer.java | 32 +++- .../weight/weight/DungeonsWeight.java | 2 +- .../profileviewer/weight/weight/SkillsWeight.java | 4 +- 5 files changed, 181 insertions(+), 150 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java index a0a78938..9ef9e474 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/BasicPage.java @@ -66,6 +66,7 @@ import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; import java.util.concurrent.ThreadPoolExecutor; +import static io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer.DECIMAL_FORMAT; import static io.github.moulberry.notenoughupdates.util.Utils.roundToNearestInt; public class BasicPage extends GuiProfileViewerPage { @@ -74,6 +75,13 @@ public class BasicPage extends GuiProfileViewerPage { private static final ExecutorService profileLoader = Executors.newFixedThreadPool(1); public EntityOtherPlayerMP entityPlayer = null; private ResourceLocation playerLocationSkin = null; + private final GuiProfileViewer guiProfileViewer; + + private final String[] medalNames = { + "§cBronze", + "§fSilver", + "§6Gold" + }; private ResourceLocation playerLocationCape = null; private String skinType = null; private boolean loadingProfile = false; @@ -82,6 +90,7 @@ public class BasicPage extends GuiProfileViewerPage { public BasicPage(GuiProfileViewer instance) { super(instance); + this.guiProfileViewer = instance; } @Override @@ -154,6 +163,8 @@ public class BasicPage extends GuiProfileViewerPage { Minecraft.getMinecraft().getTextureManager().bindTexture(pv_basic); Utils.drawTexturedRect(guiLeft, guiTop, getInstance().sizeX, getInstance().sizeY, GL11.GL_NEAREST); + JsonObject profileInfo = profile.getProfileInformation(profileId); + if (profileInfo == null) return; if (entityPlayer != null && profile.getHypixelProfile() != null) { String playerName = null; @@ -201,8 +212,11 @@ public class BasicPage extends GuiProfileViewerPage { playerName = EnumChatFormatting.GRAY + name; if (rankName != null) { + String icon = getIcon(getGameModeType(profileInfo)); playerName = - "\u00A7" + rankColor + "[" + rankName + rankPlusColor + rankPlus + "\u00A7" + rankColor + "] " + name; + "\u00A7" + rankColor + "[" + rankName + rankPlusColor + rankPlus + "\u00A7" + rankColor + "] " + name + + (icon.equals("") ? "" : " " + icon); + ; } } } @@ -404,9 +418,6 @@ public class BasicPage extends GuiProfileViewerPage { entityPlayer.getDataWatcher().updateObject(10, b); } - JsonObject profileInfo = profile.getProfileInformation(profileId); - if (profileInfo == null) return; - Map skyblockInfo = profile.getSkyblockInfo(profileId); JsonObject inventoryInfo = profile.getInventoryInfo(profileId); @@ -636,42 +647,85 @@ public class BasicPage extends GuiProfileViewerPage { String skillName = entry.getValue().getDisplayName(); - float level = skyblockInfo.get(entry.getKey()).level; - int levelFloored = (int) Math.floor(level); + ProfileViewer.Level level = skyblockInfo.get(entry.getKey()); + int levelFloored = (int) Math.floor(level.level); int x = guiLeft + 237 + 86 * xPosition; int y = guiTop + 24 + 21 * yPosition; Utils.renderAlignedString(skillName, EnumChatFormatting.WHITE.toString() + levelFloored, x + 14, y - 4, 60); - if (skyblockInfo.get(entry.getKey()).maxed) { + if (level.maxed) { getInstance().renderGoldBar(x, y + 6, 80); } else { - getInstance().renderBar(x, y + 6, 80, level % 1); + getInstance().renderBar(x, y + 6, 80, level.level % 1); } if (mouseX > x && mouseX < x + 80) { if (mouseY > y - 4 && mouseY < y + 13) { getInstance().tooltipToDisplay = new ArrayList<>(); - getInstance().tooltipToDisplay.add(skillName); - if (skyblockInfo.get(entry.getKey()).maxed) { - getInstance().tooltipToDisplay.add( + List tooltipToDisplay = getInstance().tooltipToDisplay; + tooltipToDisplay.add(skillName); + if (level.maxed) { + tooltipToDisplay.add( EnumChatFormatting.GRAY + "Progress: " + EnumChatFormatting.GOLD + "MAXED!"); } else { - int maxXp = (int) skyblockInfo.get(entry.getKey()).maxXpForLevel; + int maxXp = (int) level.maxXpForLevel; getInstance() .tooltipToDisplay.add( EnumChatFormatting.GRAY + "Progress: " + EnumChatFormatting.DARK_PURPLE + - StringUtils.shortNumberFormat(Math.round((level % 1) * maxXp)) + + StringUtils.shortNumberFormat(Math.round((level.level % 1) * maxXp)) + "/" + - StringUtils.shortNumberFormat(maxXp) + StringUtils.shortNumberFormat(maxXp)); + } + String totalXpS = GuiProfileViewer.numberFormat.format((int) level.totalXp); + tooltipToDisplay.add(EnumChatFormatting.GRAY + "Total XP: " + EnumChatFormatting.DARK_PURPLE + totalXpS + + EnumChatFormatting.DARK_GRAY + " (" + + DECIMAL_FORMAT.format(guiProfileViewer.getPercentage(entry.getKey().toLowerCase(), level)) + + "% to " + level.maxLevel + ")"); + if (entry.getKey().equals("farming")) { + // double drops + pelts + int doubleDrops = Utils.getElementAsInt(Utils.getElement(profileInfo, "jacob2.perks.double_drops"), 0); + int peltCount = Utils.getElementAsInt(Utils.getElement(profileInfo, "trapper_quest.pelt_count"), 0); + + if (doubleDrops == 15) { + tooltipToDisplay.add("§7Double Drops: §6" + (doubleDrops * 2) + "%"); + } else tooltipToDisplay.add("§7Double Drops: §5" + (doubleDrops * 2) + "%"); + + tooltipToDisplay.add("§7Pelts: §e" + peltCount); + + // medals + JsonObject medals_inv = Utils.getElement(profileInfo, "jacob2.medals_inv").getAsJsonObject(); + tooltipToDisplay.add(" "); + for (String medalName : medalNames) { + String textWithoutFormattingCodes = + EnumChatFormatting.getTextWithoutFormattingCodes(medalName.toLowerCase()); + if (medals_inv.has(textWithoutFormattingCodes)) { + int medalAmount = medals_inv.get(textWithoutFormattingCodes).getAsInt(); + tooltipToDisplay.add(EnumChatFormatting.GRAY + WordUtils.capitalize(medalName) + ": " + + EnumChatFormatting.WHITE + medalAmount); + } else { + tooltipToDisplay.add(EnumChatFormatting.GRAY + WordUtils.capitalize(medalName) + ": " + + EnumChatFormatting.WHITE + "0"); + } + } + } + + String slayerNameLower = entry.getKey().toLowerCase(); + if (ExtraPage.slayers.containsKey(slayerNameLower)) { + int maxLevel = ExtraPage.slayers.get(slayerNameLower); + for (int i = 0; i < 5; i++) { + if (i >= maxLevel) break; + float tier = Utils.getElementAsFloat( + Utils.getElement(profileInfo, "slayer_bosses." + slayerNameLower + ".boss_kills_tier_" + i), + 0 ); + tooltipToDisplay.add(EnumChatFormatting.GRAY + "T" + (i + 1) + " Kills: " + + EnumChatFormatting.RED + (int) tier); + } } - String totalXpS = GuiProfileViewer.numberFormat.format((int) skyblockInfo.get(entry.getKey()).totalXp); - getInstance() - .tooltipToDisplay.add(EnumChatFormatting.GRAY + "Total XP: " + EnumChatFormatting.DARK_PURPLE + totalXpS); } } @@ -697,6 +751,19 @@ public class BasicPage extends GuiProfileViewerPage { renderWeight(mouseX, mouseY, skyblockInfo, profileInfo); } + private String getIcon(String gameModeType) { + switch (gameModeType) { + case "island": + return "§a☀"; + case "bingo": + return "§7Ⓑ"; + case "ironman": + return "§7♲"; + default: + return ""; + } + } + @Override public void resetCache() { entityPlayer = null; @@ -887,4 +954,11 @@ public class BasicPage extends GuiProfileViewerPage { GlStateManager.disableTexture2D(); GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit); } + + public String getGameModeType(JsonObject profileInfo) { + if (profileInfo != null && profileInfo.has("game_mode")) { + return profileInfo.get("game_mode").getAsString(); + } + return ""; + } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java index 3b30b9b7..f8da4144 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java @@ -19,9 +19,11 @@ package io.github.moulberry.notenoughupdates.profileviewer; +import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonPrimitive; +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.core.util.StringUtils; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.Utils; @@ -36,6 +38,7 @@ import java.time.LocalDateTime; import java.time.ZoneId; import java.time.format.DateTimeFormatter; import java.util.Arrays; +import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -53,6 +56,58 @@ public class ExtraPage extends GuiProfileViewerPage { super(instance); } + // pls update in the future tyvm !!! + final static HashMap slayers = new HashMap() { + { + put("zombie", 5); + put("spider", 4); + put("wolf", 4); + put("enderman", 4); + put("blaze", 4); + } + }; + + public void drawEssence( + JsonObject profileInfo, + float xStart, + float yStartTop, + float xOffset, + float yOffset) { + int guiLeft = GuiProfileViewer.getGuiLeft(); + int guiTop = GuiProfileViewer.getGuiTop(); + yStartTop = yStartTop + 78; + if (Constants.PARENTS == null || !Constants.PARENTS.has("ESSENCE_WITHER")) { + Utils.showOutdatedRepoNotification(); + return; + } + JsonObject parents = Constants.PARENTS; + JsonArray essenceArray = parents.get("ESSENCE_WITHER").getAsJsonArray(); + + for (int i = 0; i < essenceArray.size(); i++) { + + JsonElement jsonElement = essenceArray.get(i); + String essenceName = jsonElement.getAsString(); + + TreeMap itemInformation = NotEnoughUpdates.INSTANCE.manager.getItemInformation(); + if (!itemInformation.containsKey(essenceName)) { + Utils.showOutdatedRepoNotification(); + return; + } + String displayName = itemInformation.get(essenceName).getAsJsonObject().get("displayname").getAsString(); + if (profileInfo.has(essenceName.toLowerCase())) { + int essenceNumber = profileInfo.get(essenceName.toLowerCase()).getAsInt(); + + Utils.renderAlignedString( + EnumChatFormatting.GOLD + displayName, + EnumChatFormatting.WHITE + StringUtils.shortNumberFormat(essenceNumber, 0), + guiLeft + xStart + xOffset, + guiTop + yStartTop + yOffset * i, + 76 + ); + } + } + } + @Override public void drawPage(int mouseX, int mouseY, float partialTicks) { int guiLeft = GuiProfileViewer.getGuiLeft(); @@ -159,14 +214,13 @@ public class ExtraPage extends GuiProfileViewerPage { "alchemy", "carpentry" ); - List slayers = Arrays.asList("zombie", "spider", "wolf", "enderman", "blaze"); for (Map.Entry entry : skyblockInfo.entrySet()) { if (skills.contains(entry.getKey())) { totalSkillLVL += entry.getValue().level; totalTrueSkillLVL += Math.floor(entry.getValue().level); totalSkillCount++; - } else if (slayers.contains(entry.getKey())) { + } else if (slayers.containsKey(entry.getKey())) { totalSlayerLVL += entry.getValue().level; totalSlayerCount++; totalSlayerXP += entry.getValue().totalXp; @@ -266,131 +320,6 @@ public class ExtraPage extends GuiProfileViewerPage { 76 ); - //Slayer values - float zombie_boss_kills_tier_2 = Utils.getElementAsFloat( - Utils.getElement(profileInfo, "slayer_bosses.zombie.boss_kills_tier_2"), - 0 - ); - float zombie_boss_kills_tier_3 = Utils.getElementAsFloat( - Utils.getElement(profileInfo, "slayer_bosses.zombie.boss_kills_tier_3"), - 0 - ); - float zombie_boss_kills_tier_4 = Utils.getElementAsFloat( - Utils.getElement(profileInfo, "slayer_bosses.zombie.boss_kills_tier_4"), - 0 - ); - float wolf_boss_kills_tier_2 = Utils.getElementAsFloat(Utils.getElement( - profileInfo, - "slayer_bosses.wolf.boss_kills_tier_2" - ), 0); - float wolf_boss_kills_tier_3 = Utils.getElementAsFloat(Utils.getElement( - profileInfo, - "slayer_bosses.wolf.boss_kills_tier_3" - ), 0); - float spider_boss_kills_tier_2 = Utils.getElementAsFloat( - Utils.getElement(profileInfo, "slayer_bosses.spider.boss_kills_tier_2"), - 0 - ); - float spider_boss_kills_tier_3 = Utils.getElementAsFloat( - Utils.getElement(profileInfo, "slayer_bosses.spider.boss_kills_tier_3"), - 0 - ); - float enderman_boss_kills_tier_2 = Utils.getElementAsFloat( - Utils.getElement(profileInfo, "slayer_bosses.enderman.boss_kills_tier_2"), - 0 - ); - float enderman_boss_kills_tier_3 = Utils.getElementAsFloat( - Utils.getElement(profileInfo, "slayer_bosses.enderman.boss_kills_tier_3"), - 0 - ); - float blaze_boss_kills_tier_2 = Utils.getElementAsFloat(Utils.getElement( - profileInfo, - "slayer_bosses.blaze.boss_kills_tier_2" - ), 0); - float blaze_boss_kills_tier_3 = Utils.getElementAsFloat(Utils.getElement( - profileInfo, - "slayer_bosses.blaze.boss_kills_tier_3" - ), 0); - - Utils.renderAlignedString( - EnumChatFormatting.DARK_AQUA + "Revenant T3", - EnumChatFormatting.WHITE.toString() + (int) zombie_boss_kills_tier_2, - guiLeft + xStart + xOffset, - guiTop + yStartBottom, - 76 - ); - Utils.renderAlignedString( - EnumChatFormatting.DARK_AQUA + "Revenant T4", - EnumChatFormatting.WHITE.toString() + (int) zombie_boss_kills_tier_3, - guiLeft + xStart + xOffset, - guiTop + yStartBottom + yOffset, - 76 - ); - Utils.renderAlignedString( - EnumChatFormatting.DARK_AQUA + "Revenant T5", - EnumChatFormatting.WHITE.toString() + (int) zombie_boss_kills_tier_4, - guiLeft + xStart + xOffset, - guiTop + yStartBottom + yOffset * 2, - 76 - ); - Utils.renderAlignedString( - EnumChatFormatting.DARK_AQUA + "Tarantula T3", - EnumChatFormatting.WHITE.toString() + (int) spider_boss_kills_tier_2, - guiLeft + xStart + xOffset, - guiTop + yStartBottom + yOffset * 3, - 76 - ); - Utils.renderAlignedString( - EnumChatFormatting.DARK_AQUA + "Tarantula T4", - EnumChatFormatting.WHITE.toString() + (int) spider_boss_kills_tier_3, - guiLeft + xStart + xOffset, - guiTop + yStartBottom + yOffset * 4, - 76 - ); - - Utils.renderAlignedString( - EnumChatFormatting.DARK_AQUA + "Sven T3", - EnumChatFormatting.WHITE.toString() + (int) wolf_boss_kills_tier_2, - guiLeft + xStart + xOffset * 2, - guiTop + yStartBottom + yOffset * 0, - 76 - ); - Utils.renderAlignedString( - EnumChatFormatting.DARK_AQUA + "Sven T4", - EnumChatFormatting.WHITE.toString() + (int) wolf_boss_kills_tier_3, - guiLeft + xStart + xOffset * 2, - guiTop + yStartBottom + yOffset * 1, - 76 - ); - Utils.renderAlignedString( - EnumChatFormatting.DARK_AQUA + "Voidgloom T3", - EnumChatFormatting.WHITE.toString() + (int) enderman_boss_kills_tier_2, - guiLeft + xStart + xOffset * 2, - guiTop + yStartBottom + yOffset * 2, - 76 - ); - Utils.renderAlignedString( - EnumChatFormatting.DARK_AQUA + "Voidgloom T4", - EnumChatFormatting.WHITE.toString() + (int) enderman_boss_kills_tier_3, - guiLeft + xStart + xOffset * 2, - guiTop + yStartBottom + yOffset * 3, - 76 - ); - Utils.renderAlignedString( - EnumChatFormatting.DARK_AQUA + "Inferno T3", - EnumChatFormatting.WHITE.toString() + (int) blaze_boss_kills_tier_2, - guiLeft + xStart + xOffset * 2, - guiTop + yStartBottom + yOffset * 4, - 76 - ); - Utils.renderAlignedString( - EnumChatFormatting.DARK_AQUA + "Inferno T4", - EnumChatFormatting.WHITE.toString() + (int) blaze_boss_kills_tier_3, - guiLeft + xStart + xOffset * 2, - guiTop + yStartBottom + yOffset * 5, - 76 - ); - float pet_milestone_ores_mined = Utils.getElementAsFloat(Utils.getElement( profileInfo, "stats.pet_milestone_ores_mined" @@ -447,6 +376,8 @@ public class ExtraPage extends GuiProfileViewerPage { 76 ); + drawEssence(profileInfo, xStart, yStartTop, xOffset, yOffset); + if (topKills == null) { topKills = new TreeMap<>(); JsonObject stats = profileInfo.get("stats").getAsJsonObject(); 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 501af179..c78a6167 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -29,6 +29,8 @@ import io.github.moulberry.notenoughupdates.itemeditor.GuiElementTextField; import io.github.moulberry.notenoughupdates.miscfeatures.PetInfoOverlay; import io.github.moulberry.notenoughupdates.profileviewer.bestiary.BestiaryPage; import io.github.moulberry.notenoughupdates.profileviewer.trophy.TrophyFishPage; +import io.github.moulberry.notenoughupdates.profileviewer.weight.weight.DungeonsWeight; +import io.github.moulberry.notenoughupdates.profileviewer.weight.weight.SkillsWeight; import io.github.moulberry.notenoughupdates.util.AsyncDependencyLoader; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.PronounDB; @@ -58,6 +60,7 @@ import java.awt.*; import java.io.IOException; import java.net.URI; import java.net.URISyntaxException; +import java.text.DecimalFormat; import java.text.NumberFormat; import java.util.ArrayList; import java.util.Collections; @@ -76,6 +79,8 @@ public class GuiProfileViewer extends GuiScreen { 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 final static DecimalFormat DECIMAL_FORMAT = new DecimalFormat("#.#"); public static final ResourceLocation pv_stranded = new ResourceLocation("notenoughupdates:pv_stranded.png"); public static final ResourceLocation pv_unknown = new ResourceLocation("notenoughupdates:pv_unknown.png"); public static final ResourceLocation resource_packs = @@ -1024,9 +1029,11 @@ public class GuiProfileViewer extends GuiScreen { if (mouseY > y - 4 && mouseY < y + 13) { String levelStr; String totalXpStr = null; - if (skillName.contains("Catacombs")) totalXpStr = - EnumChatFormatting.GRAY + "Total XP: " + EnumChatFormatting.DARK_PURPLE + - numberFormat.format(levelObj.totalXp); + if (skillName.contains("Catacombs")) { + totalXpStr = EnumChatFormatting.GRAY + "Total XP: " + EnumChatFormatting.DARK_PURPLE + + numberFormat.format(levelObj.totalXp) + EnumChatFormatting.DARK_GRAY + " (" + + DECIMAL_FORMAT.format(getPercentage(skillName.toLowerCase(), levelObj)) + "% to 50)"; + } if (levelObj.maxed) { levelStr = EnumChatFormatting.GOLD + "MAXED!"; } else { @@ -1238,6 +1245,25 @@ public class GuiProfileViewer extends GuiScreen { } } + public float getPercentage(String skillName, ProfileViewer.Level level) { + if (level.maxed) { + return 100; + } + if (skillName.contains("catacombs")) { + return (level.totalXp / DungeonsWeight.CATACOMBS_LEVEL_50_XP) * 100; + } else if (ExtraPage.slayers.containsKey(skillName)) { + return (level.totalXp / 1000000) * 100; + } else if (skillName.equalsIgnoreCase("social")) { + return (level.totalXp / 272800) * 100; + } else { + if (level.maxLevel == 60) { + return (level.totalXp / SkillsWeight.SKILLS_LEVEL_60) * 100; + } else { + return (level.totalXp / SkillsWeight.SKILLS_LEVEL_50) * 100; + } + } + } + /** * Renders a subsection of the blurred framebuffer on to the corresponding section of the screen. * Essentially, this method will "blur" the background inside the bounds specified by [x->x+blurWidth, y->y+blurHeight] diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/weight/weight/DungeonsWeight.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/weight/weight/DungeonsWeight.java index 39e743aa..9c233554 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/weight/weight/DungeonsWeight.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/weight/weight/DungeonsWeight.java @@ -24,7 +24,7 @@ import java.util.Map; public abstract class DungeonsWeight { - protected static final long CATACOMBS_LEVEL_50_XP = 569809640; + public static final long CATACOMBS_LEVEL_50_XP = 569809640; protected final Map player; protected final WeightStruct weightStruct; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/weight/weight/SkillsWeight.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/weight/weight/SkillsWeight.java index 55669f7b..5c372591 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/weight/weight/SkillsWeight.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/weight/weight/SkillsWeight.java @@ -24,8 +24,8 @@ import java.util.Map; public abstract class SkillsWeight { - protected static final long SKILLS_LEVEL_50 = 55172425; - protected static final long SKILLS_LEVEL_60 = 111672425; + public static final long SKILLS_LEVEL_50 = 55172425; + public static final long SKILLS_LEVEL_60 = 111672425; protected final Map player; protected final WeightStruct weightStruct; -- cgit From 9d62422902e2cb9a90b7a58089e892b61faf9f74 Mon Sep 17 00:00:00 2001 From: Ascynx <78341107+Ascynx@users.noreply.github.com> Date: Fri, 21 Oct 2022 10:28:33 +0200 Subject: AND | OR support for container search. (#311) --- .../moulberry/notenoughupdates/NEUManager.java | 39 +++++++++++++++++++--- 1 file changed, 34 insertions(+), 5 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java index 598ecc2e..710bdd6c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -428,6 +428,33 @@ public class NEUManager { return debugBuilder.toString(); } + /** + * SearchString but with AND | OR support + */ + + public boolean multiSearchString(String match, String query) { + boolean totalMatches = false; + + StringBuilder query2 = new StringBuilder(); + char lastOp = '|'; + for (char c : query.toCharArray()) { + if (c == '|' || c == '&') { + boolean matches = searchString(match, query2.toString()); + totalMatches = lastOp == '|' ? totalMatches || matches : totalMatches && matches; + + query2 = new StringBuilder(); + lastOp = c; + } else { + query2.append(c); + } + } + + boolean matches = searchString(match, query2.toString()); + totalMatches = lastOp == '|' ? totalMatches || matches : totalMatches && matches; + + return totalMatches; + } + /** * Searches a string for a query. This method is used to mimic the behaviour of the more complex map-based search * function. This method is used for the chest-item-search feature. @@ -490,7 +517,7 @@ public class NEUManager { public boolean doesStackMatchSearch(ItemStack stack, String query) { if (query.startsWith("title:")) { query = query.substring(6); - return searchString(stack.getDisplayName(), query); + return multiSearchString(stack.getDisplayName(), query); } else if (query.startsWith("desc:")) { query = query.substring(5); String lore = ""; @@ -504,7 +531,7 @@ public class NEUManager { } } } - return searchString(lore, query); + return multiSearchString(lore, query); } else if (query.startsWith("id:")) { query = query.substring(3); String internalName = getInternalNameForItem(stack); @@ -516,9 +543,11 @@ public class NEUManager { for (char c : query.toCharArray()) { sb.append(c).append(" "); } - result = result || searchString(stack.getDisplayName(), sb.toString()); + result = result || multiSearchString(stack.getDisplayName(), sb.toString()); } - result = result || searchString(stack.getDisplayName(), query); + + + result = result || multiSearchString(stack.getDisplayName(), query); String lore = ""; NBTTagCompound tag = stack.getTagCompound(); @@ -532,7 +561,7 @@ public class NEUManager { } } - result = result || searchString(lore, query); + result = result || multiSearchString(lore, query); return result; } -- cgit From 336cbfb4c275528baf9f3ffc7a62c0eaa310e76f Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:42:08 +0200 Subject: Remove thingy that made me very angry (#388) * Remove thingy that made me very angry * Revert that --- .../java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 39826ded..ea674610 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -263,10 +263,8 @@ public class NotEnoughUpdates { } // Remove after 2.1 ig - if ("dangerous".equals(config.apiData.repoBranch) || "rune".equals(config.apiData.repoBranch)) { + if ("dangerous".equals(config.apiData.repoBranch)) { config.apiData.repoBranch = "master"; - } else if ("jani270".equals(config.apiData.repoUser)) { - config.apiData.repoUser = "NotEnoughUpdates"; } saveConfig(); -- cgit From e95971ee12531b14246d9a31eff0c8b4e66bfe18 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:52:41 +0200 Subject: Fixed NPE (#389) Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../github/moulberry/notenoughupdates/listener/ChatListener.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java index d4e98ba7..62937afc 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java @@ -127,8 +127,13 @@ public class ChatListener { if (chatComponent.getSiblings().get(0).getChatStyle().getChatClickEvent().getValue().startsWith("/viewprofile")) { startsWith = "/viewprofile"; partyOrGuildChat = true; - } else if (chatComponent.getChatStyle().getChatClickEvent().getValue().startsWith("/socialoptions")) { - startsWith = "/socialoptions"; + } else { + ClickEvent chatClickEvent = chatComponent.getChatStyle().getChatClickEvent(); + if (chatClickEvent != null) { + if (chatClickEvent.getValue().startsWith("/socialoptions")) { + startsWith = "/socialoptions"; + } + } } if (startsWith != null) { -- cgit From 78714fc2fddb99ba9f1239d7d0d95837a312cbb8 Mon Sep 17 00:00:00 2001 From: Cobble8 <41165207+Cobble8@users.noreply.github.com> Date: Fri, 21 Oct 2022 10:28:32 -0400 Subject: Made cool kill/death stuff in profile viewer (#376) --- .../notenoughupdates/profileviewer/ExtraPage.java | 97 ++++++++++++++++++---- .../profileviewer/GuiProfileViewer.java | 5 ++ 2 files changed, 84 insertions(+), 18 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java index f8da4144..a0af254c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/ExtraPage.java @@ -31,8 +31,10 @@ import net.minecraft.client.Minecraft; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.ResourceLocation; import org.apache.commons.lang3.text.WordUtils; +import org.lwjgl.input.Mouse; import org.lwjgl.opengl.GL11; +import java.io.IOException; import java.time.Instant; import java.time.LocalDateTime; import java.time.ZoneId; @@ -41,6 +43,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.List; +import java.util.Locale; import java.util.Map; import java.util.Set; import java.util.TimeZone; @@ -51,9 +54,43 @@ public class ExtraPage extends GuiProfileViewerPage { private static final ResourceLocation pv_extra = new ResourceLocation("notenoughupdates:pv_extra.png"); private TreeMap> topKills = null; private TreeMap> topDeaths = null; + private int deathScroll = 0; + private int killScroll = 0; + private int mouseDWheel = 0; + public ExtraPage(GuiProfileViewer instance) { super(instance); + getInstance().killDeathSearchTextField.setSize(80, 12); + } + + @Override + public void keyTyped(char typedChar, int keyCode) throws IOException { + super.keyTyped(typedChar, keyCode); + if (getInstance().killDeathSearchTextField.getFocus()) { + getInstance().killDeathSearchTextField.keyTyped(typedChar, keyCode); + killScroll = 0; + deathScroll = 0; + } + } + + @Override + public boolean mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException { + super.mouseClicked(mouseX, mouseY, mouseButton); + //Note: don't know why it made me make it return a boolean, but it fixed the error, so I left it alone. + + //Dimensions: X: guiLeft + xStart + xOffset * 3, Y: guiTop + yStartBottom + 77, Width: 80, Height: 12 + if (mouseX >= GuiProfileViewer.getGuiLeft() + 22 + 103 * 3 && + mouseX <= GuiProfileViewer.getGuiLeft() + 22 + 103 * 3 + 80 && + mouseY >= GuiProfileViewer.getGuiTop() + 105 + 77 && mouseY <= GuiProfileViewer.getGuiTop() + 105 + 77 + 12) { + getInstance().killDeathSearchTextField.mouseClicked(mouseX, mouseY, mouseButton); + getInstance().playerNameTextField.otherComponentClick(); + return true; + } + + getInstance().killDeathSearchTextField.otherComponentClick(); + + return false; } // pls update in the future tyvm !!! @@ -411,35 +448,59 @@ public class ExtraPage extends GuiProfileViewerPage { } } + getInstance().killDeathSearchTextField.render((int) (guiLeft + xStart + xOffset * 3), (int) (guiTop + yStartBottom + 77)); + + float killDeathX = guiLeft + xStart + xOffset * 3; + if(mouseX >= killDeathX && mouseX <= killDeathX+76) { + if(mouseY >= guiTop + yStartTop && mouseY <= guiTop + yStartTop + 65) { + if(mouseDWheel != 0) {if(mouseDWheel > 0) {killScroll-=1;} else {killScroll+=1;}} mouseDWheel = Mouse.getDWheel(); + if(killScroll < 0) {killScroll = 0;} + } else if(mouseY >= guiTop + yStartBottom && mouseY <= guiTop + yStartBottom + 65) { + if(mouseDWheel != 0) {if(mouseDWheel > 0) {deathScroll-=1;} else {deathScroll+=1;}} mouseDWheel = Mouse.getDWheel(); + if(deathScroll < 0) {deathScroll = 0;} + } + + } + int index = 0; + int skipCount = 0; for (int killCount : topKills.descendingKeySet()) { - if (index >= 6) break; Set kills = topKills.get(killCount); for (String killType : kills) { - if (index >= 6) break; - Utils.renderAlignedString( - EnumChatFormatting.YELLOW + killType + " Kills", - EnumChatFormatting.WHITE.toString() + killCount, - guiLeft + xStart + xOffset * 3, - guiTop + yStartTop + yOffset * index, - 76 - ); + boolean isSearch = getInstance().killDeathSearchTextField.getText().isEmpty() || killType.toLowerCase(Locale.ROOT).contains(getInstance().killDeathSearchTextField.getText().toLowerCase(Locale.ROOT)); + float killY = guiTop + yStartTop + yOffset * ((index-skipCount) - killScroll); + if(!isSearch) skipCount++; + if(isSearch && killY+6 < guiTop+yStartTop+65 && killY >= guiTop + yStartTop) { + Utils.renderAlignedString( + EnumChatFormatting.YELLOW + killType + " Kills", + EnumChatFormatting.WHITE.toString() + killCount, + killDeathX, + killY, + 76 + ); + } + + index++; } } index = 0; + skipCount = 0; for (int deathCount : topDeaths.descendingKeySet()) { - if (index >= 6) break; Set deaths = topDeaths.get(deathCount); for (String deathType : deaths) { - if (index >= 6) break; - Utils.renderAlignedString( - EnumChatFormatting.YELLOW + "Deaths: " + deathType, - EnumChatFormatting.WHITE.toString() + deathCount, - guiLeft + xStart + xOffset * 3, - guiTop + yStartBottom + yOffset * index, - 76 - ); + boolean isSearch = getInstance().killDeathSearchTextField.getText().isEmpty() || deathType.toLowerCase(Locale.ROOT).contains(getInstance().killDeathSearchTextField.getText().toLowerCase(Locale.ROOT)); + float deathY = guiTop + yStartBottom + yOffset * ((index-skipCount) - deathScroll); + if(!isSearch) skipCount++; + if(isSearch && deathY+6 < guiTop+yStartBottom+65 && deathY >= guiTop + yStartBottom) { + Utils.renderAlignedString( + EnumChatFormatting.YELLOW + "Deaths: " + deathType, + EnumChatFormatting.WHITE.toString() + deathCount, + killDeathX, + deathY, + 76 + ); + } index++; } } 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 c78a6167..f327dae5 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/GuiProfileViewer.java @@ -176,6 +176,7 @@ public class GuiProfileViewer extends GuiScreen { ); public final GuiElementTextField playerNameTextField; public final GuiElementTextField inventoryTextField = new GuiElementTextField("", GuiElementTextField.SCALE_TEXT); + public final GuiElementTextField killDeathSearchTextField = new GuiElementTextField("", GuiElementTextField.SCALE_TEXT); private final Map pages = new HashMap<>(); public int sizeX; public int sizeY; @@ -874,6 +875,7 @@ public class GuiProfileViewer extends GuiScreen { currentPage = page; inventoryTextField.otherComponentClick(); playerNameTextField.otherComponentClick(); + killDeathSearchTextField.otherComponentClick(); return; } } @@ -890,6 +892,7 @@ public class GuiProfileViewer extends GuiScreen { if (mouseY > guiTop + sizeY + 5 && mouseY < guiTop + sizeY + 25) { playerNameTextField.mouseClicked(mouseX, mouseY, mouseButton); inventoryTextField.otherComponentClick(); + killDeathSearchTextField.otherComponentClick(); return; } } @@ -961,11 +964,13 @@ public class GuiProfileViewer extends GuiScreen { } playerNameTextField.otherComponentClick(); inventoryTextField.otherComponentClick(); + killDeathSearchTextField.otherComponentClick(); return; } profileDropdownSelected = false; playerNameTextField.otherComponentClick(); inventoryTextField.otherComponentClick(); + killDeathSearchTextField.otherComponentClick(); } @Override -- cgit From 72adbc192fc53cd90408f4382b66310d77e2be2a Mon Sep 17 00:00:00 2001 From: KingsMMA <63374258+KingsMMA@users.noreply.github.com> Date: Sat, 22 Oct 2022 00:31:07 +1000 Subject: Added Powder Grinding Tracker (#263) --- .../notenoughupdates/NotEnoughUpdates.java | 11 ++ .../notenoughupdates/listener/ChatListener.java | 9 +- .../notenoughupdates/listener/WorldListener.java | 41 +++++ .../notenoughupdates/options/NEUConfig.java | 18 ++ .../options/seperateSections/LocationEdit.java | 12 ++ .../options/seperateSections/Mining.java | 75 +++++++- .../notenoughupdates/overlays/OverlayManager.java | 19 +++ .../overlays/PowderGrindingOverlay.java | 188 +++++++++++++++++++++ .../moulberry/notenoughupdates/util/SBInfo.java | 17 +- 9 files changed, 383 insertions(+), 7 deletions(-) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/listener/WorldListener.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/overlays/PowderGrindingOverlay.java diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index ea674610..054cbca4 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -35,6 +35,7 @@ import io.github.moulberry.notenoughupdates.listener.ItemTooltipRngListener; import io.github.moulberry.notenoughupdates.listener.NEUEventListener; import io.github.moulberry.notenoughupdates.listener.OldAnimationChecker; import io.github.moulberry.notenoughupdates.listener.RenderListener; +import io.github.moulberry.notenoughupdates.listener.WorldListener; import io.github.moulberry.notenoughupdates.miscfeatures.AbiphoneWarning; import io.github.moulberry.notenoughupdates.miscfeatures.AntiCoopAdd; import io.github.moulberry.notenoughupdates.miscfeatures.AuctionBINWarning; @@ -270,6 +271,10 @@ public class NotEnoughUpdates { saveConfig(); } + if (config != null) + if (config.mining.powderGrindingTrackerResetMode == 2) + OverlayManager.powderGrindingOverlay.load(); + MinecraftForge.EVENT_BUS.register(this); MinecraftForge.EVENT_BUS.register(new NEUEventListener(this)); MinecraftForge.EVENT_BUS.register(new RecipeGenerator(this)); @@ -314,6 +319,7 @@ public class NotEnoughUpdates { MinecraftForge.EVENT_BUS.register(new BetterContainers()); MinecraftForge.EVENT_BUS.register(AuctionBINWarning.getInstance()); MinecraftForge.EVENT_BUS.register(navigation); + MinecraftForge.EVENT_BUS.register(new WorldListener(this)); if (Minecraft.getMinecraft().getResourceManager() instanceof IReloadableResourceManager) { IReloadableResourceManager manager = (IReloadableResourceManager) Minecraft.getMinecraft().getResourceManager(); @@ -349,6 +355,11 @@ public class NotEnoughUpdates { } public void saveConfig() { + try { + OverlayManager.powderGrindingOverlay.save(); + } catch (Exception ignored) { + } + try { configFile.createNewFile(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java index 62937afc..f85c165a 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/ChatListener.java @@ -295,11 +295,18 @@ public class ChatListener { unformatted.startsWith(" ") || unformatted.startsWith("✦") || unformatted.equals( " You've earned a Crystal Loot Bundle!")) OverlayManager.crystalHollowOverlay.message(unformatted); + Matcher LvlMatcher = SKYBLOCK_LVL_MESSAGE.matcher(unformatted); if (LvlMatcher.matches()) { - if (Integer.parseInt(LvlMatcher.group(1)) < NotEnoughUpdates.INSTANCE.config.misc.filterChatLevel && NotEnoughUpdates.INSTANCE.config.misc.filterChatLevel != 0) { + if (Integer.parseInt(LvlMatcher.group(1)) < NotEnoughUpdates.INSTANCE.config.misc.filterChatLevel && + NotEnoughUpdates.INSTANCE.config.misc.filterChatLevel != 0) { e.setCanceled(true); } } + + if (unformatted.equals("You uncovered a treasure chest!") || + unformatted.equals("You have successfully picked the lock on this chest!") + || (unformatted.startsWith("You received +") && unformatted.endsWith(" Powder"))) + OverlayManager.powderGrindingOverlay.message(unformatted); } } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/WorldListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/WorldListener.java new file mode 100644 index 00000000..365b96c5 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/WorldListener.java @@ -0,0 +1,41 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.listener; + +import io.github.moulberry.notenoughupdates.NotEnoughUpdates; +import io.github.moulberry.notenoughupdates.overlays.OverlayManager; +import net.minecraftforge.event.world.WorldEvent; +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; + +public class WorldListener { + + private final NotEnoughUpdates neu; + + public WorldListener(NotEnoughUpdates neu) { + this.neu = neu; + } + + @SubscribeEvent + public void onWorldLoad(WorldEvent.Load e) { + if (neu.config.mining.powderGrindingTrackerResetMode == 0) + OverlayManager.powderGrindingOverlay.reset(); + } + +} 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 a1561658..e18d1d84 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java @@ -197,6 +197,12 @@ public class NEUConfig extends Config { NotEnoughUpdates.INSTANCE.openGui = new GuiScreenElementWrapper(new NEUConfigEditor(NotEnoughUpdates.INSTANCE.config, "apis")); return; + case 25: + editOverlay(activeConfigCategory, OverlayManager.powderGrindingOverlay, mining.powderGrindingTrackerPosition); + return; + case 26: + OverlayManager.powderGrindingOverlay.reset(); + return; default: System.err.printf("Unknown runnableId = %d in category %s%n", runnableId, activeConfigCategory); } @@ -578,6 +584,18 @@ public class NEUConfig extends Config { public HashMap savedEquipment = new HashMap<>(); @Expose public int magicalPower = 0; + + @Expose + public int chestCount = 0; + + @Expose + public int openedChestCount = 0; + + @Expose + public int mithrilPowderFound = 0; + + @Expose + public int gemstonePowderFound = 0; } public HiddenLocationSpecific getLocationSpecific() { 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 48214481..10e554c9 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 @@ -205,4 +205,16 @@ public class LocationEdit { ) @ConfigAccordionId(id = 3) public Position combatPosition = new Position(10, 200); + + @Expose + @ConfigOption( + name = "Edit Tracker Position", + desc = "Change the position of the Powder Grinding Tracker Overlay (chests and gained powder)" + ) + @ConfigEditorButton( + runnableId = 25, + buttonText = "Edit" + ) + @ConfigAccordionId(id = 9) + public Position powderGrindingTrackerPosition = new Position(10, 265); } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java index 727ad329..2568653d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java @@ -156,7 +156,7 @@ public class Mining { @Expose @ConfigOption( name = "Edit Dwarven Overlay Position", - desc = "Change the position of the Dwarven Mines information Overlay (commisions, powder & forge statuses)" + desc = "Change the position of the Dwarven Mines information Overlay (commissions, powder & forge statuses)" ) @ConfigEditorButton( runnableId = 1, @@ -713,6 +713,79 @@ public class Mining { ) public int wishingCompassWaypointNames = 0; + @ConfigOption( + name = "Powder Grinding Tracker", + desc = "" + ) + @ConfigEditorAccordion(id = 9) + public boolean powderGrindingTrackerAccordion = false; + + + @Expose + @ConfigOption( + name = "Enable Tracker", + desc = "Show an Overlay with useful information related to Power Grinding" + ) + @ConfigAccordionId(id = 9) + @ConfigEditorBoolean + public boolean powderGrindingTrackerEnabled = false; + + @Expose + @ConfigOption( + name = "Tracker Text", + desc = "\u00a7eDrag text to change the appearance of the Overlay\n" + + "\u00a7rGo to the Crystal Hollows to show this Overlay with useful information" + ) + @ConfigEditorDraggableList( + exampleText = { + "\u00a73Chests Found: \u00a7a13", + "\u00a73Opened Chests: \u00a7a11", + "\u00a73Unopened Chests: \u00a7c2", + "\u00a73Mithril Powder Found: \u00a726,243", + "\u00a73Average Mithril Powder/Chest: \u00a72568", + "\u00a73Gemstone Powder Found: \u00a7d6,243", + "\u00a73Average Gemstone Powder/Chest: \u00a7d568" + } + ) + @ConfigAccordionId(id = 9) + public List powderGrindingTrackerText = new ArrayList<>(Arrays.asList(0, 1, 2, 3, 4, 5, 6)); + + @Expose + @ConfigOption( + name = "Edit Tracker Position", + desc = "Change the position of the Powder Grinding Tracker Overlay (chests and gained powder)" + ) + @ConfigEditorButton( + runnableId = 25, + buttonText = "Edit" + ) + @ConfigAccordionId(id = 9) + public Position powderGrindingTrackerPosition = new Position(10, 265); + + @Expose + @ConfigOption( + name = "Tracker Reset Mode", + desc = "When the Powder Grinding Tracker should be reset" + ) + @ConfigEditorDropdown( + values = {"On World Change", "On Restart", "Never"}, + initialIndex = 2 + ) + @ConfigAccordionId(id = 9) + public int powderGrindingTrackerResetMode = 2; + + @Expose + @ConfigOption( + name = "Reset Tracker", + desc = "Reset all stats for Powder Grinding Tracker" + ) + @ConfigEditorButton( + runnableId = 26, + buttonText = "Reset" + ) + @ConfigAccordionId(id = 9) + public int resetPowderGrindingTracker = 0; + @Expose @ConfigOption( name = "Puzzler Solver", 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 84684558..5047882d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/OverlayManager.java @@ -30,6 +30,7 @@ public class OverlayManager { public static Class dontRenderOverlay = null; public static MiningOverlay miningOverlay; + public static PowderGrindingOverlay powderGrindingOverlay; public static FarmingSkillOverlay farmingOverlay; public static FishingSkillOverlay fishingSkillOverlay; public static MiningSkillOverlay miningSkillOverlay; @@ -98,6 +99,23 @@ public class OverlayManager { return TextOverlayStyle.BACKGROUND; }); + List powderGrindingDummy = Lists.newArrayList( + "\u00a73Chests Found: \u00a7a13", + "\u00a73Opened Chests: \u00a7a11", + "\u00a73Unopened Chests: \u00a7c2", + "\u00a73Mithril Powder Found: \u00a726,243", + "\u00a73Average Mithril Powder/Chest: \u00a72568", + "\u00a73Gemstone Powder Found: \u00a7d6,243", + "\u00a73Average Gemstone Powder/Chest: \u00a7d568" + ); + powderGrindingOverlay = new PowderGrindingOverlay(NotEnoughUpdates.INSTANCE.config.mining.powderGrindingTrackerPosition, () -> { + List strings = new ArrayList<>(); + for (int i : NotEnoughUpdates.INSTANCE.config.mining.powderGrindingTrackerText) { + if (i >= 0 && i < powderGrindingDummy.size()) strings.add(powderGrindingDummy.get(i)); + } + return strings; + }, () -> TextOverlayStyle.BACKGROUND); + List farmingDummy = Lists.newArrayList( "\u00a7bCounter: \u00a7e37,547,860", "\u00a7bCrops/m: \u00a7e38.29", @@ -296,6 +314,7 @@ public class OverlayManager { }); textOverlays.add(miningOverlay); + textOverlays.add(powderGrindingOverlay); textOverlays.add(farmingOverlay); textOverlays.add(miningSkillOverlay); textOverlays.add(combatSkillOverlay); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/overlays/PowderGrindingOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/overlays/PowderGrindingOverlay.java new file mode 100644 index 00000000..50ecce90 --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/overlays/PowderGrindingOverlay.java @@ -0,0 +1,188 @@ +/* + * Copyright (C) 2022 NotEnoughUpdates contributors + * + * This file is part of NotEnoughUpdates. + * + * NotEnoughUpdates is free software: you can redistribute it + * and/or modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation, either + * version 3 of the License, or (at your option) any later version. + * + * NotEnoughUpdates is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with NotEnoughUpdates. If not, see . + */ + +package io.github.moulberry.notenoughupdates.overlays; + +import com.google.gson.Gson; +import com.google.gson.JsonObject; +import com.google.gson.JsonParser; +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.options.NEUConfig; +import io.github.moulberry.notenoughupdates.util.SBInfo; + +import java.io.BufferedReader; +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.InputStreamReader; +import java.io.OutputStreamWriter; +import java.nio.charset.StandardCharsets; +import java.text.NumberFormat; +import java.util.ArrayList; +import java.util.List; +import java.util.function.Supplier; +import java.util.stream.Collectors; + +public class PowderGrindingOverlay extends TextTabOverlay { + + private final static JsonParser PARSER = new JsonParser(); + + + public int chestCount = 0; + public int openedChestCount = 0; + public int mithrilPowderFound = 0; + public float lastMithrilPowderFound = 0; + public float lastMithrilPowderAverage = 0; + public int gemstonePowderFound = 0; + public float lastGemstonePowderFound = 0; + public float lastGemstonePowderAverage = 0; + private long lastUpdate = -1; + + public PowderGrindingOverlay( + Position position, + Supplier> dummyStrings, + Supplier 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.mining.powderGrindingTrackerEnabled) { + lastUpdate = System.currentTimeMillis(); + lastMithrilPowderFound = this.mithrilPowderFound; + lastMithrilPowderAverage = this.openedChestCount > 0 ? + 1f * this.mithrilPowderFound / this.openedChestCount : + 0; + lastGemstonePowderFound = this.gemstonePowderFound; + lastGemstonePowderAverage = this.openedChestCount > 0 ? + 1f * this.gemstonePowderFound / this.openedChestCount : + 0; + } else overlayStrings = null; + } + + @Override + public void updateFrequent() { + overlayStrings = null; + if (!NotEnoughUpdates.INSTANCE.config.mining.powderGrindingTrackerEnabled) return; + + String location = SBInfo.getInstance().getLocation(); + if (location == null) return; + if (location.equals("crystal_hollows")) { + + overlayStrings = new ArrayList<>(); + for (int index : NotEnoughUpdates.INSTANCE.config.mining.powderGrindingTrackerText) { + NumberFormat format = NumberFormat.getIntegerInstance(); + switch (index) { + case 0: + overlayStrings.add("\u00a73Chests Found: \u00a7a" + format.format(this.chestCount)); + break; + case 1: + overlayStrings.add("\u00a73Opened Chests: \u00a7a" + format.format(this.openedChestCount)); + break; + case 2: + overlayStrings.add("\u00a73Unopened Chests: \u00a7c" + format.format(this.chestCount - this.openedChestCount)); + break; + case 3: + overlayStrings.add("\u00a73Mithril Powder Found: \u00a72" + + format.format(interp(this.mithrilPowderFound, lastMithrilPowderFound))); + break; + case 4: + overlayStrings.add("\u00a73Average Mithril Powder/Chest: \u00a72" + format.format(interp( + (this.openedChestCount > 0 ? + 1f * this.mithrilPowderFound / this.openedChestCount : + 0), lastMithrilPowderAverage))); + break; + case 5: + overlayStrings.add("\u00a73Gemstone Powder Found: \u00a7d" + + format.format(interp(this.gemstonePowderFound, lastGemstonePowderFound))); + break; + case 6: + overlayStrings.add("\u00a73Average Gemstone Powder/Chest: \u00a7d" + format.format(interp( + (this.openedChestCount > 0 ? + 1f * this.gemstonePowderFound / this.openedChestCount : + 0), lastGemstonePowderAverage))); + break; + } + } + } + + if (overlayStrings != null && overlayStrings.isEmpty()) overlayStrings = null; + } + + public void message(String message) { + if (message.equals("You uncovered a treasure chest!")) { + this.chestCount++; + } else if (message.equals("You have successfully picked the lock on this chest!")) { + this.openedChestCount++; + } else { + boolean mithril = message.endsWith(" Mithril Powder"); + boolean gemstone = message.endsWith(" Gemstone Powder"); + if (!(mithril || gemstone)) return; + try { + int amount = Integer.parseInt(message.split(" ")[2].replaceAll("\\+", "")); + if (mithril) this.mithrilPowderFound += amount; + else this.gemstonePowderFound += amount; + } catch (NumberFormatException | IndexOutOfBoundsException e) { + e.printStackTrace(); + } + } + } + + public void load() { + NEUConfig.HiddenProfileSpecific profileSpecific = NotEnoughUpdates.INSTANCE.config.getProfileSpecific(); + if (profileSpecific == null) return; + this.chestCount = profileSpecific.chestCount; + this.openedChestCount = profileSpecific.openedChestCount; + this.mithrilPowderFound = profileSpecific.mithrilPowderFound; + this.gemstonePowderFound = profileSpecific.gemstonePowderFound; + } + + public void save() { + NEUConfig.HiddenProfileSpecific profileSpecific = NotEnoughUpdates.INSTANCE.config.getProfileSpecific(); + if (profileSpecific == null) return; + profileSpecific.chestCount = this.chestCount; + profileSpecific.openedChestCount = this.openedChestCount; + profileSpecific.mithrilPowderFound = this.mithrilPowderFound; + profileSpecific.gemstonePowderFound = this.gemstonePowderFound; + } + + public void reset() { + this.chestCount = 0; + this.openedChestCount = 0; + this.mithrilPowderFound = 0; + this.gemstonePowderFound = 0; + } + +} 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 d78a6988..095dde87 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java @@ -24,6 +24,7 @@ import com.google.gson.JsonObject; import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.listener.ScoreboardLocationChangeListener; import io.github.moulberry.notenoughupdates.miscfeatures.customblockzones.LocationChangeEvent; +import io.github.moulberry.notenoughupdates.overlays.OverlayManager; import io.github.moulberry.notenoughupdates.overlays.SlayerOverlay; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.inventory.GuiChest; @@ -302,15 +303,21 @@ public class SBInfo { lastLocRaw = System.currentTimeMillis(); NotEnoughUpdates.INSTANCE.sendChatMessage("/locraw"); } - if (currentTime - lastMayorUpdate > 300 * 1000) { - updateMayor(); - lastMayorUpdate = currentTime; - } + if (currentTime - lastMayorUpdate > 300 * 1000) { + updateMayor(); + lastMayorUpdate = currentTime; + } try { for (NetworkPlayerInfo info : Minecraft.getMinecraft().thePlayer.sendQueue.getPlayerInfoMap()) { String name = Minecraft.getMinecraft().ingameGUI.getTabList().getPlayerName(info); if (name.startsWith(profilePrefix)) { - currentProfile = Utils.cleanColour(name.substring(profilePrefix.length())); + String newProfile = Utils.cleanColour(name.substring(profilePrefix.length())); + if (!Objects.equals(currentProfile, newProfile)) { + currentProfile = newProfile; + if (NotEnoughUpdates.INSTANCE.config != null) + if (NotEnoughUpdates.INSTANCE.config.mining.powderGrindingTrackerResetMode == 2) + OverlayManager.powderGrindingOverlay.load(); + } hasNewTab = true; } else if (name.startsWith(skillsPrefix)) { String levelInfo = name.substring(skillsPrefix.length()).trim(); -- cgit From 6c209c2ca6b4cb858cec2854d665bfa1a44f8728 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:41:44 +0000 Subject: Fix fish related crash (#387) --- .../profileviewer/trophy/TrophyFishPage.java | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java index 7fc9bd0d..1db53267 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/profileviewer/trophy/TrophyFishPage.java @@ -26,14 +26,6 @@ import io.github.moulberry.notenoughupdates.NotEnoughUpdates; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewer; import io.github.moulberry.notenoughupdates.profileviewer.GuiProfileViewerPage; import io.github.moulberry.notenoughupdates.util.Utils; - -import java.text.NumberFormat; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Locale; -import java.util.Map; import net.minecraft.client.Minecraft; import net.minecraft.client.gui.ScaledResolution; import net.minecraft.client.renderer.GlStateManager; @@ -46,6 +38,7 @@ import org.apache.commons.lang3.text.WordUtils; import org.apache.commons.lang3.tuple.Pair; import org.lwjgl.opengl.GL11; +import java.text.NumberFormat; import java.util.ArrayList; import java.util.HashMap; import java.util.LinkedHashMap; @@ -366,8 +359,11 @@ public class TrophyFishPage extends GuiProfileViewerPage { tooltip.add(display(trophyFishRarityIntegerMap, TrophyFish.TrophyFishRarity.GOLD, EnumChatFormatting.GOLD)); tooltip.add(display(trophyFishRarityIntegerMap, TrophyFish.TrophyFishRarity.SILVER, EnumChatFormatting.GRAY)); tooltip.add(display(trophyFishRarityIntegerMap, TrophyFish.TrophyFishRarity.BRONZE, EnumChatFormatting.DARK_GRAY)); - tooltip.add(" "); - tooltip.add(EnumChatFormatting.GRAY + "Total: " + EnumChatFormatting.GOLD + NUMBER_FORMAT.format(trophyFishList.get(name).getTotal())); + if (trophyFishList.get(name) != null) { + tooltip.add(" "); + tooltip.add(EnumChatFormatting.GRAY + "Total: " + EnumChatFormatting.GOLD + + NUMBER_FORMAT.format(trophyFishList.get(name).getTotal())); + } return tooltip; } -- cgit From 8848224dcba09d8ac321f7dd4c087eb3590cb285 Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 21 Oct 2022 14:45:54 +0000 Subject: Added the ability to add search tags to config options (#309) --- .../moulberry/notenoughupdates/NEUManager.java | 2 +- .../commands/misc/UpdateCommand.java | 2 - .../core/config/annotations/ConfigOption.java | 1 + .../core/config/struct/ConfigProcessor.java | 7 +- .../miscfeatures/DamageCommas.java | 1 - .../miscgui/InventoryStorageSelector.java | 82 ++++++++++++---------- .../notenoughupdates/options/NEUConfigEditor.java | 4 +- .../options/seperateSections/AHGraph.java | 9 ++- .../options/seperateSections/ApiData.java | 53 +++++++++++--- .../options/seperateSections/Calendar.java | 3 +- .../options/seperateSections/CustomArmour.java | 6 +- .../options/seperateSections/DungeonMapConfig.java | 6 +- .../options/seperateSections/Dungeons.java | 27 ++++--- .../options/seperateSections/Enchanting.java | 21 ++++-- .../options/seperateSections/Fishing.java | 25 ++++--- .../options/seperateSections/ItemOverlays.java | 15 ++-- .../options/seperateSections/Itemlist.java | 12 ++-- .../options/seperateSections/LocationEdit.java | 15 ---- .../options/seperateSections/Mining.java | 6 +- .../options/seperateSections/Misc.java | 6 +- .../options/seperateSections/MiscOverlays.java | 3 +- .../options/seperateSections/PetOverlay.java | 3 +- .../options/seperateSections/SkillOverlays.java | 5 +- .../options/seperateSections/StorageGUI.java | 9 ++- .../options/seperateSections/TooltipTweaks.java | 3 +- 25 files changed, 200 insertions(+), 126 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java index 710bdd6c..34d87c5b 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NEUManager.java @@ -34,9 +34,9 @@ import io.github.moulberry.notenoughupdates.recipes.CraftingOverlay; import io.github.moulberry.notenoughupdates.recipes.CraftingRecipe; import io.github.moulberry.notenoughupdates.recipes.Ingredient; import io.github.moulberry.notenoughupdates.recipes.NeuRecipe; +import io.github.moulberry.notenoughupdates.util.ApiUtil; import io.github.moulberry.notenoughupdates.util.Constants; import io.github.moulberry.notenoughupdates.util.HotmInformation; -import io.github.moulberry.notenoughupdates.util.ApiUtil; import io.github.moulberry.notenoughupdates.util.ItemResolutionQuery; import io.github.moulberry.notenoughupdates.util.ItemUtils; import io.github.moulberry.notenoughupdates.util.SBInfo; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/UpdateCommand.java b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/UpdateCommand.java index 81cf7e8f..1aeebda5 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/UpdateCommand.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/commands/misc/UpdateCommand.java @@ -25,8 +25,6 @@ import net.minecraft.command.CommandException; import net.minecraft.command.ICommandSender; import net.minecraft.util.ChatComponentText; -import java.net.MalformedURLException; -import java.net.URL; import java.util.Arrays; import java.util.List; import java.util.Objects; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigOption.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigOption.java index d51294e7..920cb326 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigOption.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigOption.java @@ -30,6 +30,7 @@ public @interface ConfigOption { String name(); String desc(); + String[] searchTags() default ""; int subcategoryId() default -1; } diff --git a/src/main/java/io/github/moulberry/notenoughupdates/core/config/struct/ConfigProcessor.java b/src/main/java/io/github/moulberry/notenoughupdates/core/config/struct/ConfigProcessor.java index 75862069..efdeab01 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/core/config/struct/ConfigProcessor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/core/config/struct/ConfigProcessor.java @@ -69,17 +69,19 @@ public class ConfigProcessor { public GuiOptionEditor editor; public int accordionId = -1; + public final String[] searchTags; private final Field field; private final Object container; - public ProcessedOption(String name, String desc, int subcategoryId, Field field, Object container) { + public ProcessedOption(String name, String desc, int subcategoryId, Field field, Object container, String[] searchTags) { this.name = name; this.desc = desc; this.subcategoryId = subcategoryId; this.field = field; this.container = container; + this.searchTags = searchTags; } public Object get() { @@ -137,7 +139,8 @@ public class ConfigProcessor { optionAnnotation.desc(), optionAnnotation.subcategoryId(), optionField, - categoryObj + categoryObj, + optionAnnotation.searchTags() ); if (optionField.isAnnotationPresent(ConfigAccordionId.class)) { ConfigAccordionId annotation = optionField.getAnnotation(ConfigAccordionId.class); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java index 04d97747..d8f7becd 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/DamageCommas.java @@ -27,7 +27,6 @@ import net.minecraft.util.ChatComponentText; import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.IChatComponent; -import java.text.NumberFormat; import java.util.WeakHashMap; import java.util.regex.Matcher; import java.util.regex.Pattern; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java index 0abf3f11..572b0fbf 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/InventoryStorageSelector.java @@ -83,24 +83,26 @@ public class InventoryStorageSelector { return; } - if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowLeftKey)) { - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex--; - - int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; - } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowRightKey)) { - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex++; - - int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; - } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowDownKey)) { - sendToPage(NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex); + if (NotEnoughUpdates.INSTANCE.config.storageGUI.arrowKeyBackpacks) { + if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowLeftKey)) { + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex--; + + int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; + } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowRightKey)) { + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex++; + + int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; + } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowDownKey)) { + sendToPage(NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex); + } } if (isSlotSelected()) { @@ -145,27 +147,29 @@ public class InventoryStorageSelector { return; } - if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.backpackHotkey)) { - Minecraft.getMinecraft().thePlayer.inventory.currentItem = 0; - isOverridingSlot = true; - } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowLeftKey)) { - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex--; - - int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; - } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowRightKey)) { - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex++; - - int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; - if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) - NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; - } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowDownKey)) { - sendToPage(NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex); + if (NotEnoughUpdates.INSTANCE.config.storageGUI.arrowKeyBackpacks) { + if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.backpackHotkey)) { + Minecraft.getMinecraft().thePlayer.inventory.currentItem = 0; + isOverridingSlot = true; + } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowLeftKey)) { + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex--; + + int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; + } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowRightKey)) { + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex++; + + int max = StorageManager.getInstance().storageConfig.displayToStorageIdMap.size() - 1; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex > max) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = max; + if (NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex < 0) + NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex = 0; + } else if (KeybindHelper.isKeyPressed(NotEnoughUpdates.INSTANCE.config.storageGUI.arrowDownKey)) { + sendToPage(NotEnoughUpdates.INSTANCE.config.storageGUI.selectedIndex); + } } if (isSlotSelected()) { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java index 17bc57e9..cee994b7 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java @@ -46,6 +46,7 @@ import org.lwjgl.opengl.GL11; import java.awt.*; import java.net.URI; +import java.util.Arrays; import java.util.HashMap; import java.util.HashSet; import java.util.LinkedHashMap; @@ -110,7 +111,8 @@ public class NEUConfigEditor extends GuiElement { for (ConfigProcessor.ProcessedOption option : category.options.values()) { categoryForOption.put(option, category); - String combined = category.name + " " + category.desc + " " + option.name + " " + option.desc; + String combined = category.name + " " + category.desc + " " + option.name + " " + option.desc + " " + + Arrays.toString(option.searchTags); combined = combined.replaceAll("[^a-zA-Z_ ]", "").toLowerCase(); for (String word : combined.split("[ _]")) { searchOptionMap.computeIfAbsent(word, k -> new HashSet<>()).add(option); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/AHGraph.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/AHGraph.java index ce931392..58c58e3c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/AHGraph.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/AHGraph.java @@ -32,7 +32,8 @@ public class AHGraph { @Expose @ConfigOption( name = "Enable AH/BZ Price Graph", - desc = "Enable or disable the graph. Disabling this will also make it so that no price data is stored." + desc = "Enable or disable the graph. Disabling this will also make it so that no price data is stored.", + searchTags = {"auction", "bazaar"} ) @ConfigEditorBoolean public boolean graphEnabled = true; @@ -58,7 +59,8 @@ public class AHGraph { @Expose @ConfigOption( name = "Graph Colour", - desc = "Set a custom colour for the graph." + desc = "Set a custom colour for the graph.", + searchTags = "color" ) @ConfigEditorColour public String graphColor = "0:255:0:255:0"; @@ -66,7 +68,8 @@ public class AHGraph { @Expose @ConfigOption( name = "Secondary Graph Colour", - desc = "Set a custom colour for the second graph line." + desc = "Set a custom colour for the second graph line.", + searchTags = "color" ) @ConfigEditorColour public String graphColor2 = "0:255:255:255:0"; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ApiData.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ApiData.java index e52b7d34..9802af89 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ApiData.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ApiData.java @@ -31,7 +31,8 @@ public class ApiData { @Expose @ConfigOption( name = "Api Key", - desc = "Hypixel API key\nYou can run §a/api new§r to autofill this value." + desc = "Hypixel API key\nYou can run §a/api new§r to autofill this value.", + searchTags = "apikey" ) @ConfigEditorText public String apiKey = ""; @@ -41,57 +42,87 @@ public class ApiData { public boolean repository = false; @Expose - @ConfigOption(name = "Automatically Update Repository", desc = "Update the repository on every startup") + @ConfigOption( + name = "Automatically Update Repository", + desc = "Update the repository on every startup" + ) @ConfigEditorBoolean() @ConfigAccordionId(id = 0) public boolean autoupdate = true; @ConfigAccordionId(id = 0) - @ConfigOption(name = "Update Repository now", desc = "Refresh your repository") + @ConfigOption( + name = "Update Repository now", + desc = "Refresh your repository" + ) @ConfigEditorButton(runnableId = 22, buttonText = "Update") public int updateRepositoryButton = 0; @ConfigEditorAccordion(id = 1) @ConfigAccordionId(id = 0) - @ConfigOption(name = "Repository Location", desc = "") + @ConfigOption( + name = "Repository Location", + desc = "" + ) public boolean repositoryLocation = false; @ConfigAccordionId(id = 1) - @ConfigOption(name = "Use default repository", desc = "The latest, most up to date item list for the official NEU releases.") + @ConfigOption( + name = "Use default repository", + desc = "The latest, most up to date item list for the official NEU releases." + ) @ConfigEditorButton(runnableId = 23, buttonText = "Reset") public int setRepositoryToDefaultButton = 0; @ConfigAccordionId(id = 1) - @ConfigOption(name = "Use pre-release repository", desc = "The latest, most up to date item list for the NEU pre-releases.\n§4Use §lonly§r§4 with the pre-releases.") + @ConfigOption( + name = "Use pre-release repository", + desc = "The latest, most up to date item list for the NEU pre-releases.\n§4Use §lonly§r§4 with the pre-releases." + ) @ConfigEditorButton(runnableId = 24, buttonText = "Use") public int setRepositoryToDangerousButton = 0; @Expose @ConfigAccordionId(id = 1) - @ConfigOption(name = "Repository User", desc = "Repository User") + @ConfigOption( + name = "Repository User", + desc = "Repository User" + ) @ConfigEditorText public String repoUser = "NotEnoughUpdates"; @Expose @ConfigAccordionId(id = 1) - @ConfigOption(name = "Repository Name", desc = "Repository Name") + @ConfigOption( + name = "Repository Name", + desc = "Repository Name" + ) @ConfigEditorText public String repoName = "NotEnoughUpdates-REPO"; @Expose @ConfigAccordionId(id = 1) - @ConfigOption(name = "Repository Branch", desc = "Repository Branch") + @ConfigOption( + name = "Repository Branch", + desc = "Repository Branch" + ) @ConfigEditorText public String repoBranch = "master"; @Expose @ConfigAccordionId(id = 0) - @ConfigOption(name = "Edit Mode", desc = "Enables you to edit items in the item list.\n§4Recommended for repository maintainers only.\n§4§lRemember: §rTurn off auto update as well") + @ConfigOption( + name = "Edit Mode", + desc = "Enables you to edit items in the item list.\n§4Recommended for repository maintainers only.\n§4§lRemember: §rTurn off auto update as well" + ) @ConfigEditorBoolean public boolean repositoryEditing = false; @Expose - @ConfigOption(name = "Lowestbin API", desc = "§4Do §lNOT §r§4change this, unless you know exactly what you are doing\n§fDefault: §amoulberry.codes") + @ConfigOption( + name = "Lowestbin API", + desc = "§4Do §lNOT §r§4change this, unless you know exactly what you are doing\n§fDefault: §amoulberry.codes" + ) @ConfigEditorText public String moulberryCodesApi = "moulberry.codes"; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Calendar.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Calendar.java index f1debe28..8aef92d8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Calendar.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Calendar.java @@ -28,7 +28,8 @@ public class Calendar { @Expose @ConfigOption( name = "Event Notifications", - desc = "Display notifications for SkyBlock calendar events" + desc = "Display notifications for SkyBlock calendar events", + searchTags = {"jacob", "dark", "farming"} ) @ConfigEditorBoolean public boolean eventNotifications = true; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/CustomArmour.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/CustomArmour.java index 92b4b2ab..0d33172d 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/CustomArmour.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/CustomArmour.java @@ -30,7 +30,8 @@ public class CustomArmour { @ConfigOption( name = "Enable Equipment Hud", desc = "Shows an overlay in your inventory showing your 4 extra armour slots\n" + - "\u00A7cRequires Hide Potion Effects to be enabled" + "\u00A7cRequires Hide Potion Effects to be enabled", + searchTags = "armor" ) @ConfigEditorBoolean public boolean enableArmourHud = true; @@ -46,7 +47,8 @@ public class CustomArmour { @Expose @ConfigOption( name = "GUI Style", - desc = "Change the colour of the GUI" + desc = "Change the colour of the GUI", + searchTags = "color" ) @ConfigEditorDropdown( values = {"Minecraft", "Grey", "PacksHQ Dark", "Transparent", "FSR"} diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java index 8e211bd6..eb7bdca1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/DungeonMapConfig.java @@ -127,14 +127,16 @@ public class DungeonMapConfig { @Expose @ConfigOption( name = "Background Colour", - desc = "Colour of the map background. Supports opacity & chroma" + desc = "Colour of the map background. Supports opacity & chroma", + searchTags = "color" ) public String dmBackgroundColour = "00:170:75:75:75"; @Expose @ConfigOption( name = "Border Colour", - desc = "Colour of the map border. Supports opacity & chroma. Turn off custom borders to see" + desc = "Colour of the map border. Supports opacity & chroma. Turn off custom borders to see", + searchTags = "color" ) public String dmBorderColour = "00:0:0:0:0"; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java index 3d84cebe..cf5635ec 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Dungeons.java @@ -183,7 +183,8 @@ public class Dungeons { @Expose @ConfigOption( name = "Enable Block Overlay", - desc = "Change the colour of certain blocks / entities while inside dungeons, but keeps the normal texture outside of dungeons" + desc = "Change the colour of certain blocks / entities while inside dungeons, but keeps the normal texture outside of dungeons", + searchTags = "color" ) @ConfigEditorBoolean @ConfigAccordionId(id = 2) @@ -203,7 +204,8 @@ public class Dungeons { name = "Slow Update", desc = "Updates the colour every second instead of every tick.\n" + "\u00A7cWARNING: This will cause all texture animations (eg. flowing water) to update slowly.\n" + - "This should only be used on low-end machines" + "This should only be used on low-end machines", + searchTags = "color" ) @ConfigEditorBoolean @ConfigAccordionId(id = 2) @@ -212,7 +214,8 @@ public class Dungeons { @Expose @ConfigOption( name = "Cracked Bricks", - desc = "Change the colour of: Cracked Bricks" + desc = "Change the colour of: Cracked Bricks", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 2) @@ -221,7 +224,8 @@ public class Dungeons { @Expose @ConfigOption( name = "Dispensers", - desc = "Change the colour of: Dispensers" + desc = "Change the colour of: Dispensers", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 2) @@ -230,7 +234,8 @@ public class Dungeons { @Expose @ConfigOption( name = "Levers", - desc = "Change the colour of: Levers" + desc = "Change the colour of: Levers", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 2) @@ -239,7 +244,8 @@ public class Dungeons { @Expose @ConfigOption( name = "Tripwire String", - desc = "Change the colour of: Tripwire String" + desc = "Change the colour of: Tripwire String", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 2) @@ -248,7 +254,8 @@ public class Dungeons { @Expose @ConfigOption( name = "Normal Chests", - desc = "Change the colour of: Normal Chests" + desc = "Change the colour of: Normal Chests", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 2) @@ -257,7 +264,8 @@ public class Dungeons { @Expose @ConfigOption( name = "Trapped Chests", - desc = "Change the colour of: Trapped Chests" + desc = "Change the colour of: Trapped Chests", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 2) @@ -266,7 +274,8 @@ public class Dungeons { @Expose @ConfigOption( name = "Bats", - desc = "Change the colour of: Bats" + desc = "Change the colour of: Bats", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 2) 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 b596d180..c2ac4bb4 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 @@ -29,7 +29,8 @@ import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigOption public class Enchanting { @ConfigOption( name = "Enchant Table / Hex GUI", - desc = "" + desc = "", + searchTags = "et" ) @ConfigEditorAccordion(id = 1) public boolean tableGUIAccordion = false; @@ -159,7 +160,8 @@ public class Enchanting { @Expose @ConfigOption( name = "Ultrasequencer Next", - desc = "Set the colour of the glass pane shown behind the element in the ultrasequencer which is next" + desc = "Set the colour of the glass pane shown behind the element in the ultrasequencer which is next", + searchTags = "color" ) @ConfigEditorDropdown( values = { @@ -173,7 +175,8 @@ public class Enchanting { @Expose @ConfigOption( name = "Ultrasequencer Upcoming", - desc = "Set the colour of the glass pane shown behind the element in the ultrasequencer which is coming after \"next\"" + desc = "Set the colour of the glass pane shown behind the element in the ultrasequencer which is coming after \"next\"", + searchTags = "color" ) @ConfigEditorDropdown( values = { @@ -187,7 +190,8 @@ public class Enchanting { @Expose @ConfigOption( name = "Superpairs Matched", - desc = "Set the colour of the glass pane shown behind successfully matched pairs" + desc = "Set the colour of the glass pane shown behind successfully matched pairs", + searchTags = "color" ) @ConfigEditorDropdown( values = { @@ -201,7 +205,8 @@ public class Enchanting { @Expose @ConfigOption( name = "Superpairs Possible", - desc = "Set the colour of the glass pane shown behind pairs which can be matched, but have not yet" + desc = "Set the colour of the glass pane shown behind pairs which can be matched, but have not yet", + searchTags = "color" ) @ConfigEditorDropdown( values = { @@ -215,7 +220,8 @@ public class Enchanting { @Expose @ConfigOption( name = "Superpairs Unmatched", - desc = "Set the colour of the glass pane shown behind pairs which have been previously uncovered" + desc = "Set the colour of the glass pane shown behind pairs which have been previously uncovered", + searchTags = "color" ) @ConfigEditorDropdown( values = { @@ -229,7 +235,8 @@ public class Enchanting { @Expose @ConfigOption( name = "Superpairs Powerups", - desc = "Set the colour of the glass pane shown behind powerups" + desc = "Set the colour of the glass pane shown behind powerups", + searchTags = "color" ) @ConfigEditorDropdown( values = { diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Fishing.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Fishing.java index b6075794..10a4de0e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Fishing.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Fishing.java @@ -144,7 +144,8 @@ public class Fishing { name = "Particle Type", desc = "Change the type of the particle that is spawned\n" + "Particle types with (RGB) support custom colours\n" + - "Set to 'NONE' to disable particles" + "Set to 'NONE' to disable particles", + searchTags = "color" ) @ConfigEditorDropdown( values = {"Default", "None", "Spark (RGB)", "Swirl (RGB)", "Dust (RGB)", "Flame", "Crit", "Magic Crit"} @@ -156,7 +157,8 @@ public class Fishing { @ConfigOption( name = "Custom Colour", desc = "Set a custom colour for the particle\n" + - "Only works for particle types with (RGB)" + "Only works for particle types with (RGB)", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 1) @@ -175,7 +177,8 @@ public class Fishing { name = "Particle Type", desc = "Change the type of the particle that is spawned\n" + "Particle types with (RGB) support custom colours\n" + - "Set to 'NONE' to disable particles" + "Set to 'NONE' to disable particles", + searchTags = "color" ) @ConfigEditorDropdown( values = {"Default", "None", "Spark (RGB)", "Swirl (RGB)", "Dust (RGB)", "Flame", "Crit", "Magic Crit"} @@ -187,7 +190,8 @@ public class Fishing { @ConfigOption( name = "Custom Colour", desc = "Set a custom colour for the particle\n" + - "Only works for particle types with (RGB)" + "Only works for particle types with (RGB)", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 2) @@ -195,7 +199,8 @@ public class Fishing { @ConfigOption( name = "Rod Line Colours", - desc = "" + desc = "", + searchTags = "color" ) @ConfigEditorAccordion(id = 4) public boolean rodAccordion = false; @@ -248,8 +253,9 @@ public class Fishing { @Expose @ConfigOption( - name = "Fishing timer color", - desc = "Color of the fishing timer" + name = "Fishing timer colour", + desc = "Colour of the fishing timer", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 6) @@ -257,8 +263,9 @@ public class Fishing { @Expose @ConfigOption( - name = "Fishing timer color (30s)", - desc = "Color of the fishing timer after 30 seconds or more have passed" + name = "Fishing timer colour (30s)", + desc = "Colour of the fishing timer after 30 seconds or more have passed", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 6) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java index 5fde76a5..3222ce46 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/ItemOverlays.java @@ -38,7 +38,8 @@ import java.util.List; public class ItemOverlays { @ConfigOption( name = "Treecapitator Overlay", - desc = "" + desc = "", + searchTags = "jungle" ) @ConfigEditorAccordion(id = 0) public boolean treecapAccordion = false; @@ -64,7 +65,8 @@ public class ItemOverlays { @Expose @ConfigOption( name = "Overlay Colour", - desc = "Change the colour of the overlay" + desc = "Change the colour of the overlay", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 0) @@ -107,7 +109,8 @@ public class ItemOverlays { @Expose @ConfigOption( name = "Overlay Colour", - desc = "Change the colour of the ghost block outline" + desc = "Change the colour of the ghost block outline", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 1) @@ -132,7 +135,8 @@ public class ItemOverlays { @Expose @ConfigOption( name = "Overlay Colour", - desc = "Change the colour of the ghost block outline" + desc = "Change the colour of the ghost block outline", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 6) @@ -244,7 +248,8 @@ public class ItemOverlays { @Expose @ConfigOption( name = "Highlight Colour", - desc = "Change the colour of the etherwarp target block outline" + desc = "Change the colour of the etherwarp target block outline", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 7) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Itemlist.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Itemlist.java index 72a45930..17ac7acd 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Itemlist.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Itemlist.java @@ -119,7 +119,8 @@ public class Itemlist { @Expose @ConfigOption( name = "Foreground Colour", - desc = "Change the colour of foreground elements in the Itemlist" + desc = "Change the colour of foreground elements in the Itemlist", + searchTags = "color" ) @ConfigEditorColour public String foregroundColour = "00:255:100:100:100"; @@ -127,7 +128,8 @@ public class Itemlist { @Expose @ConfigOption( name = "Favourite Colour", - desc = "Change the colour of favourited elements in the Itemlist" + desc = "Change the colour of favourited elements in the Itemlist", + searchTags = "color" ) @ConfigEditorColour public String favouriteColour = "00:255:200:150:50"; @@ -135,7 +137,8 @@ public class Itemlist { @Expose @ConfigOption( name = "Pane Background Colour", - desc = "Change the colour of the Itemlist background" + desc = "Change the colour of the Itemlist background", + searchTags = "color" ) @ConfigEditorColour public String backgroundColour = "15:6:0:0:255"; @@ -143,7 +146,8 @@ public class Itemlist { @Expose @ConfigOption( name = "Always show Monsters", - desc = "Always show Monster Items in the item list" + desc = "Always show Monster Items in the item list", + searchTags = "mob" ) @ConfigEditorBoolean( runnableId = 21 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 10e554c9..5e393214 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 @@ -19,7 +19,6 @@ 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.ConfigAccordionId; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorAccordion; @@ -27,7 +26,6 @@ import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditor import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigOption; public class LocationEdit { - @Expose @ConfigOption( name = "Edit Dungeon Map", desc = "The NEU dungeon map has it's own editor (/neumap).\n" + @@ -39,7 +37,6 @@ public class LocationEdit { ) public int editDungeonMap = 0; - @Expose @ConfigOption( name = "Edit Pet Info Position", desc = "Change the position of the pet info overlay" @@ -50,7 +47,6 @@ public class LocationEdit { ) public Position petInfoPosition = new Position(-1, -1); - @Expose @ConfigOption( name = "Edit Todo Position", desc = "Change the position of the Todo overlay" @@ -61,7 +57,6 @@ public class LocationEdit { ) public Position todoPosition = new Position(100, 0); - @Expose @ConfigOption( name = "Edit Bonemerang Overlay Position", desc = "Change the position of the Bonemerang overlay" @@ -72,7 +67,6 @@ public class LocationEdit { ) public Position bonemerangPosition = new Position(-1, -1); - @Expose @ConfigOption( name = "Edit Slayer Overlay Position", desc = "Change the position of the Slayer overlay" @@ -90,7 +84,6 @@ public class LocationEdit { @ConfigEditorAccordion(id = 1) public boolean inventoryAccordion = false; - @Expose @ConfigOption( name = "Edit Toolbar Positions", desc = "Change the position of the QuickCommands / Search Bar" @@ -99,7 +92,6 @@ public class LocationEdit { @ConfigEditorButton(runnableId = 6, buttonText = "Edit") public boolean positionButton = true; - @Expose @ConfigOption( name = "Open Button Editor", desc = "Open button editor GUI (/neubuttons)" @@ -115,7 +107,6 @@ public class LocationEdit { @ConfigEditorAccordion(id = 2) public boolean miningoverlayAccordion = false; - @Expose @ConfigOption( name = "Edit Dwarven Overlay Position", desc = "Change the position of the Dwarven Mines information Overlay (commissions, powder & forge statuses)" @@ -127,7 +118,6 @@ public class LocationEdit { @ConfigAccordionId(id = 2) public Position overlayPosition = new Position(10, 100); - @Expose @ConfigOption( name = "Edit Crystal Overlay Position", desc = "Change the position of the Crystal Hollows Overlay" @@ -139,7 +129,6 @@ public class LocationEdit { @ConfigAccordionId(id = 2) public Position crystalHollowOverlayPosition = new Position(200, 0); - @Expose @ConfigOption( name = "Edit Fuel Bar Position", desc = "Change the position of the drill fuel bar" @@ -158,7 +147,6 @@ public class LocationEdit { @ConfigEditorAccordion(id = 3) public boolean skilloverlayAccordion = false; - @Expose @ConfigOption( name = "Edit Farming Overlay Position", desc = "Change the position of the Farming overlay" @@ -170,7 +158,6 @@ public class LocationEdit { @ConfigAccordionId(id = 3) public Position farmingPosition = new Position(10, 200); - @Expose @ConfigOption( name = "Edit Mining Overlay Position", desc = "Change the position of the Mining overlay" @@ -182,7 +169,6 @@ public class LocationEdit { @ConfigAccordionId(id = 3) public Position miningPosition = new Position(10, 200); - @Expose @ConfigOption( name = "Edit Fishing Overlay Position", desc = "Change the position of the Fishing overlay" @@ -194,7 +180,6 @@ public class LocationEdit { @ConfigAccordionId(id = 3) public Position fishingPosition = new Position(10, 200); - @Expose @ConfigOption( name = "Edit Combat Overlay Position", desc = "Change the position of the Combat overlay" diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java index 2568653d..7a6b07fd 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Mining.java @@ -388,7 +388,8 @@ public class Mining { @ConfigOption( name = "Colours", - desc = "" + desc = "", + searchTags = "color" ) @ConfigEditorAccordion(id = 6) @ConfigAccordionId(id = 4) @@ -426,7 +427,8 @@ public class Mining { @Expose @ConfigOption( name = "Done Color", - desc = "Change the colour when the part is given to the NPC." + desc = "Change the colour when the part is given to the NPC.", + searchTags = "color" ) @ConfigEditorDropdown( diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java index 568f852e..ededb5da 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/Misc.java @@ -145,7 +145,8 @@ public class Misc { @ConfigOption( name = "Edit Enchant Colours", - desc = "Change the colours of certain SkyBlock enchants (/neuec)" + desc = "Change the colours of certain SkyBlock enchants (/neuec)", + searchTags = "color" ) @ConfigEditorButton(runnableId = 8, buttonText = "Open") public boolean editEnchantColoursButton = true; @@ -153,7 +154,8 @@ public class Misc { @Expose @ConfigOption( name = "Chroma Text Speed", - desc = "Change the speed of chroma text for items names (/neucustomize) and enchant colours (/neuec) with the chroma colour code (&z)" + desc = "Change the speed of chroma text for items names (/neucustomize) and enchant colours (/neuec) with the chroma colour code (&z)", + searchTags = "color" ) @ConfigEditorSlider( minValue = 10, diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java index e3edfcd4..e73614d1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/MiscOverlays.java @@ -226,7 +226,8 @@ public class MiscOverlays { @ConfigOption( name = "Colours", - desc = "" + desc = "", + searchTags = "color" ) @ConfigEditorAccordion(id = 2) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/PetOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/PetOverlay.java index 353c4e08..6f0d5341 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/PetOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/PetOverlay.java @@ -108,7 +108,8 @@ public class PetOverlay { @Expose @ConfigOption( name = "GUI Style", - desc = "Change the colour of the GUI" + desc = "Change the colour of the GUI", + searchTags = "color" ) @ConfigEditorDropdown( values = {"Minecraft", "Grey", "PacksHQ Dark", "Transparent", "FSR"} 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 ca970a84..2925887f 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 @@ -92,7 +92,7 @@ public class SkillOverlays { @Expose @ConfigOption( name = "Use BZ Price For Coins/m", - desc = "Uses the bazzar price instead of NPC price for coins/m" + desc = "Uses the bazaar price instead of NPC price for coins/m" ) @ConfigEditorBoolean @ConfigAccordionId(id = 0) @@ -325,7 +325,8 @@ public class SkillOverlays { @Expose @ConfigOption( name = "Enable Combat Overlay", - desc = "Show an overlay while Combat with useful information" + desc = "Show an overlay while Combat with useful information", + searchTags = "champion" ) @ConfigEditorBoolean @ConfigAccordionId(id = 4) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java index e43fa5cf..08c48945 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/StorageGUI.java @@ -34,7 +34,8 @@ import org.lwjgl.input.Keyboard; public class StorageGUI { @ConfigOption( name = "Storage Overlay", - desc = "" + desc = "", + searchTags = {"ec", "enderchest", "st", "backpack"} ) @ConfigEditorAccordion(id = 1) public boolean storageOverlayAccordion = false; @@ -145,7 +146,8 @@ public class StorageGUI { @Expose @ConfigOption( name = "Selected Storage Colour", - desc = "Change the colour used to draw the selected backpack border" + desc = "Change the colour used to draw the selected backpack border", + searchTags = "color" ) @ConfigEditorColour @ConfigAccordionId(id = 1) @@ -163,7 +165,8 @@ public class StorageGUI { @ConfigOption( name = "Inventory Backpacks", - desc = "" + desc = "", + searchTags = "hotbar" ) @ConfigEditorAccordion(id = 0) public boolean inventorySlotAccordion = false; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java index 1edc0921..1697098e 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/TooltipTweaks.java @@ -156,7 +156,8 @@ public class TooltipTweaks { @Expose @ConfigOption( name = "Tooltip Border Colours", - desc = "Make the borders of tooltips match the rarity of the item (NEU Tooltips Only)" + desc = "Make the borders of tooltips match the rarity of the item (NEU Tooltips Only)", + searchTags = "color" ) @ConfigEditorBoolean public boolean tooltipBorderColours = true; -- cgit From 78f879c96dc2fee6a86a6803dddff9109d203e4b Mon Sep 17 00:00:00 2001 From: NopoTheGamer <40329022+NopoTheGamer@users.noreply.github.com> Date: Fri, 21 Oct 2022 15:22:12 +0000 Subject: expozed (#392) --- .../options/seperateSections/LocationEdit.java | 23 +++++++++++----------- 1 file changed, 11 insertions(+), 12 deletions(-) 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 5e393214..78b4cfd4 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 @@ -140,6 +140,17 @@ public class LocationEdit { @ConfigAccordionId(id = 2) public Position drillFuelBarPosition = new Position(0, -100, true, false); + @ConfigOption( + name = "Edit Tracker Position", + desc = "Change the position of the Powder Grinding Tracker Overlay (chests and gained powder)" + ) + @ConfigEditorButton( + runnableId = 25, + buttonText = "Edit" + ) + @ConfigAccordionId(id = 2) + public Position powderGrindingTrackerPosition = new Position(10, 265); + @ConfigOption( name = "Skill Overlays", desc = "" @@ -190,16 +201,4 @@ public class LocationEdit { ) @ConfigAccordionId(id = 3) public Position combatPosition = new Position(10, 200); - - @Expose - @ConfigOption( - name = "Edit Tracker Position", - desc = "Change the position of the Powder Grinding Tracker Overlay (chests and gained powder)" - ) - @ConfigEditorButton( - runnableId = 25, - buttonText = "Edit" - ) - @ConfigAccordionId(id = 9) - public Position powderGrindingTrackerPosition = new Position(10, 265); } -- cgit From 742cbb2aed8e45873fdb06366b437d277d019957 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal002@users.noreply.github.com> Date: Fri, 21 Oct 2022 17:51:13 +0200 Subject: Buttons tooltip delay (#302) Added a option to change the delay for rendering the tooltip of new buttons Co-authored-by: hannibal2 <24389977+hannibal00212@users.noreply.github.com> --- .../moulberry/notenoughupdates/listener/RenderListener.java | 2 +- .../options/seperateSections/InventoryButtons.java | 13 +++++++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java index a49b9e6d..2abb2ee8 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -703,7 +703,7 @@ public class RenderListener { buttonHovered = button; } - if (currentTime - buttonHoveredMillis > 600) { + if (currentTime - buttonHoveredMillis > NotEnoughUpdates.INSTANCE.config.inventoryButtons.tooltipDelay) { String command = button.command.trim(); if (!command.startsWith("/")) { command = "/" + command; diff --git a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/InventoryButtons.java b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/InventoryButtons.java index 685aeb98..36dd1a01 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/InventoryButtons.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/options/seperateSections/InventoryButtons.java @@ -23,6 +23,7 @@ import com.google.gson.annotations.Expose; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorBoolean; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorButton; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorDropdown; +import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigEditorSlider; import io.github.moulberry.notenoughupdates.core.config.annotations.ConfigOption; public class InventoryButtons { @@ -51,4 +52,16 @@ public class InventoryButtons { values = {"Mouse Down", "Mouse Up"} ) public int clickType = 0; + + @Expose + @ConfigOption( + name = "Tooltip Delay", + desc = "Change the Tooltip Delay in milliseconds" + ) + @ConfigEditorSlider( + minValue = 0, + maxValue = 1500, + minStep = 50 + ) + public int tooltipDelay = 600; } -- cgit From 3168a7560a4d8f1d29c8f2518d674c1f4c85ef8c Mon Sep 17 00:00:00 2001 From: Roman / Linnea Gräf Date: Fri, 21 Oct 2022 18:58:47 +0200 Subject: Fix calculator crash by using correct apis (#391) Right the wrongs --- .../moulberry/notenoughupdates/util/Calculator.java | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java b/src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java index b39a05f4..221b5023 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/util/Calculator.java @@ -101,6 +101,10 @@ public class Calculator { token.tokenLength = 1; token.type = TokenType.BINOP; token.operatorValue = c + ""; + if (c == '*' && i + 1 < source.length() && source.charAt(i + 1) == '*') { + token.tokenLength++; + token.operatorValue = "^"; + } } else if (postops.indexOf(c) != -1) { token.tokenLength = 1; token.type = TokenType.POSTOP; @@ -162,7 +166,6 @@ public class Calculator { Deque op = new ArrayDeque<>(); List out = new ArrayList<>(); - boolean nextMultiplyShouldBePower = false; for (Token currentlyShunting : toShunt) { switch (currentlyShunting.type) { @@ -170,17 +173,6 @@ public class Calculator { out.add(currentlyShunting); break; case BINOP: - Token next = toShunt.get(toShunt.indexOf(currentlyShunting) + 1); - if (currentlyShunting.operatorValue.equals("^")) { - if (next.numericValue > 999) { - throw new CalculatorException(next.numericValue + " is too large, pick a power less than 1000", next.tokenStart, next.tokenLength); - } - } else if (next != null && currentlyShunting.operatorValue.equals("*") && next.operatorValue != null && next.operatorValue.equals("*")) { - nextMultiplyShouldBePower = true; - continue; - } else if (nextMultiplyShouldBePower && currentlyShunting.operatorValue.equals("*")) { - currentlyShunting.operatorValue = "^"; - } int p = getPrecedence(currentlyShunting); while (!op.isEmpty()) { Token l = op.peek(); -- cgit From 2f57d3891a25630a41323c029bbe0b0a87d2fd33 Mon Sep 17 00:00:00 2001 From: GodOfPro <59516901+GodOfProDev@users.noreply.github.com> Date: Fri, 21 Oct 2022 21:01:59 +0330 Subject: Update CONTRIBUTING.md (#393) * Update CONTRIBUTING.md I changed it so it specifies that you need to have a fork of the repo to contribute. * Update CONTRIBUTING.md * Update CONTRIBUTING.md Specifying you should make a new branch for every feature and not do it in the master branch like me * Update CONTRIBUTING.md * Update CONTRIBUTING.md changed pr to pull request and comitted to committed * Update CONTRIBUTING.md grammer Co-authored-by: jani270 <69345714+jani270@users.noreply.github.com> Co-authored-by: jani270 <69345714+jani270@users.noreply.github.com> --- CONTRIBUTING.md | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f46b50c8..f4840270 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -20,7 +20,11 @@ Ever since Moulberry has stopped working on NEU, other contributors have been wo ### Software configuration -- Clone the NEU repository using `git clone https://github.com/NotEnoughUpdates/NotEnoughUpdates`. +- Fork the NEU repository using the fork button on top right of the page and name the repo NotEnoughUpdates. +- Clone the forked repository using `git clone https://github.com//NotEnoughUpdates`. +- Make sure to create new branches for features you are working on and not commit to the master branch of your repository. +- After you have committed all of the necessary changes make a pull request on that branch. +- Use the master branch as a way to pull the latest changes from the NEU repo. - Import that folder as a Gradle Project in your IDE (IntelliJ should autodetect it as gradle if you select the `NotEnoughUpdates` folder in the Open dialog) - Set your project SDK to your 1.8 JDK. This can be done in the modules settings (CTRL+ALT+SHIFT+S) in IntelliJ. - Set your gradle JVM to your 1.17 JDK. This can be done by searching for `gradle jvm` in the CTRL+SHIFT+A dialog in IntelliJ. -- cgit