From 6d2c47744663309c4297a93ff9311e9074251fa1 Mon Sep 17 00:00:00 2001 From: kr45732 <52721908+kr45732@users.noreply.github.com> Date: Fri, 5 Aug 2022 14:53:17 -0400 Subject: Add weight to pv (#201) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Finished senither weight * Fixed lily weight * move file and add senither weight * Impl weight * Remove unnecessary stuff * undo nw change * fix stuff * Update 2.1.md * why on earth would you do this 🙂 Co-authored-by: nopo --- Update Notes/2.1.md | 1 + 1 file changed, 1 insertion(+) (limited to 'Update Notes') diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index 57ad2bbb..269f87a7 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -34,6 +34,7 @@ - Added total xp to catacombs level - efefury - Fixed minion tiers crafted by coop members not showing up in /pv - Lulonaut - Fixed crash in /pv when the player had a pet that is not saved in the repo - Lulonaut + - Added senither and lily weight - CrypticPlasma ### **Minor Changes:** -- cgit From fe37f119bb381f3e8ad7cd8afb44739efcfc7e59 Mon Sep 17 00:00:00 2001 From: hannibal2 <24389977+hannibal00212@users.noreply.github.com> Date: Sun, 7 Aug 2022 16:50:30 +0200 Subject: added abiphone warning (#202) --- Update Notes/2.1.md | 1 + .../notenoughupdates/listener/RenderListener.java | 15 ++ .../miscfeatures/AbiphoneWarning.java | 215 +++++++++++++++++++++ .../notenoughupdates/mixins/MixinGuiContainer.java | 7 + .../options/seperateSections/Misc.java | 8 + 5 files changed, 246 insertions(+) create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java (limited to 'Update Notes') diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index 269f87a7..47c66c18 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -102,6 +102,7 @@ - Added [Auction Profit Viewer Overlay](https://cdn.discordapp.com/attachments/848901833119629332/993191851400101918/176946124-28ddf336-1ec7-460b-b22a-5fe2733b46a3.png) - efefury - Added Trophy Reward Overlay - hannibal2 - Added power stone feature - hannibal2 +- Added abiphone warning - hannibal2 ### **Bug Fixes:** 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 35a3581a..02c25333 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/listener/RenderListener.java @@ -34,6 +34,7 @@ import io.github.moulberry.notenoughupdates.commands.profile.ViewProfileCommand; import io.github.moulberry.notenoughupdates.core.GuiScreenElementWrapper; import io.github.moulberry.notenoughupdates.dungeons.DungeonWin; import io.github.moulberry.notenoughupdates.itemeditor.NEUItemEditor; +import io.github.moulberry.notenoughupdates.miscfeatures.AbiphoneWarning; import io.github.moulberry.notenoughupdates.miscfeatures.AuctionBINWarning; import io.github.moulberry.notenoughupdates.miscfeatures.AuctionProfit; import io.github.moulberry.notenoughupdates.miscfeatures.BetterContainers; @@ -681,6 +682,10 @@ public class RenderListener { if (AuctionBINWarning.getInstance().shouldShow()) { AuctionBINWarning.getInstance().render(); } + + if (AbiphoneWarning.getInstance().shouldShow()) { + AbiphoneWarning.getInstance().render(); + } } private void renderDungeonChestOverlay(GuiScreen gui) { @@ -922,6 +927,11 @@ public class RenderListener { event.setCanceled(true); return; } + if (AbiphoneWarning.getInstance().shouldShow()) { + AbiphoneWarning.getInstance().mouseInput(mouseX, mouseY); + event.setCanceled(true); + return; + } if (!event.isCanceled()) { Utils.scrollTooltip(Mouse.getEventDWheel()); @@ -1390,6 +1400,11 @@ public class RenderListener { event.setCanceled(true); return; } + if (AbiphoneWarning.getInstance().shouldShow()) { + AbiphoneWarning.getInstance().keyboardInput(); + event.setCanceled(true); + return; + } if (AuctionSearchOverlay.shouldReplace()) { AuctionSearchOverlay.keyEvent(); diff --git a/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java new file mode 100644 index 00000000..c806feeb --- /dev/null +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/AbiphoneWarning.java @@ -0,0 +1,215 @@ +/* + * 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.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.util.ItemUtils; +import io.github.moulberry.notenoughupdates.util.SBInfo; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.Gui; +import net.minecraft.client.gui.ScaledResolution; +import net.minecraft.client.gui.inventory.GuiChest; +import net.minecraft.client.renderer.GlStateManager; +import net.minecraft.inventory.Slot; +import net.minecraft.item.ItemStack; +import net.minecraft.util.EnumChatFormatting; +import org.lwjgl.input.Keyboard; +import org.lwjgl.input.Mouse; +import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; + +import java.util.List; + +public class AbiphoneWarning extends GuiElement { + private static final AbiphoneWarning INSTANCE = new AbiphoneWarning(); + + private boolean showWarning = false; + private String contactName = null; + private int contactSlot = -1; + + public static AbiphoneWarning getInstance() { + return INSTANCE; + } + + private boolean shouldPerformCheck() { + if (!NotEnoughUpdates.INSTANCE.hasSkyblockScoreboard()) { + showWarning = false; + return false; + } + + if (Minecraft.getMinecraft().currentScreen instanceof GuiChest && + SBInfo.getInstance().lastOpenContainerName.startsWith("Abiphone ")) { + return true; + } else { + showWarning = false; + return false; + } + } + + public boolean shouldShow() { + 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; + + GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; + + ItemStack clickedContact = chest.inventorySlots.getSlot(slotId).getStack(); + if (clickedContact == null) return false; + + List list = ItemUtils.getLore(clickedContact); + if (list.isEmpty()) return false; + + String last = list.get(list.size() - 1); + if (last.contains("Right-click to remove contact!")) { + showWarning = true; + contactName = clickedContact.getDisplayName(); + contactSlot = slotId; + return true; + } + + return false; + } + + public void overrideIsMouseOverSlot(Slot slot, int mouseX, int mouseY, CallbackInfoReturnable cir) { + if (shouldShow()) { + cir.setReturnValue(false); + } + } + + @Override + public void render() { + final ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + final int width = scaledResolution.getScaledWidth(); + final int height = scaledResolution.getScaledHeight(); + + GlStateManager.disableLighting(); + + GlStateManager.pushMatrix(); + GlStateManager.translate(0, 0, 500); + + Gui.drawRect(0, 0, width, height, 0x80000000); + + RenderUtils.drawFloatingRectDark(width / 2 - 90, height / 2 - 45, 180, 90); + + int neuLength = Minecraft.getMinecraft().fontRendererObj.getStringWidth("\u00a7lNEU"); + Minecraft.getMinecraft().fontRendererObj.drawString( + "\u00a7lNEU", + width / 2 + 90 - neuLength - 3, + height / 2 - 45 + 4, + 0xff000000 + ); + + TextRenderUtils.drawStringCenteredScaledMaxWidth("Are you SURE?", Minecraft.getMinecraft().fontRendererObj, + width / 2, height / 2 - 45 + 10, false, 170, 0xffff4040 + ); + + String sellLine = "\u00a77[ \u00a7r" + contactName + "\u00a77 ]"; + + TextRenderUtils.drawStringCenteredScaledMaxWidth(sellLine, Minecraft.getMinecraft().fontRendererObj, + width / 2, height / 2 - 45 + 25, false, 170, 0xffffffff + ); + + TextRenderUtils.drawStringCenteredScaledMaxWidth( + "Continue removing the contact?", + Minecraft.getMinecraft().fontRendererObj, + width / 2, + height / 2 - 45 + 50, + false, + 170, + 0xffa0a0a0 + ); + + RenderUtils.drawFloatingRectDark(width / 2 - 43, height / 2 + 23, 40, 16, false); + RenderUtils.drawFloatingRectDark(width / 2 + 3, height / 2 + 23, 40, 16, false); + + TextRenderUtils.drawStringCenteredScaledMaxWidth( + EnumChatFormatting.GREEN + "[Y]es", + Minecraft.getMinecraft().fontRendererObj, + width / 2 - 23, + height / 2 + 31, + true, + 36, + 0xff00ff00 + ); + TextRenderUtils.drawStringCenteredScaledMaxWidth( + EnumChatFormatting.RED + "[N]o", + Minecraft.getMinecraft().fontRendererObj, + width / 2 + 23, + height / 2 + 31, + true, + 36, + 0xffff0000 + ); + + GlStateManager.popMatrix(); + } + + @Override + public boolean mouseInput(int mouseX, int mouseY) { + final ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); + final int width = scaledResolution.getScaledWidth(); + final int height = scaledResolution.getScaledHeight(); + + if (Mouse.getEventButtonState()) { + if (mouseY >= height / 2 + 23 && mouseY <= height / 2 + 23 + 16) { + if (mouseX >= width / 2 - 43 && mouseX <= width / 2 - 3) { + makeClick(); + } + showWarning = false; + } + + if (mouseX < width / 2 - 90 || mouseX > width / 2 + 90 || + mouseY < height / 2 - 45 || mouseY > height / 2 + 45) { + showWarning = false; + } + } + + return false; + } + + @Override + public boolean keyboardInput() { + if (!Keyboard.getEventKeyState()) { + if (Keyboard.getEventKey() == Keyboard.KEY_Y || Keyboard.getEventKey() == Keyboard.KEY_RETURN) { + makeClick(); + } + showWarning = false; + } + + return false; + } + + private void makeClick() { + if (contactSlot != -1) { + GuiChest chest = (GuiChest) Minecraft.getMinecraft().currentScreen; + Minecraft.getMinecraft().playerController.windowClick(chest.inventorySlots.windowId, + contactSlot, 1, 0, Minecraft.getMinecraft().thePlayer + ); + contactSlot = -1; + } + } +} 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 e3741ac7..3bc92a9c 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinGuiContainer.java @@ -22,6 +22,7 @@ package io.github.moulberry.notenoughupdates.mixins; 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.AuctionBINWarning; import io.github.moulberry.notenoughupdates.miscfeatures.AuctionSortModeWarning; import io.github.moulberry.notenoughupdates.miscfeatures.BetterContainers; @@ -189,6 +190,7 @@ public abstract class MixinGuiContainer extends GuiScreen { StorageOverlay.getInstance().overrideIsMouseOverSlot(slotIn, mouseX, mouseY, cir); GuiCustomEnchant.getInstance().overrideIsMouseOverSlot(slotIn, mouseX, mouseY, cir); AuctionBINWarning.getInstance().overrideIsMouseOverSlot(slotIn, mouseX, mouseY, cir); + AbiphoneWarning.getInstance().overrideIsMouseOverSlot(slotIn, mouseX, mouseY, cir); } @Redirect(method = "drawScreen", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/gui/inventory/GuiContainer;drawGradientRect(IIIIII)V")) @@ -305,6 +307,11 @@ public abstract class MixinGuiContainer extends GuiScreen { return; } + if (AbiphoneWarning.getInstance().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 b0e4c60b..c0033cde 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 @@ -223,4 +223,12 @@ public class Misc { @ConfigEditorDropdown(values = {"Off", "Enabled with ! Prefix", "Always enabled"}) public int calculationMode = 2; + @Expose + @ConfigOption( + name = "Enable Abiphone Warning", + desc = "Asks for confirmation when removing a contact in the abiphone" + ) + @ConfigEditorBoolean + public boolean abiphoneWarning = true; + } -- cgit From 197e463ad2909708e78e693ba1f9a820295cea5a Mon Sep 17 00:00:00 2001 From: jani270 <69345714+jani270@users.noreply.github.com> Date: Tue, 9 Aug 2022 23:48:06 +0200 Subject: prerelease changes (#215) --- README.md | 1 + Update Notes/2.1.md | 1 + .../notenoughupdates/NotEnoughUpdates.java | 6 ++--- .../dungeons/GuiDungeonMapEditor.java | 2 +- .../notenoughupdates/miscgui/CalendarOverlay.java | 26 +++++++++++----------- 5 files changed, 19 insertions(+), 17 deletions(-) (limited to 'Update Notes') diff --git a/README.md b/README.md index 1dc49f19..4249abc8 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,7 @@ NotEnoughUpdates (NEU) is a feature rich 1.8.9 Minecraft forge mod for Hypixel S ## Features - An [item list](https://github.com/NotEnoughUpdates/NotEnoughUpdates-REPO) containing information and recipes about every item in skyblock. +- A dungeons minimap. - Dungeon loot profit checker. - Item overlays for Treecapitator, Builder's Wand, Block Zapper, and Bonemerang. - An in-game skyblock profile viewer accessed with `/pv [player]`. diff --git a/Update Notes/2.1.md b/Update Notes/2.1.md index 47c66c18..f76d3e75 100644 --- a/Update Notes/2.1.md +++ b/Update Notes/2.1.md @@ -103,6 +103,7 @@ - Added Trophy Reward Overlay - hannibal2 - Added power stone feature - hannibal2 - Added abiphone warning - hannibal2 +- Added blur limit at 100 - nopo ### **Bug Fixes:** diff --git a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java index 9931f945..a1eb03d1 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/NotEnoughUpdates.java @@ -111,9 +111,9 @@ 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 = 20200; - public static final int PRE_VERSION_ID = 0; - public static final int HOTFIX_VERSION_ID = 1; + public static final int VERSION_ID = 20000; + public static final int PRE_VERSION_ID = 1; + public static final int HOTFIX_VERSION_ID = 0; /** * Registers the biomes for the crystal hollows here so optifine knows they exists */ diff --git a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java index 47e85023..8ce9d505 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/dungeons/GuiDungeonMapEditor.java @@ -284,7 +284,7 @@ public class GuiDungeonMapEditor extends GuiScreen { break; case 8: mapDesc = "Simple gray border"; - mapCredit = "TomEngMaster"; + mapCredit = "Lucy"; break; case 9: mapDesc = "Viney wood border"; 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 64396905..2905a941 100644 --- a/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java +++ b/src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java @@ -865,8 +865,8 @@ public class CalendarOverlay { SBEvent firstEvent = null; List nextFavourites = new ArrayList<>(); List nextFavouritesTime = new ArrayList<>(); - long timeUntilMajor = 0; - SBEvent nextMajorEvent = null; + long timeUntilMayor = 0; + SBEvent nextMayorEvent = null; List eventFavourites = NotEnoughUpdates.INSTANCE.config.hidden.eventFavourites; @@ -889,10 +889,10 @@ public class CalendarOverlay { } } - if (nextMajorEvent == null && !sbEvent.id.split(":")[0].equals("jacob_farming") && + if (nextMayorEvent == null && !sbEvent.id.split(":")[0].equals("jacob_farming") && !sbEvent.id.equals("dark_auction")) { - nextMajorEvent = sbEvent; - timeUntilMajor = timeUntilMillis; + nextMayorEvent = sbEvent; + timeUntilMayor = timeUntilMillis; } if (firstEvent == null) { @@ -919,7 +919,7 @@ public class CalendarOverlay { } } - if (nextFavourites.size() >= 3 && nextMajorEvent != null) { + if (nextFavourites.size() >= 3 && nextMayorEvent != null) { break out; } } @@ -1000,18 +1000,18 @@ public class CalendarOverlay { if (sbEvent.id.split(":")[0].equals("jacob_farming") && sbEvent.desc != null) { tooltipToDisplay.addAll(sbEvent.desc); } - if (nextMajorEvent != null || i < nextFavourites.size() - 1) { + if (nextMayorEvent != null || i < nextFavourites.size() - 1) { tooltipToDisplay.add(""); } } - if (nextMajorEvent != null) { - tooltipToDisplay.add(EnumChatFormatting.YELLOW.toString() + EnumChatFormatting.BOLD + "Next Major:"); - tooltipToDisplay.add(nextMajorEvent.display); + if (nextMayorEvent != null) { + tooltipToDisplay.add(EnumChatFormatting.YELLOW.toString() + EnumChatFormatting.BOLD + "Next Mayor:"); + tooltipToDisplay.add(nextMayorEvent.display); tooltipToDisplay.add(EnumChatFormatting.GRAY + "Starts in: " + EnumChatFormatting.YELLOW + - prettyTime(timeUntilMajor, false)); - if (nextMajorEvent.lastsFor >= 0) { + prettyTime(timeUntilMayor, false)); + if (nextMayorEvent.lastsFor >= 0) { tooltipToDisplay.add(EnumChatFormatting.GRAY + "Lasts for: " + EnumChatFormatting.YELLOW + - prettyTime(nextMajorEvent.lastsFor, true)); + prettyTime(nextMayorEvent.lastsFor, true)); } } -- cgit