From cfa0aa0c9a24aa739d3254b24ef4bf0bea7087a6 Mon Sep 17 00:00:00 2001 From: BuildTools Date: Thu, 7 Jan 2021 12:57:35 +0800 Subject: PRE4 --- .../notenoughupdates/AccessoryBagOverlay.java | 824 ----------- .../notenoughupdates/AllowEmptyHTMLTag.java | 74 - .../notenoughupdates/BetterContainers.java | 458 ------ .../moulberry/notenoughupdates/BetterPortals.java | 209 --- .../notenoughupdates/CalendarOverlay.java | 1472 -------------------- .../notenoughupdates/CustomItemEffects.java | 850 ----------- .../notenoughupdates/GuiEnchantColour.java | 257 ---- .../moulberry/notenoughupdates/GuiItemRecipe.java | 241 ---- .../moulberry/notenoughupdates/GuiTextures.java | 81 -- .../github/moulberry/notenoughupdates/HelpGUI.java | 189 --- .../notenoughupdates/ItemPriceInformation.java | 205 +++ .../moulberry/notenoughupdates/ItemRarityHalo.java | 251 ---- .../notenoughupdates/NEUEventListener.java | 623 ++++----- .../moulberry/notenoughupdates/NEUManager.java | 34 +- .../moulberry/notenoughupdates/NEUOverlay.java | 253 ++-- .../notenoughupdates/NEUOverlayPlacements.java | 221 --- .../notenoughupdates/NEUResourceManager.java | 38 - .../notenoughupdates/NotEnoughUpdates.java | 143 +- .../notenoughupdates/RequestFocusListener.java | 63 - .../moulberry/notenoughupdates/SBAIntegration.java | 217 --- .../moulberry/notenoughupdates/StreamerMode.java | 40 - .../github/moulberry/notenoughupdates/SunTzu.java | 94 -- .../moulberry/notenoughupdates/TradeWindow.java | 1042 -------------- .../notenoughupdates/auction/APIManager.java | 16 +- .../notenoughupdates/auction/CustomAH.java | 54 +- .../notenoughupdates/core/BackgroundBlur.java | 181 +++ .../notenoughupdates/core/ChromaColour.java | 95 ++ .../notenoughupdates/core/GlScissorStack.java | 87 ++ .../notenoughupdates/core/GuiElement.java | 8 + .../notenoughupdates/core/GuiElementBoolean.java | 118 ++ .../notenoughupdates/core/GuiElementColour.java | 368 +++++ .../notenoughupdates/core/GuiElementTextField.java | 519 +++++++ .../core/GuiScreenElementWrapper.java | 35 + .../notenoughupdates/core/config/Config.java | 4 + .../core/config/annotations/Category.java | 15 + .../config/annotations/ConfigEditorBoolean.java | 12 + .../config/annotations/ConfigEditorColour.java | 13 + .../config/annotations/ConfigEditorDropdown.java | 16 + .../config/annotations/ConfigEditorSlider.java | 18 + .../core/config/annotations/ConfigEditorText.java | 13 + .../core/config/annotations/ConfigOption.java | 17 + .../core/config/gui/GuiOptionEditor.java | 61 + .../core/config/gui/GuiOptionEditorBoolean.java | 38 + .../core/config/gui/GuiOptionEditorColour.java | 80 ++ .../core/config/gui/GuiOptionEditorDropdown.java | 142 ++ .../core/config/gui/GuiOptionEditorSlider.java | 132 ++ .../core/config/gui/GuiOptionEditorText.java | 84 ++ .../core/config/struct/ConfigProcessor.java | 157 +++ .../core/util/GuiElementSlider.java | 124 ++ .../notenoughupdates/core/util/MiscUtils.java | 104 ++ .../notenoughupdates/core/util/Splitters.java | 10 + .../notenoughupdates/core/util/StringUtils.java | 39 + .../notenoughupdates/core/util/lerp/LerpUtils.java | 22 + .../core/util/lerp/LerpingFloat.java | 68 + .../core/util/lerp/LerpingInteger.java | 68 + .../core/util/render/RenderUtils.java | 144 ++ .../core/util/render/TextRenderUtils.java | 215 +++ .../notenoughupdates/cosmetics/CapeManager.java | 78 +- .../notenoughupdates/cosmetics/NEUCape.java | 13 +- .../notenoughupdates/dungeons/DungeonBlocks.java | 29 +- .../notenoughupdates/dungeons/DungeonMap.java | 98 +- .../notenoughupdates/dungeons/DungeonWin.java | 10 +- .../dungeons/GuiDungeonMapEditor.java | 513 +++---- .../notenoughupdates/gamemodes/GuiGamemodes.java | 2 +- .../notenoughupdates/gamemodes/SBGamemodes.java | 2 +- .../infopanes/CollectionLogInfoPane.java | 19 +- .../infopanes/FlipperInfoPane.java | 2 +- .../notenoughupdates/infopanes/HTMLInfoPane.java | 2 +- .../infopanes/ScrollableInfoPane.java | 2 +- .../infopanes/SettingsInfoPane.java | 851 ----------- .../notenoughupdates/itemeditor/NEUItemEditor.java | 2 +- .../notenoughupdates/mbgui/MBGuiGroupFloating.java | 2 +- .../miscfeatures/BetterContainers.java | 473 +++++++ .../miscfeatures/CustomItemEffects.java | 852 +++++++++++ .../miscfeatures/EnchantingSolvers.java | 542 +++++++ .../miscfeatures/ItemRarityHalo.java | 252 ++++ .../miscfeatures/StreamerMode.java | 40 + .../notenoughupdates/miscfeatures/SunTzu.java | 93 ++ .../miscgui/AccessoryBagOverlay.java | 825 +++++++++++ .../notenoughupdates/miscgui/CalendarOverlay.java | 1460 +++++++++++++++++++ .../notenoughupdates/miscgui/GuiEnchantColour.java | 249 ++++ .../notenoughupdates/miscgui/GuiItemRecipe.java | 242 ++++ .../notenoughupdates/miscgui/HelpGUI.java | 189 +++ .../miscgui/NEUOverlayPlacements.java | 219 +++ .../notenoughupdates/miscgui/TradeWindow.java | 1040 ++++++++++++++ .../notenoughupdates/mixins/MixinContainer.java | 19 + .../mixins/MixinEntityRenderer.java | 11 +- .../notenoughupdates/mixins/MixinGuiChest.java | 13 +- .../notenoughupdates/mixins/MixinGuiContainer.java | 52 +- .../notenoughupdates/mixins/MixinGuiIngame.java | 4 +- .../mixins/MixinInventoryEffectRenderer.java | 2 +- .../mixins/MixinNetHandlerPlayClient.java | 19 +- .../notenoughupdates/mixins/MixinRender.java | 2 +- .../notenoughupdates/mixins/MixinRenderFish.java | 6 +- .../notenoughupdates/mixins/MixinRenderGlobal.java | 15 +- .../notenoughupdates/mixins/MixinRenderItem.java | 31 +- .../mixins/MixinTileEntitySpecialRenderer.java | 4 +- .../notenoughupdates/mixins/MixinWorld.java | 25 + .../notenoughupdates/options/NEUConfig.java | 1234 ++++++++++++++++ .../notenoughupdates/options/NEUConfigEditor.java | 390 ++++++ .../notenoughupdates/options/Options.java | 819 ----------- .../profileviewer/GuiProfileViewer.java | 205 ++- .../profileviewer/PlayerStats.java | 132 +- .../profileviewer/ProfileViewer.java | 77 +- .../notenoughupdates/questing/GuiQuestLine.java | 27 - .../notenoughupdates/questing/QuestLine.java | 226 --- .../notenoughupdates/questing/SBInfo.java | 126 -- .../questing/requirements/Requirement.java | 29 - .../questing/requirements/RequirementApi.java | 108 -- .../questing/requirements/RequirementGuiOpen.java | 28 - .../requirements/RequirementIslandType.java | 19 - .../requirements/RequirementItemObtained.java | 29 - .../questing/requirements/RequirementLocation.java | 26 - .../requirements/RequirementLocationRect.java | 34 - .../notenoughupdates/util/AllowEmptyHTMLTag.java | 74 + .../notenoughupdates/util/GuiTextures.java | 103 ++ .../notenoughupdates/util/LerpingInteger.java | 68 - .../notenoughupdates/util/NEUResourceManager.java | 38 + .../util/RequestFocusListener.java | 63 + .../notenoughupdates/util/SBAIntegration.java | 217 +++ .../moulberry/notenoughupdates/util/SBInfo.java | 125 ++ .../moulberry/notenoughupdates/util/Utils.java | 51 +- .../assets/notenoughupdates/capes/furf.png | Bin 0 -> 10380 bytes .../assets/notenoughupdates/capes/lightning.png | Bin 6490 -> 0 bytes .../assets/notenoughupdates/capes/void.png | Bin 0 -> 41607 bytes .../resources/assets/notenoughupdates/core/bar.png | Bin 0 -> 2095 bytes .../notenoughupdates/core/colour_selector_bar.png | Bin 0 -> 245 bytes .../core/colour_selector_bar_alpha.png | Bin 0 -> 240 bytes .../core/colour_selector_chroma.png | Bin 0 -> 211 bytes .../notenoughupdates/core/colour_selector_dot.png | Bin 0 -> 3677 bytes .../core/slider/slider_off_cap.png | Bin 0 -> 595 bytes .../core/slider/slider_off_notch.png | Bin 0 -> 555 bytes .../core/slider/slider_off_segment.png | Bin 0 -> 575 bytes .../notenoughupdates/core/slider/slider_on_cap.png | Bin 0 -> 603 bytes .../core/slider/slider_on_notch.png | Bin 0 -> 555 bytes .../core/slider/slider_on_segment.png | Bin 0 -> 575 bytes .../assets/notenoughupdates/core/toggle_1.png | Bin 0 -> 592 bytes .../assets/notenoughupdates/core/toggle_2.png | Bin 0 -> 590 bytes .../assets/notenoughupdates/core/toggle_3.png | Bin 0 -> 592 bytes .../assets/notenoughupdates/core/toggle_off.png | Bin 0 -> 594 bytes .../assets/notenoughupdates/core/toggle_on.png | Bin 0 -> 593 bytes .../assets/notenoughupdates/shaders/void.frag | 41 + .../assets/notenoughupdates/shaders/void.vert | 16 + .../assets/notenoughupdates/social/discord.png | Bin 0 -> 6690 bytes .../assets/notenoughupdates/social/github.png | Bin 0 -> 11716 bytes .../assets/notenoughupdates/social/patreon.png | Bin 0 -> 3696 bytes .../assets/notenoughupdates/social/twitter.png | Bin 0 -> 5816 bytes .../assets/notenoughupdates/social/youtube.png | Bin 0 -> 348 bytes src/main/resources/mixins.notenoughupdates.json | 4 +- 149 files changed, 13161 insertions(+), 10408 deletions(-) delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/AccessoryBagOverlay.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/AllowEmptyHTMLTag.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/BetterContainers.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/BetterPortals.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/CalendarOverlay.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/CustomItemEffects.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/GuiEnchantColour.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/GuiItemRecipe.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/GuiTextures.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/HelpGUI.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/ItemPriceInformation.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/ItemRarityHalo.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/NEUOverlayPlacements.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/NEUResourceManager.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/RequestFocusListener.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/SBAIntegration.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/StreamerMode.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/SunTzu.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/TradeWindow.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/BackgroundBlur.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/ChromaColour.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/GlScissorStack.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/GuiElement.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementBoolean.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementColour.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/GuiElementTextField.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/GuiScreenElementWrapper.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/Config.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/Category.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigEditorBoolean.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigEditorColour.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigEditorDropdown.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigEditorSlider.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigEditorText.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/annotations/ConfigOption.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditor.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorBoolean.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorColour.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorDropdown.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorSlider.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/gui/GuiOptionEditorText.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/config/struct/ConfigProcessor.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/util/GuiElementSlider.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/util/MiscUtils.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/util/Splitters.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/util/StringUtils.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/util/lerp/LerpUtils.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/util/lerp/LerpingFloat.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/util/lerp/LerpingInteger.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/util/render/RenderUtils.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/core/util/render/TextRenderUtils.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/infopanes/SettingsInfoPane.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/BetterContainers.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/CustomItemEffects.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/EnchantingSolvers.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/ItemRarityHalo.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/StreamerMode.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscfeatures/SunTzu.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/AccessoryBagOverlay.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/CalendarOverlay.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiEnchantColour.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/GuiItemRecipe.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/HelpGUI.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/NEUOverlayPlacements.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/miscgui/TradeWindow.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinContainer.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/mixins/MixinWorld.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfig.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/options/NEUConfigEditor.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/options/Options.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/questing/GuiQuestLine.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/questing/QuestLine.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/questing/SBInfo.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/questing/requirements/Requirement.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/questing/requirements/RequirementApi.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/questing/requirements/RequirementGuiOpen.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/questing/requirements/RequirementIslandType.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/questing/requirements/RequirementItemObtained.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/questing/requirements/RequirementLocation.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/questing/requirements/RequirementLocationRect.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/util/AllowEmptyHTMLTag.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/util/GuiTextures.java delete mode 100644 src/main/java/io/github/moulberry/notenoughupdates/util/LerpingInteger.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/util/NEUResourceManager.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/util/RequestFocusListener.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/util/SBAIntegration.java create mode 100644 src/main/java/io/github/moulberry/notenoughupdates/util/SBInfo.java create mode 100644 src/main/resources/assets/notenoughupdates/capes/furf.png delete mode 100644 src/main/resources/assets/notenoughupdates/capes/lightning.png create mode 100644 src/main/resources/assets/notenoughupdates/capes/void.png create mode 100644 src/main/resources/assets/notenoughupdates/core/bar.png create mode 100644 src/main/resources/assets/notenoughupdates/core/colour_selector_bar.png create mode 100644 src/main/resources/assets/notenoughupdates/core/colour_selector_bar_alpha.png create mode 100644 src/main/resources/assets/notenoughupdates/core/colour_selector_chroma.png create mode 100644 src/main/resources/assets/notenoughupdates/core/colour_selector_dot.png create mode 100644 src/main/resources/assets/notenoughupdates/core/slider/slider_off_cap.png create mode 100644 src/main/resources/assets/notenoughupdates/core/slider/slider_off_notch.png create mode 100644 src/main/resources/assets/notenoughupdates/core/slider/slider_off_segment.png create mode 100644 src/main/resources/assets/notenoughupdates/core/slider/slider_on_cap.png create mode 100644 src/main/resources/assets/notenoughupdates/core/slider/slider_on_notch.png create mode 100644 src/main/resources/assets/notenoughupdates/core/slider/slider_on_segment.png create mode 100644 src/main/resources/assets/notenoughupdates/core/toggle_1.png create mode 100644 src/main/resources/assets/notenoughupdates/core/toggle_2.png create mode 100644 src/main/resources/assets/notenoughupdates/core/toggle_3.png create mode 100644 src/main/resources/assets/notenoughupdates/core/toggle_off.png create mode 100644 src/main/resources/assets/notenoughupdates/core/toggle_on.png create mode 100644 src/main/resources/assets/notenoughupdates/shaders/void.frag create mode 100644 src/main/resources/assets/notenoughupdates/shaders/void.vert create mode 100644 src/main/resources/assets/notenoughupdates/social/discord.png create mode 100644 src/main/resources/assets/notenoughupdates/social/github.png create mode 100644 src/main/resources/assets/notenoughupdates/social/patreon.png create mode 100644 src/main/resources/assets/notenoughupdates/social/twitter.png create mode 100644 src/main/resources/assets/notenoughupdates/social/youtube.png (limited to 'src/main') diff --git a/src/main/java/io/github/moulberry/notenoughupdates/AccessoryBagOverlay.java b/src/main/java/io/github/moulberry/notenoughupdates/AccessoryBagOverlay.java deleted file mode 100644 index 5ca25082..00000000 --- a/src/main/java/io/github/moulberry/notenoughupdates/AccessoryBagOverlay.java +++ /dev/null @@ -1,824 +0,0 @@ -package io.github.moulberry.notenoughupdates; - -import com.google.gson.JsonArray; -import com.google.gson.JsonElement; -import com.google.gson.JsonObject; -import io.github.moulberry.notenoughupdates.profileviewer.PlayerStats; -import io.github.moulberry.notenoughupdates.util.Constants; -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.ScaledResolution; -import net.minecraft.client.gui.inventory.GuiChest; -import net.minecraft.client.gui.inventory.GuiContainer; -import net.minecraft.client.renderer.GlStateManager; -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; -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 org.lwjgl.input.Mouse; -import org.lwjgl.opengl.GL11; -import org.lwjgl.opengl.GL14; - -import java.awt.*; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.util.*; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -import static io.github.moulberry.notenoughupdates.GuiTextures.*; - -public class AccessoryBagOverlay { - - private static final int TAB_BASIC = 0; - private static final int TAB_TOTAL = 1; - private static final int TAB_BONUS = 2; - private static final int TAB_DUP = 3; - private static final int TAB_MISSING = 4; - private static final int TAB_OPTIMIZER = 5; - - private static final ItemStack[] TAB_STACKS = new ItemStack[] { - Utils.createItemStack(Items.dye, EnumChatFormatting.DARK_AQUA+"Basic Information", - 10, EnumChatFormatting.GREEN+"- Talis count by rarity"), - Utils.createItemStack(Items.diamond_sword, EnumChatFormatting.DARK_AQUA+"Total Stat Bonuses", - 0), - Utils.createItemStack(Item.getItemFromBlock(Blocks.anvil), EnumChatFormatting.DARK_AQUA+"Total Stat Bonuses (from reforges)", - 0), - Utils.createItemStack(Items.dye, EnumChatFormatting.DARK_AQUA+"Duplicates", - 8), - Utils.createItemStack(Item.getItemFromBlock(Blocks.barrier), EnumChatFormatting.DARK_AQUA+"Missing", - 0), - Utils.createItemStack(Item.getItemFromBlock(Blocks.redstone_block), EnumChatFormatting.DARK_AQUA+"Optimizer", - 0), - }; - - private static int currentTab = TAB_BASIC; - - public static boolean mouseClick() { - if(Minecraft.getMinecraft().currentScreen instanceof GuiChest) { - GuiChest eventGui = (GuiChest) Minecraft.getMinecraft().currentScreen; - ContainerChest cc = (ContainerChest) eventGui.inventorySlots; - String containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText(); - if(!containerName.trim().startsWith("Accessory Bag")) { - return false; - } - } else { - return false; - } - - if(!Mouse.getEventButtonState()) return false; - try { - ScaledResolution scaledResolution = new ScaledResolution(Minecraft.getMinecraft()); - - int width = scaledResolution.getScaledWidth(); - int height = scaledResolution.getScaledHeight(); - - int mouseX = Mouse.getX() / scaledResolution.getScaleFactor(); - int mouseY = height - Mouse.getY() / scaledResolution.getScaleFactor(); - - int xSize = (int) Utils.getField(GuiContainer.class, Minecraft.getMinecraft().currentScreen, "xSize", "field_146999_f"); - int ySize = (int) Utils.getField(GuiContainer.class, Minecraft.getMinecraft().currentScreen, "ySize", "field_147000_g"); - int guiLeft = (int) Utils.getField(GuiContainer.class, Minecraft.getMinecraft().currentScreen, "guiLeft", "field_147003_i"); - int guiTop = (int) Utils.getField(GuiContainer.class, Minecraft.getMinecraft().currentScreen, "guiTop", "field_147009_r"); - - if(mouseX < guiLeft+xSize+3 || mouseX > guiLeft+xSize+80+28) return false; - if(mouseY < guiTop || mouseY > guiTop+166) return false; - - if(mouseX > guiLeft+xSize+83 && mouseY < guiTop+20*TAB_MISSING+22) { - currentTab = (mouseY - guiTop)/20; - if(currentTab < 0) currentTab = 0; - if(currentTab > TAB_MISSING) currentTab = TAB_MISSING; - } - - if(currentTab == TAB_OPTIMIZER) { - int x = guiLeft+xSize+3; - int y = guiTop; - - if(mouseY > y+92 && mouseY < y+103) { - if(mouseX > x+5 && mouseX < x+75) { - mainWeapon = (int)Math.floor((mouseX-x-5)/70f*9); - if(mainWeapon < 1) { - mainWeapon = 1; - } else if(mainWeapon > 9) { - mainWeapon = 9; - } - } - } - - if(mouseX > x+5 && mouseX < x+35 || mouseX > x+45 && mouseX < x+75) { - boolean set = mouseX > x+5 && mouseX < x+35; - - if(mouseY > y+32 && mouseY < y+43) { - forceCC = set; - } else if(mouseY > y+52 && mouseY < y+63) { - forceAS = set; - } else if(mouseY > y+72 && mouseY < y+83) { - useGodPot = set; - } else if(mouseY > y+92 && mouseY < y+103) { - allowShaded = set; - } - } - } - - return true; - } catch(Exception e) { - return false; - } - } - - public static void resetCache() { - accessoryStacks = new HashSet<>(); - pagesVisited = new HashSet<>(); - talismanCountRarity = null; - totalStats = null; - reforgeStats = null; - duplicates = null; - missing = null; - } - - private static Set accessoryStacks = new HashSet<>(); - private static Set pagesVisited = new HashSet<>(); - - public static void renderVisitOverlay(int x, int y) { - Utils.drawStringCenteredScaledMaxWidth("Please visit all", Minecraft.getMinecraft().fontRendererObj, x+40, y+78, true, 70, -1); - Utils.drawStringCenteredScaledMaxWidth("pages of the bag", Minecraft.getMinecraft().fontRendererObj, x+40, y+86, true, 70, -1); - } - - private static TreeMap talismanCountRarity = null; - public static void renderBasicOverlay(int x, int y) { - if(talismanCountRarity == null) { - talismanCountRarity = new TreeMap<>(); - for(ItemStack stack : accessoryStacks) { - int rarity = getRarity(stack); - if(rarity >= 0) { - talismanCountRarity.put(rarity, talismanCountRarity.getOrDefault(rarity, 0)+1); - } - } - } - - Utils.drawStringCenteredScaledMaxWidth("# By Rarity", Minecraft.getMinecraft().fontRendererObj, x+40, y+12, false, 70, - new Color(80, 80, 80).getRGB()); - - int yIndex = 0; - for(Map.Entry entry : talismanCountRarity.descendingMap().entrySet()) { - String rarityName = rarityArrC[entry.getKey()]; - renderAlignedString(rarityName, EnumChatFormatting.WHITE.toString()+entry.getValue(), x+5, y+20+11*yIndex, 70); - yIndex++; - } - } - - - private static PlayerStats.Stats totalStats = null; - public static void renderTotalStatsOverlay(int x, int y) { - if(totalStats == null) { - totalStats = new PlayerStats.Stats(); - for(ItemStack stack : accessoryStacks) { - if(stack != null) totalStats.add(getStatForItem(stack, STAT_PATTERN_MAP, true)); - } - } - - Utils.drawStringCenteredScaledMaxWidth("Total Stats", Minecraft.getMinecraft().fontRendererObj, x+40, y+12, false, 70, - new Color(80, 80, 80).getRGB()); - int yIndex = 0; - for(int i=0; i duplicates = null; - public static void renderDuplicatesOverlay(int x, int y) { - if(duplicates == null) { - JsonObject misc = Constants.MISC; - if(misc == null) { - Utils.drawStringCenteredScaledMaxWidth("Duplicates: ERROR", Minecraft.getMinecraft().fontRendererObj, x+40, y+12, false, 70, - new Color(80, 80, 80).getRGB()); - return; - } - JsonElement talisman_upgrades_element = misc.get("talisman_upgrades"); - if(talisman_upgrades_element == null) { - Utils.drawStringCenteredScaledMaxWidth("Duplicates: ERROR", Minecraft.getMinecraft().fontRendererObj, x+40, y+12, false, 70, - new Color(80, 80, 80).getRGB()); - return; - } - JsonObject talisman_upgrades = talisman_upgrades_element.getAsJsonObject(); - - duplicates = new HashSet<>(); - - Set prevInternalnames = new HashSet<>(); - for(ItemStack stack : accessoryStacks) { - String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); - - if(prevInternalnames.contains(internalname)) { - duplicates.add(stack); - continue; - } - prevInternalnames.add(internalname); - - if(talisman_upgrades.has(internalname)) { - JsonArray upgrades = talisman_upgrades.get(internalname).getAsJsonArray(); - for(ItemStack stack2 : accessoryStacks) { - if(stack != stack2) { - String internalname2 = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack2); - for(int j=0; j 11) { - if(++yIndex >= 10) break; - } else { - if(++yIndex >= 11) break; - } - } - - if(duplicates.size() > 11) { - Utils.drawStringCenteredScaledMaxWidth("+" + (duplicates.size()-10) + " More", - Minecraft.getMinecraft().fontRendererObj, x+40, y+16+121, false, 70, - new Color(80, 80, 80).getRGB()); - } - } - } - - private static List missing = null; - public static void renderMissingOverlay(int x, int y) { - if(missing == null) { - JsonObject misc = Constants.MISC; - if(misc == null) { - Utils.drawStringCenteredScaledMaxWidth("Duplicates: ERROR", Minecraft.getMinecraft().fontRendererObj, x+40, y+12, false, 70, - new Color(80, 80, 80).getRGB()); - return; - } - JsonElement talisman_upgrades_element = misc.get("talisman_upgrades"); - if(talisman_upgrades_element == null) { - Utils.drawStringCenteredScaledMaxWidth("Duplicates: ERROR", Minecraft.getMinecraft().fontRendererObj, x+40, y+12, false, 70, - new Color(80, 80, 80).getRGB()); - return; - } - JsonObject talisman_upgrades = talisman_upgrades_element.getAsJsonObject(); - - missing = new ArrayList<>(); - - List missingInternal = new ArrayList<>(); - for(Map.Entry entry : NotEnoughUpdates.INSTANCE.manager.getItemInformation().entrySet()) { - if(entry.getValue().has("lore")) { - if(checkItemType(entry.getValue().get("lore").getAsJsonArray(), "ACCESSORY", "HATCCESSORY") >= 0) { - missingInternal.add(entry.getKey()); - } - } - } - - for(ItemStack stack : accessoryStacks) { - String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); - missingInternal.remove(internalname); - - for(Map.Entry talisman_upgrade_element : talisman_upgrades.entrySet()) { - JsonArray upgrades = talisman_upgrade_element.getValue().getAsJsonArray(); - for(int j=0; j 11) { - if(++yIndex >= 10) break; - } else { - if(++yIndex >= 11) break; - } - } - - if(missing.size() > 11) { - Utils.drawStringCenteredScaledMaxWidth("+" + (missing.size()-10) + " More", - Minecraft.getMinecraft().fontRendererObj, x+40, y+16+121, false, 70, - new Color(80, 80, 80).getRGB()); - } - } - } - - private static boolean forceCC = false; - private static boolean forceAS = false; - private static boolean useGodPot = true; - private static boolean allowShaded = true; - private static int mainWeapon = 1; - - public static void renderOptimizerOverlay(int x, int y) { - Utils.drawStringCenteredScaledMaxWidth("Optimizer", Minecraft.getMinecraft().fontRendererObj, x+40, y+12, false, 70, - new Color(80, 80, 80).getRGB()); - - int light = new Color(220, 220, 220).getRGB(); - int dark = new Color(170, 170, 170).getRGB(); - - Gui.drawRect(x+5, y+32, x+35, y+43, forceCC?dark:light); - Gui.drawRect(x+45, y+32, x+75, y+43, forceCC?light:dark); - - Gui.drawRect(x+5, y+52, x+35, y+63, forceAS?dark:light); - Gui.drawRect(x+45, y+52, x+75, y+63, forceAS?light:dark); - - Gui.drawRect(x+5, y+72, x+35, y+83, useGodPot?dark:light); - Gui.drawRect(x+45, y+72, x+75, y+83, useGodPot?light:dark); - - Gui.drawRect(x+5, y+92, x+35, y+103, allowShaded?dark:light); - Gui.drawRect(x+45, y+92, x+75, y+103, allowShaded?light:dark); - - Gui.drawRect(x+5, y+102, x+75, y+113, light); - Gui.drawRect(x+5+(int)((mainWeapon-1)/9f*70), y+102, x+5+(int)(mainWeapon/9f*70), y+113, dark); - - Utils.drawStringCenteredScaledMaxWidth("Force 100% CC", Minecraft.getMinecraft().fontRendererObj, x+40, y+27, false, 70, - new Color(80, 80, 80).getRGB()); - Utils.drawStringCenteredScaledMaxWidth((forceCC?EnumChatFormatting.GREEN:EnumChatFormatting.GRAY)+"YES", - Minecraft.getMinecraft().fontRendererObj, x+20, y+37, - true, 30, new Color(80, 80, 80).getRGB()); - Utils.drawStringCenteredScaledMaxWidth((forceCC?EnumChatFormatting.GRAY:EnumChatFormatting.RED)+"NO", Minecraft.getMinecraft().fontRendererObj, x+60, y+37, - true, 30, new Color(80, 80, 80).getRGB()); - - Utils.drawStringCenteredScaledMaxWidth("Force 100% ATKSPEED", Minecraft.getMinecraft().fontRendererObj, x+40, y+47, false, 70, - new Color(80, 80, 80).getRGB()); - Utils.drawStringCenteredScaledMaxWidth((forceAS?EnumChatFormatting.GREEN:EnumChatFormatting.GRAY)+"YES", Minecraft.getMinecraft().fontRendererObj, x+20, y+57, - true, 30, new Color(80, 80, 80).getRGB()); - Utils.drawStringCenteredScaledMaxWidth((forceAS?EnumChatFormatting.GRAY:EnumChatFormatting.RED)+"NO", Minecraft.getMinecraft().fontRendererObj, x+60, y+57, - true, 30, new Color(80, 80, 80).getRGB()); - - Utils.drawStringCenteredScaledMaxWidth("Use God Potion", Minecraft.getMinecraft().fontRendererObj, x+40, y+67, false, 70, - new Color(80, 80, 80).getRGB()); - Utils.drawStringCenteredScaledMaxWidth((useGodPot?EnumChatFormatting.GREEN:EnumChatFormatting.GRAY)+"YES", Minecraft.getMinecraft().fontRendererObj, x+20, y+77, - true, 30, new Color(80, 80, 80).getRGB()); - Utils.drawStringCenteredScaledMaxWidth((useGodPot?EnumChatFormatting.GRAY:EnumChatFormatting.RED)+"NO", Minecraft.getMinecraft().fontRendererObj, x+60, y+77, - true, 30, new Color(80, 80, 80).getRGB()); - - Utils.drawStringCenteredScaledMaxWidth("Use God Potion", Minecraft.getMinecraft().fontRendererObj, x+40, y+87, false, 70, - new Color(80, 80, 80).getRGB()); - Utils.drawStringCenteredScaledMaxWidth((allowShaded?EnumChatFormatting.GREEN:EnumChatFormatting.GRAY)+"YES", - Minecraft.getMinecraft().fontRendererObj, x+20, y+97, - true, 30, new Color(80, 80, 80).getRGB()); - Utils.drawStringCenteredScaledMaxWidth((allowShaded?EnumChatFormatting.GRAY:EnumChatFormatting.RED)+"NO", - Minecraft.getMinecraft().fontRendererObj, x+60, y+97, - true, 30, new Color(80, 80, 80).getRGB()); - - Utils.drawStringCenteredScaledMaxWidth("Main Weapon", Minecraft.getMinecraft().fontRendererObj, x+40, y+107, false, 70, - new Color(80, 80, 80).getRGB()); - Utils.drawStringCenteredScaled("1 2 3 4 5 6 7 8 9", - Minecraft.getMinecraft().fontRendererObj, x+40, y+117, - true, 70, new Color(80, 80, 80).getRGB()); - } - - private static Comparator getItemComparator() { - return (o1, o2) -> { - float cost1; - JsonObject o1Auc = NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAuctionInfo(o1); - if(o1Auc != null && o1Auc.has("price")) { - cost1 = o1Auc.get("price").getAsFloat(); - } else { - cost1 = NotEnoughUpdates.INSTANCE.manager.auctionManager.getCraftCost(o1).craftCost; - } - float cost2; - JsonObject o2Auc = NotEnoughUpdates.INSTANCE.manager.auctionManager.getItemAuctionInfo(o2); - if(o2Auc != null && o2Auc.has("price")) { - cost2 = o2Auc.get("price").getAsFloat(); - } else { - cost2 = NotEnoughUpdates.INSTANCE.manager.auctionManager.getCraftCost(o2).craftCost; - } - - - if(cost1 < cost2) return -1; - if(cost1 > cost2) return 1; - - return o1.compareTo(o2); - }; - } - - public static void renderOverlay() { - if(Minecraft.getMinecraft().currentScreen instanceof GuiChest) { - GuiChest eventGui = (GuiChest) Minecraft.getMinecraft().currentScreen; - ContainerChest cc = (ContainerChest) eventGui.inventorySlots; - String containerName = cc.getLowerChestInventory().getDisplayName().getUnformattedText(); - if(containerName.trim().startsWith("Accessory Bag")) { - try { - int xSize = (int) Utils.getField(GuiContainer.class, eventGui, "xSize", "field_146999_f"); - int ySize = (int) Utils.getField(GuiContainer.class, eventGui, "ySize", "field_147000_g"); - int guiLeft = (int) Utils.getField(GuiContainer.class, eventGui, "guiLeft", "field_147003_i"); - int guiTop = (int) Utils.getField(GuiContainer.class, eventGui, "guiTop", "field_147009_r"); - - if(accessoryStacks.isEmpty()) { - for(ItemStack stack : Minecraft.getMinecraft().thePlayer.inventory.mainInventory) { - if(stack != null && isAccessory(stack)) { - accessoryStacks.add(stack); - } - } - } - - if(containerName.trim().contains("(")) { - String first = containerName.trim().split("\\(")[1].split("/")[0]; - Integer currentPageNumber = Integer.parseInt(first); - //System.out.println("current:"+currentPageNumber); - if(!pagesVisited.contains(currentPageNumber)) { - boolean hasStack = false; - if(Minecraft.getMinecraft().thePlayer.openContainer instanceof ContainerChest) { - IInventory inv = ((ContainerChest)Minecraft.getMinecraft().thePlayer.openContainer).getLowerChestInventory(); - for(int i=0; i pagesVisited.size()) { - Minecraft.getMinecraft().getTextureManager().bindTexture(accessory_bag_overlay); - Utils.drawTexturedRect(guiLeft+xSize+3, guiTop, 80, 149, 0, 80/256f, 0, 149/256f, GL11.GL_NEAREST); - - renderVisitOverlay(guiLeft+xSize+3, guiTop); - return; - } - } else if(pagesVisited.isEmpty()) { - boolean hasStack = false; - if(Minecraft.getMinecraft().thePlayer.openContainer instanceof ContainerChest) { - IInventory inv = ((ContainerChest)Minecraft.getMinecraft().thePlayer.openContainer).getLowerChestInventory(); - for(int i=0; i= length) { - for(int xOff=-2; xOff<=2; xOff++) { - for(int yOff=-2; yOff<=2; yOff++) { - if(Math.abs(xOff) != Math.abs(yOff)) { - Utils.drawStringCenteredScaledMaxWidth(Utils.cleanColourNotModifiers(first + " " + second), Minecraft.getMinecraft().fontRendererObj, - x+length/2f+xOff/2f, y+4+yOff/2f, false, length, - new Color(0, 0, 0, 200/Math.max(Math.abs(xOff), Math.abs(yOff))).getRGB()); - } - } - } - - GlStateManager.color(1, 1, 1, 1); - Utils.drawStringCenteredScaledMaxWidth(first + " " + second, Minecraft.getMinecraft().fontRendererObj, - x+length/2f, y+4, false, length, 4210752); - } else { - for(int xOff=-2; xOff<=2; xOff++) { - for(int yOff=-2; yOff<=2; yOff++) { - if(Math.abs(xOff) != Math.abs(yOff)) { - fontRendererObj.drawString(Utils.cleanColourNotModifiers(first), - x+xOff/2f, y+yOff/2f, - new Color(0, 0, 0, 200/Math.max(Math.abs(xOff), Math.abs(yOff))).getRGB(), false); - } - } - } - - int secondLen = fontRendererObj.getStringWidth(second); - GlStateManager.color(1, 1, 1, 1); - fontRendererObj.drawString(first, x, y, 4210752, false); - for(int xOff=-2; xOff<=2; xOff++) { - for(int yOff=-2; yOff<=2; yOff++) { - if(Math.abs(xOff) != Math.abs(yOff)) { - fontRendererObj.drawString(Utils.cleanColourNotModifiers(second), - x+length-secondLen+xOff/2f, y+yOff/2f, - new Color(0, 0, 0, 200/Math.max(Math.abs(xOff), Math.abs(yOff))).getRGB(), false); - } - } - } - - GlStateManager.color(1, 1, 1, 1); - fontRendererObj.drawString(second, x+length-secondLen, y, 4210752, false); - } - } - - private static final Pattern HEALTH_PATTERN_BONUS = Pattern.compile("^Health: (?:\\+|-)[0-9]+ HP \\([a-zA-Z]+ ((?:\\+|-)[0-9]+)"); - private static final Pattern DEFENCE_PATTERN_BONUS = Pattern.compile("^Defense: (?:\\+|-)[0-9]+ \\([a-zA-Z]+ ((?:\\+|-)[0-9]+)"); - private static final Pattern STRENGTH_PATTERN_BONUS = Pattern.compile("^Strength: (?:\\+|-)[0-9]+ \\([a-zA-Z]+ ((?:\\+|-)[0-9]+)"); - private static final Pattern SPEED_PATTERN_BONUS = Pattern.compile("^Speed: (?:\\+|-)[0-9]+ \\([a-zA-Z]+ ((?:\\+|-)[0-9]+)"); - private static final Pattern CC_PATTERN_BONUS = Pattern.compile("^Crit Chance: (?:\\+|-)[0-9]+% \\([a-zA-Z]+ ((?:\\+|-)[0-9]+)"); - private static final Pattern CD_PATTERN_BONUS = Pattern.compile("^Crit Damage: (?:\\+|-)[0-9]+% \\([a-zA-Z]+ ((?:\\+|-)[0-9]+)"); - private static final Pattern ATKSPEED_PATTERN_BONUS = Pattern.compile("^Bonus Attack Speed: (?:\\+|-)[0-9]+% \\([a-zA-Z]+ ((?:\\+|-)[0-9]+)"); - private static final Pattern INTELLIGENCE_PATTERN_BONUS = Pattern.compile("^Intelligence: (?:\\+|-)[0-9]+ \\([a-zA-Z]+ ((?:\\+|-)[0-9]+)"); - private static final Pattern SCC_PATTERN_BONUS = Pattern.compile("^Sea Creature Chance: (?:\\+|-)[0-9]+ \\([a-zA-Z]+ ((?:\\+|-)[0-9]+)"); - private static final HashMap STAT_PATTERN_MAP_BONUS = new HashMap<>(); - static { - STAT_PATTERN_MAP_BONUS.put("health", HEALTH_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("defence", DEFENCE_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("strength", STRENGTH_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("speed", SPEED_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("crit_chance", CC_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("crit_damage", CD_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("bonus_attack_speed", ATKSPEED_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("intelligence", INTELLIGENCE_PATTERN_BONUS); - STAT_PATTERN_MAP_BONUS.put("sea_creature_chance", SCC_PATTERN_BONUS); - } - - private static final Pattern HEALTH_PATTERN = Pattern.compile("^Health: ((?:\\+|-)[0-9]+)"); - private static final Pattern DEFENCE_PATTERN = Pattern.compile("^Defense: ((?:\\+|-)[0-9]+)"); - private static final Pattern STRENGTH_PATTERN = Pattern.compile("^Strength: ((?:\\+|-)[0-9]+)"); - private static final Pattern SPEED_PATTERN = Pattern.compile("^Speed: ((?:\\+|-)[0-9]+)"); - private static final Pattern CC_PATTERN = Pattern.compile("^Crit Chance: ((?:\\+|-)[0-9]+)"); - private static final Pattern CD_PATTERN = Pattern.compile("^Crit Damage: ((?:\\+|-)[0-9]+)"); - private static final Pattern ATKSPEED_PATTERN = Pattern.compile("^Bonus Attack Speed: ((?:\\+|-)[0-9]+)"); - private static final Pattern INTELLIGENCE_PATTERN = Pattern.compile("^Intelligence: ((?:\\+|-)[0-9]+)"); - private static final Pattern SCC_PATTERN = Pattern.compile("^Sea Creature Chance: ((?:\\+|-)[0-9]+)"); - private static final HashMap STAT_PATTERN_MAP = new HashMap<>(); - static { - STAT_PATTERN_MAP.put("health", HEALTH_PATTERN); - STAT_PATTERN_MAP.put("defence", DEFENCE_PATTERN); - STAT_PATTERN_MAP.put("strength", STRENGTH_PATTERN); - STAT_PATTERN_MAP.put("speed", SPEED_PATTERN); - STAT_PATTERN_MAP.put("crit_chance", CC_PATTERN); - STAT_PATTERN_MAP.put("crit_damage", CD_PATTERN); - STAT_PATTERN_MAP.put("bonus_attack_speed", ATKSPEED_PATTERN); - STAT_PATTERN_MAP.put("intelligence", INTELLIGENCE_PATTERN); - STAT_PATTERN_MAP.put("sea_creature_chance", SCC_PATTERN); - } - private static PlayerStats.Stats getStatForItem(ItemStack stack, HashMap patternMap, boolean addExtras) { - String internalname = NotEnoughUpdates.INSTANCE.manager.getInternalNameForItem(stack); - NBTTagCompound tag = stack.getTagCompound(); - PlayerStats.Stats stats = new PlayerStats.Stats(); - - if(internalname == null) { - return stats; - } - - if(tag != null) { - NBTTagCompound display = tag.getCompoundTag("display"); - if (display.hasKey("Lore", 9)) { - NBTTagList list = display.getTagList("Lore", 8); - for (int i = 0; i < list.tagCount(); i++) { - String line = list.getStringTagAt(i); - for(Map.Entry entry : patternMap.entrySet()) { - Matcher matcher = entry.getValue().matcher(Utils.cleanColour(line)); - if(matcher.find()) { - int bonus = Integer.parseInt(matcher.group(1)); - stats.addStat(entry.getKey(), bonus); - } - } - } - } - } - - if(!addExtras) return stats; - - if(internalname.equals("DAY_CRYSTAL") || internalname.equals("NIGHT_CRYSTAL")) { - stats.addStat(PlayerStats.STRENGTH, 2.5f); - stats.addStat(PlayerStats.DEFENCE, 2.5f); - } - - if(internalname.equals("NEW_YEAR_CAKE_BAG") && tag != null && tag.hasKey("ExtraAttributes", 10)) { - NBTTagCompound ea = tag.getCompoundTag("ExtraAttributes"); - - byte[] bytes = null; - for (String key : ea.getKeySet()) { - if (key.endsWith("backpack_data") || key.equals("new_year_cake_bag_data")) { - bytes = ea.getByteArray(key); - try { - NBTTagCompound contents_nbt = CompressedStreamTools.readCompressed(new ByteArrayInputStream(bytes)); - NBTTagList items = contents_nbt.getTagList("i", 10); - HashSet cakes = new HashSet<>(); - for(int j=0; j 0) { - NBTTagCompound nbt = items.getCompoundTagAt(j).getCompoundTag("tag"); - if(nbt != null && nbt.hasKey("ExtraAttributes", 10)) { - NBTTagCompound ea2 = nbt.getCompoundTag("ExtraAttributes"); - if (ea2.hasKey("new_years_cake")) { - cakes.add(ea2.getInteger("new_years_cake")); - } - } - } - } - stats.addStat(PlayerStats.HEALTH, cakes.size()); - } catch(IOException e) { - e.printStackTrace(); - return stats; - } - break; - } - } - } - return stats; - } - - private static String[] rarityArr = new String[] { - "COMMON", "UNCOMMON", "RARE", "EPIC", "LEGENDARY", "MYTHIC", "SPECIAL", "VERY SPECIAL", - }; - private static String[] rarityArrC = new String[] { - EnumChatFormatting.WHITE+EnumChatFormatting.BOLD.toString()+"COMMON", - EnumChatFormatting.GREEN+EnumChatFormatting.BOLD.toString()+"UNCOMMON", - EnumChatFormatting.BLUE+EnumChatFormatting.BOLD.toString()+"RARE", - EnumChatFormatting.DARK_PURPLE+EnumChatFormatting.BOLD.toString()+"EPIC", - EnumChatFormatting.GOLD+EnumChatFormatting.BOLD.toString()+"LEGENDARY", - EnumChatFormatting.LIGHT_PURPLE+EnumChatFormatting.BOLD.toString()+"MYTHIC", - EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"SPECIAL", - EnumChatFormatting.RED+EnumChatFormatting.BOLD.toString()+"VERY SPECIAL", - EnumChatFormatting.DARK_RED+EnumChatFormatting.BOLD.toString()+"SUPREME", - }; - public static int checkItemType(ItemStack stack, boolean contains, String... typeMatches) { - NBTTagCompound tag = stack.getTagCompound(); - if(tag != null) { - NBTTagCompound display = tag.getCompoundTag("display"); - if (display.hasKey("Lore", 9)) { - NBTTagList list = display.getTagList("Lore", 8); - for (int i = list.tagCount()-1; i >= 0; i--) { - String line = list.getStringTagAt(i); - for(String rarity : rarityArr) { - for(int j=0; j=0; i--) { - String line = lore.get(i).getAsString(); - - for(String rarity : rarityArr) { - for(int j=0; j= 0; - } - - public static int getRarity(ItemStack stack) { - NBTTagCompound tag = stack.getTagCompound(); - if(tag != null) { - NBTTagCompound display = tag.getCompoundTag("display"); - if (display.hasKey("Lore", 9)) { - NBTTagList list = display.getTagList("Lore", 8); - for (int i = list.tagCount(); i >= 0; i--) { - String line = list.getStringTagAt(i); - for(int j=0; j children = node.getChildren(); - - if (NEW_LINES) { - switch (name) { - case "div": - case "p": - case "li": - case "td": -