From a5c540d977a3510812cac7fac340fe17e7d10983 Mon Sep 17 00:00:00 2001 From: Lorenz Date: Thu, 14 Jul 2022 12:06:07 +0200 Subject: renamed mod to SkyHanni --- .../java/at/hannibal2/skyhanni/SkyHanniMod.java | 119 ++++ .../java/at/hannibal2/skyhanni/bazaar/BazaarApi.kt | 59 ++ .../at/hannibal2/skyhanni/bazaar/BazaarData.kt | 3 + .../hannibal2/skyhanni/bazaar/BazaarDataGrabber.kt | 113 ++++ .../hannibal2/skyhanni/bazaar/BazaarOrderHelper.kt | 87 +++ .../java/at/hannibal2/skyhanni/chat/ChatFilter.kt | 284 ++++++++++ .../java/at/hannibal2/skyhanni/chat/ChatManager.kt | 51 ++ .../at/hannibal2/skyhanni/chat/PlayerChatFilter.kt | 90 +++ .../skyhanni/chat/PlayerMessageChannel.kt | 10 + .../at/hannibal2/skyhanni/config/Features.java | 274 ++++++++++ .../at/hannibal2/skyhanni/config/GuiTextures.java | 32 ++ .../skyhanni/config/commands/Commands.java | 26 + .../skyhanni/config/commands/SimpleCommand.java | 60 ++ .../skyhanni/config/config/ConfigEditor.java | 602 +++++++++++++++++++++ .../skyhanni/config/core/BackgroundBlur.java | 249 +++++++++ .../skyhanni/config/core/ChromaColour.java | 93 ++++ .../skyhanni/config/core/GlScissorStack.java | 86 +++ .../hannibal2/skyhanni/config/core/GuiElement.java | 12 + .../skyhanni/config/core/GuiElementBoolean.java | 118 ++++ .../skyhanni/config/core/GuiElementColour.java | 370 +++++++++++++ .../skyhanni/config/core/GuiElementTextField.java | 549 +++++++++++++++++++ .../config/core/GuiScreenElementWrapper.java | 34 ++ .../skyhanni/config/core/config/Config.java | 5 + .../skyhanni/config/core/config/KeybindHelper.java | 49 ++ .../skyhanni/config/core/config/Position.java | 197 +++++++ .../config/core/config/annotations/Category.java | 14 + .../core/config/annotations/ConfigAccordionId.java | 12 + .../config/annotations/ConfigEditorAccordion.java | 12 + .../config/annotations/ConfigEditorBoolean.java | 11 + .../config/annotations/ConfigEditorButton.java | 14 + .../config/annotations/ConfigEditorColour.java | 11 + .../annotations/ConfigEditorDraggableList.java | 12 + .../config/annotations/ConfigEditorDropdown.java | 14 + .../config/annotations/ConfigEditorKeybind.java | 12 + .../config/annotations/ConfigEditorSlider.java | 16 + .../core/config/annotations/ConfigEditorStyle.java | 11 + .../core/config/annotations/ConfigEditorText.java | 11 + .../core/config/annotations/ConfigOption.java | 16 + .../config/core/config/gui/GuiOptionEditor.java | 62 +++ .../core/config/gui/GuiOptionEditorAccordion.java | 80 +++ .../core/config/gui/GuiOptionEditorBoolean.java | 37 ++ .../core/config/gui/GuiOptionEditorButton.java | 60 ++ .../core/config/gui/GuiOptionEditorColour.java | 74 +++ .../config/gui/GuiOptionEditorDraggableList.java | 269 +++++++++ .../core/config/gui/GuiOptionEditorDropdown.java | 145 +++++ .../core/config/gui/GuiOptionEditorKeybind.java | 88 +++ .../core/config/gui/GuiOptionEditorSlider.java | 136 +++++ .../core/config/gui/GuiOptionEditorStyle.java | 42 ++ .../core/config/gui/GuiOptionEditorText.java | 78 +++ .../config/core/config/gui/GuiPositionEditor.java | 172 ++++++ .../config/core/config/struct/ConfigProcessor.java | 167 ++++++ .../config/core/util/GuiElementSlider.java | 121 +++++ .../skyhanni/config/core/util/StringUtils.java | 8 + .../skyhanni/config/core/util/lerp/LerpUtils.java | 25 + .../config/core/util/lerp/LerpingFloat.java | 68 +++ .../config/core/util/lerp/LerpingInteger.java | 76 +++ .../config/core/util/render/RenderUtils.java | 155 ++++++ .../config/core/util/render/TextRenderUtils.java | 155 ++++++ .../skyhanni/config/textures/TextureObject.java | 37 ++ .../skyhanni/config/textures/Textures.java | 54 ++ .../at/hannibal2/skyhanni/config/utils/Utils.java | 367 +++++++++++++ .../skyhanni/dungeon/DungeonBossMessages.kt | 51 ++ .../skyhanni/dungeon/DungeonChatFilter.kt | 224 ++++++++ .../hannibal2/skyhanni/dungeon/DungeonCleanEnd.kt | 130 +++++ .../at/hannibal2/skyhanni/dungeon/DungeonData.kt | 46 ++ .../skyhanni/dungeon/DungeonDeathCounter.kt | 97 ++++ .../dungeon/DungeonHighlightClickedBlocks.kt | 99 ++++ .../skyhanni/dungeon/DungeonMilestoneDisplay.kt | 96 ++++ .../damageindicator/DungeonBossDamageIndicator.kt | 181 +++++++ .../dungeon/damageindicator/DungeonBossFinder.kt | 381 +++++++++++++ .../skyhanni/dungeon/damageindicator/EntityData.kt | 6 + .../dungeon/damageindicator/EntityResult.kt | 3 + .../skyhanni/events/CheckRenderEntityEvent.kt | 14 + .../events/DamageIndicatorFinalBossEvent.kt | 3 + .../hannibal2/skyhanni/events/DungeonEnterEvent.kt | 3 + .../hannibal2/skyhanni/events/GuiContainerEvent.kt | 54 ++ .../skyhanni/events/GuiRenderItemEvent.kt | 23 + .../skyhanni/events/LorenzActionBarEvent.kt | 3 + .../hannibal2/skyhanni/events/LorenzChatEvent.kt | 5 + .../at/hannibal2/skyhanni/events/LorenzEvent.kt | 20 + .../at/hannibal2/skyhanni/events/PacketEvent.kt | 25 + .../skyhanni/events/PlayerSendChatEvent.kt | 11 + .../skyhanni/items/HideNotClickableItems.kt | 440 +++++++++++++++ .../skyhanni/items/ItemDisplayOverlayFeatures.kt | 107 ++++ .../items/abilitycooldown/ItemAbilityCooldown.kt | 197 +++++++ .../items/abilitycooldown/WitherImpactDetection.kt | 65 +++ .../at/hannibal2/skyhanni/misc/ButtonOnPause.kt | 51 ++ .../hannibal2/skyhanni/misc/CurrentPetDisplay.kt | 53 ++ .../skyhanni/misc/ExpBottleOnGroundHider.kt | 19 + .../java/at/hannibal2/skyhanni/misc/HypixelData.kt | 63 +++ .../at/hannibal2/skyhanni/misc/ScoreboardData.kt | 45 ++ .../skyhanni/mixinhooks/GuiContainerHook.kt | 61 +++ .../mixinhooks/NetHandlerPlayClientHook.kt | 9 + .../skyhanni/mixinhooks/NetworkManagerHook.kt | 10 + .../skyhanni/mixinhooks/RenderItemHook.kt | 28 + .../skyhanni/mixinhooks/RenderManagerHook.kt | 25 + .../skyhanni/mixins/MixinGuiContainer.java | 48 ++ .../skyhanni/mixins/MixinNetHandlerPlayClient.java | 24 + .../skyhanni/mixins/MixinNetworkManager.java | 20 + .../hannibal2/skyhanni/mixins/MixinRenderItem.java | 41 ++ .../skyhanni/mixins/MixinRenderManager.java | 19 + .../java/at/hannibal2/skyhanni/test/LorenzTest.kt | 28 + .../java/at/hannibal2/skyhanni/utils/APIUtil.kt | 48 ++ .../java/at/hannibal2/skyhanni/utils/BlockUtils.kt | 23 + .../java/at/hannibal2/skyhanni/utils/GuiRender.kt | 32 ++ .../java/at/hannibal2/skyhanni/utils/ItemUtil.kt | 213 ++++++++ .../java/at/hannibal2/skyhanni/utils/ItemUtils.kt | 72 +++ .../at/hannibal2/skyhanni/utils/LorenzColor.kt | 27 + .../at/hannibal2/skyhanni/utils/LorenzDebug.kt | 16 + .../at/hannibal2/skyhanni/utils/LorenzLogger.kt | 70 +++ .../at/hannibal2/skyhanni/utils/LorenzUtils.kt | 113 ++++ .../java/at/hannibal2/skyhanni/utils/LorenzVec.kt | 61 +++ .../java/at/hannibal2/skyhanni/utils/NumberUtil.kt | 152 ++++++ .../at/hannibal2/skyhanni/utils/RenderUtils.kt | 355 ++++++++++++ src/main/java/at/lorenz/mod/LorenzMod.java | 119 ---- src/main/java/at/lorenz/mod/bazaar/BazaarApi.kt | 59 -- src/main/java/at/lorenz/mod/bazaar/BazaarData.kt | 3 - .../java/at/lorenz/mod/bazaar/BazaarDataGrabber.kt | 115 ---- .../java/at/lorenz/mod/bazaar/BazaarOrderHelper.kt | 87 --- src/main/java/at/lorenz/mod/chat/ChatFilter.kt | 284 ---------- src/main/java/at/lorenz/mod/chat/ChatManager.kt | 51 -- .../java/at/lorenz/mod/chat/PlayerChatFilter.kt | 90 --- .../at/lorenz/mod/chat/PlayerMessageChannel.kt | 10 - src/main/java/at/lorenz/mod/config/Features.java | 274 ---------- .../java/at/lorenz/mod/config/GuiTextures.java | 32 -- .../at/lorenz/mod/config/commands/Commands.java | 31 -- .../lorenz/mod/config/commands/SimpleCommand.java | 60 -- .../at/lorenz/mod/config/config/ConfigEditor.java | 602 --------------------- .../at/lorenz/mod/config/core/BackgroundBlur.java | 249 --------- .../at/lorenz/mod/config/core/ChromaColour.java | 93 ---- .../at/lorenz/mod/config/core/GlScissorStack.java | 86 --- .../java/at/lorenz/mod/config/core/GuiElement.java | 12 - .../lorenz/mod/config/core/GuiElementBoolean.java | 118 ---- .../lorenz/mod/config/core/GuiElementColour.java | 370 ------------- .../mod/config/core/GuiElementTextField.java | 549 ------------------- .../mod/config/core/GuiScreenElementWrapper.java | 34 -- .../at/lorenz/mod/config/core/config/Config.java | 5 - .../mod/config/core/config/KeybindHelper.java | 49 -- .../at/lorenz/mod/config/core/config/Position.java | 197 ------- .../config/core/config/annotations/Category.java | 14 - .../core/config/annotations/ConfigAccordionId.java | 12 - .../config/annotations/ConfigEditorAccordion.java | 12 - .../config/annotations/ConfigEditorBoolean.java | 11 - .../config/annotations/ConfigEditorButton.java | 14 - .../config/annotations/ConfigEditorColour.java | 11 - .../annotations/ConfigEditorDraggableList.java | 12 - .../config/annotations/ConfigEditorDropdown.java | 14 - .../config/annotations/ConfigEditorKeybind.java | 12 - .../config/annotations/ConfigEditorSlider.java | 16 - .../core/config/annotations/ConfigEditorStyle.java | 11 - .../core/config/annotations/ConfigEditorText.java | 11 - .../core/config/annotations/ConfigOption.java | 16 - .../config/core/config/gui/GuiOptionEditor.java | 62 --- .../core/config/gui/GuiOptionEditorAccordion.java | 80 --- .../core/config/gui/GuiOptionEditorBoolean.java | 37 -- .../core/config/gui/GuiOptionEditorButton.java | 60 -- .../core/config/gui/GuiOptionEditorColour.java | 74 --- .../config/gui/GuiOptionEditorDraggableList.java | 268 --------- .../core/config/gui/GuiOptionEditorDropdown.java | 145 ----- .../core/config/gui/GuiOptionEditorKeybind.java | 88 --- .../core/config/gui/GuiOptionEditorSlider.java | 136 ----- .../core/config/gui/GuiOptionEditorStyle.java | 42 -- .../core/config/gui/GuiOptionEditorText.java | 78 --- .../config/core/config/gui/GuiPositionEditor.java | 171 ------ .../config/core/config/struct/ConfigProcessor.java | 166 ------ .../mod/config/core/util/GuiElementSlider.java | 120 ---- .../lorenz/mod/config/core/util/StringUtils.java | 8 - .../mod/config/core/util/lerp/LerpUtils.java | 25 - .../mod/config/core/util/lerp/LerpingFloat.java | 68 --- .../mod/config/core/util/lerp/LerpingInteger.java | 76 --- .../mod/config/core/util/render/RenderUtils.java | 155 ------ .../config/core/util/render/TextRenderUtils.java | 155 ------ .../lorenz/mod/config/textures/TextureObject.java | 37 -- .../at/lorenz/mod/config/textures/Textures.java | 56 -- .../java/at/lorenz/mod/config/utils/Utils.java | 374 ------------- .../at/lorenz/mod/dungeon/DungeonBossMessages.kt | 51 -- .../at/lorenz/mod/dungeon/DungeonChatFilter.kt | 224 -------- .../java/at/lorenz/mod/dungeon/DungeonCleanEnd.kt | 130 ----- src/main/java/at/lorenz/mod/dungeon/DungeonData.kt | 46 -- .../at/lorenz/mod/dungeon/DungeonDeathCounter.kt | 97 ---- .../mod/dungeon/DungeonHighlightClickedBlocks.kt | 99 ---- .../lorenz/mod/dungeon/DungeonMilestoneDisplay.kt | 97 ---- .../damageindicator/DungeonBossDamageIndicator.kt | 181 ------- .../dungeon/damageindicator/DungeonBossFinder.kt | 382 ------------- .../mod/dungeon/damageindicator/EntityData.kt | 6 - .../mod/dungeon/damageindicator/EntityResult.kt | 3 - .../at/lorenz/mod/events/CheckRenderEntityEvent.kt | 14 - .../mod/events/DamageIndicatorFinalBossEvent.kt | 3 - .../java/at/lorenz/mod/events/DungeonEnterEvent.kt | 3 - .../java/at/lorenz/mod/events/GuiContainerEvent.kt | 54 -- .../at/lorenz/mod/events/GuiRenderItemEvent.kt | 23 - .../at/lorenz/mod/events/LorenzActionBarEvent.kt | 3 - .../java/at/lorenz/mod/events/LorenzChatEvent.kt | 5 - src/main/java/at/lorenz/mod/events/LorenzEvent.kt | 20 - src/main/java/at/lorenz/mod/events/PacketEvent.kt | 25 - .../at/lorenz/mod/events/PlayerSendChatEvent.kt | 11 - .../at/lorenz/mod/items/HideNotClickableItems.kt | 450 --------------- .../lorenz/mod/items/ItemDisplayOverlayFeatures.kt | 120 ---- .../items/abilitycooldown/ItemAbilityCooldown.kt | 197 ------- .../items/abilitycooldown/WitherImpactDetection.kt | 65 --- src/main/java/at/lorenz/mod/misc/ButtonOnPause.kt | 51 -- .../java/at/lorenz/mod/misc/CurrentPetDisplay.kt | 53 -- .../at/lorenz/mod/misc/ExpBottleOnGroundHider.kt | 19 - src/main/java/at/lorenz/mod/misc/HypixelData.kt | 63 --- src/main/java/at/lorenz/mod/misc/ScoreboardData.kt | 45 -- .../at/lorenz/mod/mixinhooks/GuiContainerHook.kt | 61 --- .../mod/mixinhooks/NetHandlerPlayClientHook.kt | 9 - .../at/lorenz/mod/mixinhooks/NetworkManagerHook.kt | 10 - .../at/lorenz/mod/mixinhooks/RenderItemHook.kt | 28 - .../at/lorenz/mod/mixinhooks/RenderManagerHook.kt | 25 - .../at/lorenz/mod/mixins/MixinGuiContainer.java | 48 -- .../mod/mixins/MixinNetHandlerPlayClient.java | 26 - .../at/lorenz/mod/mixins/MixinNetworkManager.java | 20 - .../java/at/lorenz/mod/mixins/MixinRenderItem.java | 42 -- .../at/lorenz/mod/mixins/MixinRenderManager.java | 19 - src/main/java/at/lorenz/mod/test/LorenzTest.kt | 40 -- src/main/java/at/lorenz/mod/utils/APIUtil.kt | 48 -- src/main/java/at/lorenz/mod/utils/BlockUtils.kt | 23 - src/main/java/at/lorenz/mod/utils/GuiRender.kt | 32 -- src/main/java/at/lorenz/mod/utils/ItemUtil.kt | 213 -------- src/main/java/at/lorenz/mod/utils/ItemUtils.kt | 72 --- src/main/java/at/lorenz/mod/utils/LorenzColor.kt | 27 - src/main/java/at/lorenz/mod/utils/LorenzDebug.kt | 16 - src/main/java/at/lorenz/mod/utils/LorenzLogger.kt | 70 --- src/main/java/at/lorenz/mod/utils/LorenzUtils.kt | 130 ----- src/main/java/at/lorenz/mod/utils/LorenzVec.kt | 61 --- src/main/java/at/lorenz/mod/utils/NumberUtil.kt | 152 ------ src/main/java/at/lorenz/mod/utils/RenderUtils.kt | 355 ------------ 228 files changed, 10224 insertions(+), 10293 deletions(-) create mode 100644 src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java create mode 100644 src/main/java/at/hannibal2/skyhanni/bazaar/BazaarApi.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/bazaar/BazaarData.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/bazaar/BazaarDataGrabber.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/bazaar/BazaarOrderHelper.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/chat/ChatFilter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/chat/ChatManager.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/chat/PlayerChatFilter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/chat/PlayerMessageChannel.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/config/Features.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/GuiTextures.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/commands/Commands.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/commands/SimpleCommand.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/config/ConfigEditor.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/BackgroundBlur.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/ChromaColour.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/GlScissorStack.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/GuiElement.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/GuiElementBoolean.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/GuiElementColour.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/GuiElementTextField.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/GuiScreenElementWrapper.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/Config.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/KeybindHelper.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/Position.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/Category.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigAccordionId.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorAccordion.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorBoolean.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorButton.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorColour.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorDraggableList.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorDropdown.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorKeybind.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorSlider.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorStyle.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigEditorText.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/annotations/ConfigOption.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditor.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorAccordion.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorBoolean.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorButton.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorColour.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorDraggableList.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorDropdown.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorKeybind.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorSlider.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorStyle.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiOptionEditorText.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/gui/GuiPositionEditor.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/config/struct/ConfigProcessor.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/util/GuiElementSlider.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/util/StringUtils.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/util/lerp/LerpUtils.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/util/lerp/LerpingFloat.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/util/lerp/LerpingInteger.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/util/render/RenderUtils.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/core/util/render/TextRenderUtils.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/textures/TextureObject.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/textures/Textures.java create mode 100644 src/main/java/at/hannibal2/skyhanni/config/utils/Utils.java create mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonBossMessages.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonChatFilter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonCleanEnd.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonData.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonDeathCounter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonHighlightClickedBlocks.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonMilestoneDisplay.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/damageindicator/DungeonBossDamageIndicator.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/damageindicator/DungeonBossFinder.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/damageindicator/EntityData.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/damageindicator/EntityResult.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/events/CheckRenderEntityEvent.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/events/DamageIndicatorFinalBossEvent.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/events/DungeonEnterEvent.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/events/GuiContainerEvent.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/events/GuiRenderItemEvent.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/events/LorenzActionBarEvent.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/events/LorenzChatEvent.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/events/LorenzEvent.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/events/PacketEvent.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/events/PlayerSendChatEvent.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/items/ItemDisplayOverlayFeatures.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/items/abilitycooldown/ItemAbilityCooldown.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/items/abilitycooldown/WitherImpactDetection.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/misc/ButtonOnPause.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/misc/CurrentPetDisplay.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/misc/ExpBottleOnGroundHider.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/misc/HypixelData.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/misc/ScoreboardData.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixinhooks/GuiContainerHook.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixinhooks/NetHandlerPlayClientHook.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixinhooks/NetworkManagerHook.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixinhooks/RenderItemHook.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixinhooks/RenderManagerHook.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/MixinGuiContainer.java create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/MixinNetHandlerPlayClient.java create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/MixinNetworkManager.java create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/MixinRenderItem.java create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/MixinRenderManager.java create mode 100644 src/main/java/at/hannibal2/skyhanni/test/LorenzTest.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/utils/APIUtil.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/utils/BlockUtils.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/utils/GuiRender.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/utils/ItemUtil.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/utils/ItemUtils.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/utils/LorenzColor.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/utils/LorenzDebug.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/utils/LorenzLogger.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/utils/LorenzUtils.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/utils/LorenzVec.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/utils/NumberUtil.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/utils/RenderUtils.kt delete mode 100644 src/main/java/at/lorenz/mod/LorenzMod.java delete mode 100644 src/main/java/at/lorenz/mod/bazaar/BazaarApi.kt delete mode 100644 src/main/java/at/lorenz/mod/bazaar/BazaarData.kt delete mode 100644 src/main/java/at/lorenz/mod/bazaar/BazaarDataGrabber.kt delete mode 100644 src/main/java/at/lorenz/mod/bazaar/BazaarOrderHelper.kt delete mode 100644 src/main/java/at/lorenz/mod/chat/ChatFilter.kt delete mode 100644 src/main/java/at/lorenz/mod/chat/ChatManager.kt delete mode 100644 src/main/java/at/lorenz/mod/chat/PlayerChatFilter.kt delete mode 100644 src/main/java/at/lorenz/mod/chat/PlayerMessageChannel.kt delete mode 100644 src/main/java/at/lorenz/mod/config/Features.java delete mode 100644 src/main/java/at/lorenz/mod/config/GuiTextures.java delete mode 100644 src/main/java/at/lorenz/mod/config/commands/Commands.java delete mode 100644 src/main/java/at/lorenz/mod/config/commands/SimpleCommand.java delete mode 100644 src/main/java/at/lorenz/mod/config/config/ConfigEditor.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/BackgroundBlur.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/ChromaColour.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/GlScissorStack.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/GuiElement.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/GuiElementBoolean.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/GuiElementColour.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/GuiElementTextField.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/GuiScreenElementWrapper.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/Config.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/KeybindHelper.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/Position.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/Category.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/ConfigAccordionId.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/ConfigEditorAccordion.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/ConfigEditorBoolean.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/ConfigEditorButton.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/ConfigEditorColour.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/ConfigEditorDraggableList.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/ConfigEditorDropdown.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/ConfigEditorKeybind.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/ConfigEditorSlider.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/ConfigEditorStyle.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/ConfigEditorText.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/annotations/ConfigOption.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/gui/GuiOptionEditor.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/gui/GuiOptionEditorAccordion.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/gui/GuiOptionEditorBoolean.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/gui/GuiOptionEditorButton.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/gui/GuiOptionEditorColour.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/gui/GuiOptionEditorDraggableList.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/gui/GuiOptionEditorDropdown.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/gui/GuiOptionEditorKeybind.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/gui/GuiOptionEditorSlider.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/gui/GuiOptionEditorStyle.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/gui/GuiOptionEditorText.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/gui/GuiPositionEditor.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/config/struct/ConfigProcessor.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/util/GuiElementSlider.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/util/StringUtils.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/util/lerp/LerpUtils.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/util/lerp/LerpingFloat.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/util/lerp/LerpingInteger.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/util/render/RenderUtils.java delete mode 100644 src/main/java/at/lorenz/mod/config/core/util/render/TextRenderUtils.java delete mode 100644 src/main/java/at/lorenz/mod/config/textures/TextureObject.java delete mode 100644 src/main/java/at/lorenz/mod/config/textures/Textures.java delete mode 100644 src/main/java/at/lorenz/mod/config/utils/Utils.java delete mode 100644 src/main/java/at/lorenz/mod/dungeon/DungeonBossMessages.kt delete mode 100644 src/main/java/at/lorenz/mod/dungeon/DungeonChatFilter.kt delete mode 100644 src/main/java/at/lorenz/mod/dungeon/DungeonCleanEnd.kt delete mode 100644 src/main/java/at/lorenz/mod/dungeon/DungeonData.kt delete mode 100644 src/main/java/at/lorenz/mod/dungeon/DungeonDeathCounter.kt delete mode 100644 src/main/java/at/lorenz/mod/dungeon/DungeonHighlightClickedBlocks.kt delete mode 100644 src/main/java/at/lorenz/mod/dungeon/DungeonMilestoneDisplay.kt delete mode 100644 src/main/java/at/lorenz/mod/dungeon/damageindicator/DungeonBossDamageIndicator.kt delete mode 100644 src/main/java/at/lorenz/mod/dungeon/damageindicator/DungeonBossFinder.kt delete mode 100644 src/main/java/at/lorenz/mod/dungeon/damageindicator/EntityData.kt delete mode 100644 src/main/java/at/lorenz/mod/dungeon/damageindicator/EntityResult.kt delete mode 100644 src/main/java/at/lorenz/mod/events/CheckRenderEntityEvent.kt delete mode 100644 src/main/java/at/lorenz/mod/events/DamageIndicatorFinalBossEvent.kt delete mode 100644 src/main/java/at/lorenz/mod/events/DungeonEnterEvent.kt delete mode 100644 src/main/java/at/lorenz/mod/events/GuiContainerEvent.kt delete mode 100644 src/main/java/at/lorenz/mod/events/GuiRenderItemEvent.kt delete mode 100644 src/main/java/at/lorenz/mod/events/LorenzActionBarEvent.kt delete mode 100644 src/main/java/at/lorenz/mod/events/LorenzChatEvent.kt delete mode 100644 src/main/java/at/lorenz/mod/events/LorenzEvent.kt delete mode 100644 src/main/java/at/lorenz/mod/events/PacketEvent.kt delete mode 100644 src/main/java/at/lorenz/mod/events/PlayerSendChatEvent.kt delete mode 100644 src/main/java/at/lorenz/mod/items/HideNotClickableItems.kt delete mode 100644 src/main/java/at/lorenz/mod/items/ItemDisplayOverlayFeatures.kt delete mode 100644 src/main/java/at/lorenz/mod/items/abilitycooldown/ItemAbilityCooldown.kt delete mode 100644 src/main/java/at/lorenz/mod/items/abilitycooldown/WitherImpactDetection.kt delete mode 100644 src/main/java/at/lorenz/mod/misc/ButtonOnPause.kt delete mode 100644 src/main/java/at/lorenz/mod/misc/CurrentPetDisplay.kt delete mode 100644 src/main/java/at/lorenz/mod/misc/ExpBottleOnGroundHider.kt delete mode 100644 src/main/java/at/lorenz/mod/misc/HypixelData.kt delete mode 100644 src/main/java/at/lorenz/mod/misc/ScoreboardData.kt delete mode 100644 src/main/java/at/lorenz/mod/mixinhooks/GuiContainerHook.kt delete mode 100644 src/main/java/at/lorenz/mod/mixinhooks/NetHandlerPlayClientHook.kt delete mode 100644 src/main/java/at/lorenz/mod/mixinhooks/NetworkManagerHook.kt delete mode 100644 src/main/java/at/lorenz/mod/mixinhooks/RenderItemHook.kt delete mode 100644 src/main/java/at/lorenz/mod/mixinhooks/RenderManagerHook.kt delete mode 100644 src/main/java/at/lorenz/mod/mixins/MixinGuiContainer.java delete mode 100644 src/main/java/at/lorenz/mod/mixins/MixinNetHandlerPlayClient.java delete mode 100644 src/main/java/at/lorenz/mod/mixins/MixinNetworkManager.java delete mode 100644 src/main/java/at/lorenz/mod/mixins/MixinRenderItem.java delete mode 100644 src/main/java/at/lorenz/mod/mixins/MixinRenderManager.java delete mode 100644 src/main/java/at/lorenz/mod/test/LorenzTest.kt delete mode 100644 src/main/java/at/lorenz/mod/utils/APIUtil.kt delete mode 100644 src/main/java/at/lorenz/mod/utils/BlockUtils.kt delete mode 100644 src/main/java/at/lorenz/mod/utils/GuiRender.kt delete mode 100644 src/main/java/at/lorenz/mod/utils/ItemUtil.kt delete mode 100644 src/main/java/at/lorenz/mod/utils/ItemUtils.kt delete mode 100644 src/main/java/at/lorenz/mod/utils/LorenzColor.kt delete mode 100644 src/main/java/at/lorenz/mod/utils/LorenzDebug.kt delete mode 100644 src/main/java/at/lorenz/mod/utils/LorenzLogger.kt delete mode 100644 src/main/java/at/lorenz/mod/utils/LorenzUtils.kt delete mode 100644 src/main/java/at/lorenz/mod/utils/LorenzVec.kt delete mode 100644 src/main/java/at/lorenz/mod/utils/NumberUtil.kt delete mode 100644 src/main/java/at/lorenz/mod/utils/RenderUtils.kt (limited to 'src/main/java') diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java new file mode 100644 index 000000000..09355383c --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -0,0 +1,119 @@ +package at.hannibal2.skyhanni; + +import at.hannibal2.skyhanni.bazaar.BazaarApi; +import at.hannibal2.skyhanni.bazaar.BazaarOrderHelper; +import at.hannibal2.skyhanni.chat.ChatFilter; +import at.hannibal2.skyhanni.chat.ChatManager; +import at.hannibal2.skyhanni.chat.PlayerChatFilter; +import at.hannibal2.skyhanni.config.Features; +import at.hannibal2.skyhanni.config.commands.Commands; +import at.hannibal2.skyhanni.dungeon.*; +import at.hannibal2.skyhanni.dungeon.damageindicator.DungeonBossDamageIndicator; +import at.hannibal2.skyhanni.items.HideNotClickableItems; +import at.hannibal2.skyhanni.items.ItemDisplayOverlayFeatures; +import at.hannibal2.skyhanni.items.abilitycooldown.ItemAbilityCooldown; +import at.hannibal2.skyhanni.misc.*; +import at.hannibal2.skyhanni.test.LorenzTest; +import com.google.gson.Gson; +import com.google.gson.GsonBuilder; +import java.io.*; +import java.nio.charset.StandardCharsets; +import net.minecraft.client.Minecraft; +import net.minecraft.client.gui.GuiScreen; +import net.minecraftforge.common.MinecraftForge; +import net.minecraftforge.fml.common.Mod; +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; + +@Mod(modid = SkyHanniMod.MODID, version = SkyHanniMod.VERSION) +public class SkyHanniMod { + + public static final String MODID = "skyhanni"; + public static final String VERSION = "0."; + + public static Features feature; + private File configFile; + + private final Gson gson = new GsonBuilder().setPrettyPrinting().excludeFieldsWithoutExposeAnnotation().create(); + + public static File configDirectory; + + @EventHandler + public void preInit(FMLPreInitializationEvent event) { + new BazaarApi(); + MinecraftForge.EVENT_BUS.register(this); + MinecraftForge.EVENT_BUS.register(new ChatManager()); + MinecraftForge.EVENT_BUS.register(new HypixelData()); + MinecraftForge.EVENT_BUS.register(new DungeonData()); + MinecraftForge.EVENT_BUS.register(new ScoreboardData()); + + MinecraftForge.EVENT_BUS.register(new BazaarOrderHelper()); + MinecraftForge.EVENT_BUS.register(new ChatFilter()); + MinecraftForge.EVENT_BUS.register(new PlayerChatFilter()); + MinecraftForge.EVENT_BUS.register(new DungeonChatFilter()); + MinecraftForge.EVENT_BUS.register(new HideNotClickableItems()); + MinecraftForge.EVENT_BUS.register(new DungeonHighlightClickedBlocks()); + MinecraftForge.EVENT_BUS.register(new ItemDisplayOverlayFeatures()); + MinecraftForge.EVENT_BUS.register(new CurrentPetDisplay()); + MinecraftForge.EVENT_BUS.register(new ExpBottleOnGroundHider()); + MinecraftForge.EVENT_BUS.register(new DungeonBossDamageIndicator()); + MinecraftForge.EVENT_BUS.register(new ItemAbilityCooldown()); + MinecraftForge.EVENT_BUS.register(new DungeonMilestoneDisplay()); + MinecraftForge.EVENT_BUS.register(new DungeonDeathCounter()); + MinecraftForge.EVENT_BUS.register(new DungeonCleanEnd()); + MinecraftForge.EVENT_BUS.register(new DungeonBossMessages()); + + Commands.init(); + + MinecraftForge.EVENT_BUS.register(new LorenzTest()); + MinecraftForge.EVENT_BUS.register(new ButtonOnPause()); + + configDirectory = new File("mods/SkyHanni/config"); + try { + //noinspection ResultOfMethodCallIgnored + configDirectory.mkdir(); + } catch (Exception ignored) {} + + configFile = new File(configDirectory, "config.json"); + + if (configFile.exists()) { + try (BufferedReader reader = new BufferedReader(new InputStreamReader(new FileInputStream(configFile), StandardCharsets.UTF_8))) { + feature = gson.fromJson(reader, Features.class); + } catch (Exception ignored) {} + } + + if (feature == null) { + feature = new Features(); + saveConfig(); + } + Runtime.getRuntime().addShutdownHook(new Thread(this::saveConfig)); + } + + public void saveConfig() { + try { + //noinspection ResultOfMethodCallIgnored + configFile.createNewFile(); + + try (BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(new FileOutputStream(configFile), StandardCharsets.UTF_8))) { + writer.write(gson.toJson(feature)); + } + } catch (IOException ignored) {} + } + + public static GuiScreen screenToOpen = null; + private static int screenTicks = 0; + + @SubscribeEvent + public void onClientTick(TickEvent.ClientTickEvent event) { + if (screenToOpen != null) { + screenTicks++; + if (screenTicks == 5) { + Minecraft.getMinecraft().displayGuiScreen(screenToOpen); + screenTicks = 0; + screenToOpen = null; + } + } + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarApi.kt new file mode 100644 index 000000000..cbebe951c --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarApi.kt @@ -0,0 +1,59 @@ +package at.hannibal2.skyhanni.bazaar + +import at.hannibal2.skyhanni.utils.LorenzUtils + +class BazaarApi { + + companion object { + private val bazaarMap = mutableMapOf() + + fun isBazaarInventory(inventoryName: String): Boolean { + if (inventoryName.contains(" ➜ ") && !inventoryName.contains("Museum")) return true + if (BazaarOrderHelper.isBazaarOrderInventory(inventoryName)) return true + + return when (inventoryName) { + "Your Bazaar Orders" -> true + "How many do you want?" -> true + "How much do you want to pay?" -> true + "Confirm Buy Order" -> true + "Confirm Instant Buy" -> true + "At what price are you selling?" -> true + "Confirm Sell Offer" -> true + "Order options" -> true + + else -> false + } + } + + fun getCleanBazaarName(name: String): String { + if (name.endsWith(" Gemstone")) { + return name.substring(6) + } + if (name.startsWith("§")) { + return name.substring(2) + } + + return name + } + + fun getBazaarDataForName(name: String): BazaarData { + if (bazaarMap.containsKey(name)) { + val bazaarData = bazaarMap[name] + if (bazaarData != null) { + return bazaarData + } + LorenzUtils.error("Bazaar data is null for item '$name'") + } + throw Error("no bz data found for name '$name'") + } + + fun isBazaarItem(name: String): Boolean { + val bazaarName = getCleanBazaarName(name) + return bazaarMap.containsKey(bazaarName) + } + } + + init { + BazaarDataGrabber(bazaarMap).start() + } +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarData.kt b/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarData.kt new file mode 100644 index 000000000..01300e67c --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarData.kt @@ -0,0 +1,3 @@ +package at.hannibal2.skyhanni.bazaar + +data class BazaarData(val apiName: String, val itemName: String, val sellPrice: Double, val buyPrice: Double) \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarDataGrabber.kt b/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarDataGrabber.kt new file mode 100644 index 000000000..1f2f1171a --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarDataGrabber.kt @@ -0,0 +1,113 @@ +package at.hannibal2.skyhanni.bazaar + +import at.hannibal2.skyhanni.utils.APIUtil +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.round +import kotlin.concurrent.fixedRateTimer + +internal class BazaarDataGrabber(private var bazaarMap: MutableMap) { + + companion object { + private val itemNames = mutableMapOf() + + private var lastData = "" + var lastTime = 0L + var blockNoChange = false + var currentlyUpdating = false + } + + private fun loadItemNames(): Boolean { + currentlyUpdating = true + try { + val itemsData = APIUtil.getJSONResponse("https://api.hypixel.net/resources/skyblock/items") + for (element in itemsData["items"].asJsonArray) { + val jsonObject = element.asJsonObject + val name = jsonObject["name"].asString + val id = jsonObject["id"].asString + itemNames[id] = name + } + currentlyUpdating = false + return true + } catch (e: Throwable) { + e.printStackTrace() + LorenzUtils.error("Error while trying to read bazaar item list from api: " + e.message) + currentlyUpdating = false + return false + } + } + + fun start() { + fixedRateTimer(name = "skyhanni-bazaar-update", period = 1000L) { + if (!LorenzUtils.inSkyblock) { + return@fixedRateTimer + } + + if (currentlyUpdating) { + LorenzUtils.error("Bazaar update took too long! Error?") + return@fixedRateTimer + } + + if (itemNames.isEmpty()) { + if (!loadItemNames()) { + return@fixedRateTimer + } + } + checkIfUpdateNeeded() + } + } + + private fun checkIfUpdateNeeded() { + if (lastData != "") { + if (System.currentTimeMillis() - lastTime > 9_000) { + blockNoChange = true + } else { + if (blockNoChange) { + return + } + } + } + + currentlyUpdating = true + updateBazaarData() + currentlyUpdating = false + } + + private fun updateBazaarData() { + val bazaarData = APIUtil.getJSONResponse("https://api.hypixel.net/skyblock/bazaar") + if (bazaarData.toString() != lastData) { + lastData = bazaarData.toString() + lastTime = System.currentTimeMillis() + } + + val products = bazaarData["products"].asJsonObject + + for (entry in products.entrySet()) { + val apiName = entry.key + + if (apiName == "ENCHANTED_CARROT_ON_A_STICK") continue + if (apiName == "BAZAAR_COOKIE") continue + + val itemData = entry.value.asJsonObject + + val itemName = itemNames.getOrDefault(apiName, null) + if (itemName == null) { + LorenzUtils.error("Bazaar item name is null for '$apiName'! Restart to fix this problem!") + continue + } + + val sellPrice: Double = try { + itemData["sell_summary"].asJsonArray[0].asJsonObject["pricePerUnit"].asDouble.round(1) + } catch (e: Exception) { + 0.0 + } + val buyPrice: Double = try { + itemData["buy_summary"].asJsonArray[0].asJsonObject["pricePerUnit"].asDouble.round(1) + } catch (e: Exception) { + 0.0 + } + + val data = BazaarData(apiName, itemName, sellPrice, buyPrice) + bazaarMap[itemName] = data + } + } +} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarOrderHelper.kt b/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarOrderHelper.kt new file mode 100644 index 000000000..eec055253 --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarOrderHelper.kt @@ -0,0 +1,87 @@ +package at.hannibal2.skyhanni.bazaar + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.GuiContainerEvent +import at.hannibal2.skyhanni.utils.ItemUtils.getLore +import at.hannibal2.skyhanni.utils.LorenzColor +import at.hannibal2.skyhanni.utils.RenderUtils.highlight +import net.minecraft.client.gui.inventory.GuiChest +import net.minecraft.client.renderer.GlStateManager +import net.minecraft.inventory.ContainerChest +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent +import org.lwjgl.opengl.GL11 + +class BazaarOrderHelper { + + companion object { + fun isBazaarOrderInventory(inventoryName: String): Boolean = when (inventoryName) { + "Your Bazaar Orders" -> true + "Co-op Bazaar Orders" -> true + else -> false + } + } + + @SubscribeEvent + fun onBackgroundDrawn(event: GuiContainerEvent.BackgroundDrawnEvent) { + if (!SkyHanniMod.feature.bazaar.orderHelper) return + if (event.gui !is GuiChest) return + val guiChest = event.gui + val chest = guiChest.inventorySlots as ContainerChest + val inventoryName = chest.lowerChestInventory.displayName.unformattedText.trim() + + if (!isBazaarOrderInventory(inventoryName)) return + val lightingState = GL11.glIsEnabled(GL11.GL_LIGHTING) + GlStateManager.disableLighting() + GlStateManager.color(1f, 1f, 1f, 1f) + + out@ for (slot in chest.inventorySlots) { + if (slot == null) continue + if (slot.slotNumber != slot.slotIndex) continue + if (slot.stack == null) continue + + val stack = slot.stack + val displayName = stack.displayName + val isSelling = displayName.startsWith("§6§lSELL§7: ") + val isBuying = displayName.startsWith("§a§lBUY§7: ") + if (!isSelling && !isBuying) continue + + val text = displayName.split("§7: ")[1] + val name = BazaarApi.getCleanBazaarName(text) + val data = BazaarApi.getBazaarDataForName(name) + val buyPrice = data.buyPrice + val sellPrice = data.sellPrice + + val itemLore = stack.getLore() + for (line in itemLore) { + if (line.startsWith("§7Filled:")) { + if (line.endsWith(" §a§l100%!")) { + slot highlight LorenzColor.GREEN + continue@out + } + } + } + for (line in itemLore) { + if (line.startsWith("§7Price per unit:")) { + var text = line.split(": §6")[1] + text = text.substring(0, text.length - 6) + text = text.replace(",", "") + val price = text.toDouble() + if (isSelling) { + if (buyPrice < price) { + slot highlight LorenzColor.GOLD + continue@out + } + } else { + if (sellPrice > price) { + slot highlight LorenzColor.GOLD + continue@out + } + } + + } + } + } + + if (lightingState) GlStateManager.enableLighting() + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/chat/ChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/chat/ChatFilter.kt new file mode 100644 index 000000000..fc245405c --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/chat/ChatFilter.kt @@ -0,0 +1,284 @@ +package at.hannibal2.skyhanni.chat + +import at.hannibal2.skyhanni.SkyHanniMod +import at.hannibal2.skyhanni.events.LorenzChatEvent +import at.hannibal2.skyhanni.utils.LorenzUtils +import at.hannibal2.skyhanni.utils.LorenzUtils.matchRegex +import net.minecraftforge.fml.common.eventhandler.SubscribeEvent + +class ChatFilter { + + @SubscribeEvent + fun onChatMessage(event: LorenzChatEvent) { + if (!LorenzUtils.isOnHypixel) return + + val blockReason = block(event.message) + if (blockReason != "") { + event.blockedReason = blockReason + } + } + + private fun block(message: String): String = when { + message.startsWith("§aYou are playing on profile: §e") -> "profile"//TODO move into own class + lobby(message) && SkyHanniMod.feature.chat.hypixelHub -> "lobby" + empty(message) && SkyHanniMod.feature.chat.empty -> "empty" + warping(message) && SkyHanniMod.feature.chat.warping -> "warping" + welcome(message) && SkyHanniMod.feature.chat.welcome -> "welcome" + guild(message) && SkyHanniMod.feature.chat.others -> "guild" + killCombo(message) && SkyHanniMod.feature.chat.others -> "kill_combo" + bazaarAndAHMiniMessages(message) && SkyHanniMod.feature.chat.others -> "bz_ah_minis" + watchdogAnnouncement(message) && SkyHanniMod.feature.chat.others -> "watchdog" + slayer(message) && SkyHanniMod.feature.chat.others -> "slayer" + slayerDrop(message) && SkyHanniMod.feature.chat.others -> "slayer_drop" + uselessDrop(message) && SkyHanniMod.feature.chat.others -> "useless_drop" + uselessNotification(message) && SkyHanniMod.feature.chat.others -> "useless_notification" + party(message) && SkyHanniMod.feature.chat.others -> "party" + money(message) && SkyHanniMod.feature.chat.others -> "money" + winterIsland(message) && SkyHanniMod.feature.chat.others -> "winter_island" + uselessWarning(message) && SkyHanniMod.feature.chat.others -> "useless_warning" + friendJoin(message) && SkyHanniMod.feature.chat.others -> "friend_join" + + + + + else -> "" + } + + private fun friendJoin(message: String): Boolean { + return when { + message.matchRegex("§aFriend > §r(.*) §r§e(joined|left).") -> { + true + } + else -> false + } + + } + + private fun uselessNotification(message: String): Boolean { + return when { + message == "§eYour previous §r§6Plasmaflux Power Orb §r§ewas removed!" -> true + + message == "§aYou used your §r§6Mining Speed Boost §r§aPickaxe Ability!" -> true + message == "§cYour Mining Speed Boost has expired!" -> true + message == "§a§r§6Mining Speed Boost §r§ais now available!" -> true + + else -> false + } + } + + private fun uselessWarning(message: String): Boolean = when { + message == "§cYou are sending commands too fast! Please slow down." -> true//TODO prevent in the future + message == "§cYou can't use this while in combat!" -> true + message == "§cYou can not modify your equipped armor set!" -> true + message == "§cPlease wait a few seconds between refreshing!" -> true + message == "§cThis item is not salvageable!" -> true//prevent in the future + message == "§cPlace a Dungeon weapon or armor piece above the anvil to salvage it!" -> true + message == "§cWhoa! Slow down there!" -> true + message == "§cWait a moment before confirming!" -> true + message == "§cYou need to be out of combat for 3 seconds before opening the SkyBlock Menu!" -> true//TODO prevent in the future + + else -> false + } + + private fun uselessDrop(message: String): Boolean { + when { + message.matchRegex("§6§lRARE DROP! §r§aEnchanted Ender Pearl (.*)") -> return true + + message.matchRegex("§6§lRARE DROP! §r§fCarrot (.*)") -> return true + message.matchRegex("§6§lRARE DROP! §r§fPotato (.*)") -> return true + + message.matchRegex("§6§lRARE DROP! §r§9Machine Gun Bow (.*)") -> return true + message.matchRegex("§6§lRARE DROP! §r§5Earth Shard (.*)") -> return true + message.matchRegex("§6§lRARE DROP! §r§5Zombie Lord Chestplate (.*)") -> return true + } + + return false + } + + private fun winterIsland(message: String): Boolean = when { + message.matchRegex(" §r§f☃ §r§7§r(.*) §r§7mounted a §r§fSnow Cannon§r§7!") -> true + + else -> false + } + + private fun money(message: String): Boolean { + if (isBazaar(message)) return true + if (isAuctionHouse(message)) return true + + return false + } + + private fun isAuctionHouse(message: String): Boolean { + if (message == "§b-----------------------------------------------------") return true + if (message == "§eVisit the Auction House to collect your item!") return true + + return false + } + + private fun isBazaar(message: String): Boolean { + if (message.matchRegex("§eBuy Order Setup! §r§a(.*)§r§7x (.*) §r§7for §r§6(.*) coins§r§7.")) return true + if (message.matchRegex("§eSell Offer Setup! §r§a(.*)§r§7x (.*) §r§7for §r§6(.*) coins§r§7.")) return true + if (message.matchRegex("§cCancelled! §r§7Refunded §r§6(.*) coins §r§7from cancelling buy order!")) return true + if (message.matchRegex("§cCancelled! §r§7Refunded §r§a(.*)§r§7x (.*) §r§7from cancelling sell offer!")) return true + + return false + } + + private fun party(message: String): Boolean { + if (message == "§9§m-----------------------------") return true + if (message == "§9§m-----------------------------------------------------") return true + + return false + } + + private fun slayerDrop(message: String): Boolean { + //Revenant + if (message.matchRegex("§b§lRARE DROP! §r§7\\(§r§f§r§9Revenant Viscera§r§7\\) (.*)")) return true + if (message.matchRegex("§b§lRARE DROP! §r§7\\(§r§f§r§7(.*)x §r§f§r§9Foul Flesh§r§7\\) (.*)")) return true + if (message.matchRegex("§b§lRARE DROP! §r§7\\(§r§f§r§9Foul Flesh§r§7\\) (.*)")) return true + if (message.matchRegex("§6§lRARE DROP! §r§5Golden Powder (.*)")) return true + if (message.matchRegex("§9§lVERY RARE DROP! §r§7\\(§r§f§r§2(.*) Pestilence Rune I§r§7\\) (.*)")) { + LorenzUtils.debug("check regex for this blocked message!") + return true + } + if (message.matchRegex("§5§lVERY RARE DROP! §r§7\\(§r§f§r§5Revenant Catalyst§r§7\\) (.*)")) return true + if (message.matchRegex("§5§lVERY RARE DROP! §r§7\\(§r§f§r§9Undead Catalyst§r§7\\) (.*)")) return true + + //Enderman + if (message.matchRegex("§b§lRARE DROP! §r§7\\(§r§f§r§7(.*)x §r§f§r§aTwilight Arrow Poison§r§7\\) (.*)")) return true + if (message.matchRegex("§9§lVERY RARE DROP! §r§7\\(§r§fMana Steal I§r§7\\) (.*)")) return true + if (message.matchRegex("§5§lVERY RARE DROP! §r§7\\(§r§f§r§5Sinful Dice§r§7\\) (.*)")) return true + if (message.matchRegex("§9§lVERY RARE DROP! §r§7\\(§r§f§r§9Null Atom§r§7\\) (.*)")) return true + if (message.matchRegex("§9§lVERY RARE DROP! §r§7\\(§r§f§r§5Transmission Tuner§r§7\\) (.*)")) return true + if (message.matchRegex("§9§lVERY RARE DROP! §r§7\\(§r§fMana Steal I§r§7\\) (.*)")) return true + if (message.matchRegex("§9§lVERY RARE DROP! §r§7\\(§r§f§r§5◆ Endersnake Rune I§r§7\\) (.*)")) return true + if (message.matchRegex("§d§lCRAZY RARE DROP! §r§7\\(§r§f§r§fPocket Espresso Machine§r§7\\) (.*)")) return true + if (message.matchRegex("§5§lVERY RARE DROP! §r§7\\(§r§f§r§5◆ End Rune I§r§7\\) (.*)")) return true + + return false + } + + private fun slayer(message: String): Boolean { + //start + if (message.matchRegex(" §r§5§lSLAYER QUEST STARTED!")) return true + if (message.matchRegex(" §5§l» §7Slay §c(.*) Combat XP §7worth of (.*)§7.")) return true + + //end + if (message.matchRegex(" §r§a§lSLAYER QUEST COMPLETE!")) return true + if (message == " §r§6§lNICE! SLAYER BOSS SLAIN!") return true + if (message.matchRegex(" §r§e(.*)Slayer LVL 9 §r§5- §r§a§lLVL MAXED OUT!")) return true + if (message.matchRegex(" §r§5§l» §r§7Talk to Maddox to claim your (.*) Slayer XP!")) return true + + + if (message == "§eYou received kill credit for assisting on a slayer miniboss!") return true + + if (message == "§e✆ Ring... ") return true + if (message == "§e✆ Ring... Ring... ") return true + if (message == "§e✆ Ring... Ring... Ring... ") return true + + return false + } + + private fun watchdogAnnouncement(message: String): Boolean = when { + message == "§4[WATCHDOG ANNOUNCEMENT]" -> true + message.matchRegex("§fWatchdog has banned §r§c§l(.*)§r§f players in the last 7 days.") -> true + message.matchRegex("§fStaff have banned an additional §r§c§l(.*)§r§f in the last 7 days.") -> true + message == "§cBlacklisted modifications are a bannable offense!" -> true + else -> false + } + + private fun bazaarAndAHMiniMessages(message: String): Boolean = when (message) { + "§7Putting item in escrow...", + "§7Putting goods in escrow...", + "§7Putting coins in escrow...", + + //Auction House + "§7Setting up the auction...", + "§7Processing purchase...", + "§7Claiming order...", + "§7Processing bid...", + "§7Claiming BIN auction...", + + //Bazaar + "§7Submitting sell offer...", + "§7Submitting buy order...", + "§7Executing instant sell...", + "§7Executing instant buy...", + + //Bank + "§8Depositing coins...", + "§8Withdrawing coins..." -> true + else -> false + } + + private fun killCombo(message: String): Boolean { + //§a§l+5 Kill Combo §r§8+§r§b3% §r§b? Magic Find + return when { + message.matchRegex("§.§l\\+(.*) Kill Combo §r§8\\+(.*)") -> true + message.matchRegex("§cYour Kill Combo has expired! You reached a (.*) Kill Combo!") -> true + else -> false + } + } + + private fun lobby(message: String): Boolean = when { + //player join + message.matchRegex("(.*) §6joined the lobby!") -> true + message.matchRegex(" §b>§c>§a>§r (.*) §6joined the lobby!§r §a<§c<§b<") -> true + + //mystery box + message.matchRegex("§b✦ §r(.*) §r§7found a §r§e(.*) §r§bMystery Box§r§7!") -> true + message.matchRegex("§b✦ §r(.*) §r§7found (a|an) §r(.*) §r§7in a §r§aMystery Box§r§7!") -> true + + //prototype + message.contains("§r§6§lWelcome to the Prototype Lobby§r") -> true + message == " §r§f§l➤ §r§6You have reached your Hype limit! Add Hype to Prototype Lobby minigames by right-clicking with the Hype Diamond!" -> true + + //hypixel tournament notifications + message.contains("§r§e§6§lHYPIXEL§e is hosting a §b§lBED WARS DOUBLES§e tournament!") -> true + message.contains("§r§e§6§lHYPIXEL BED WARS DOUBLES§e tournament is live!") -> true + + //other + message.contains("§aYou are still radiating with §bGenerosity§r§a!") -> true + else -> false + } + + private fun guild(message: String): Boolean = when { + message.matchRegex("§2Guild > (.*) §r§e(joined|left).") -> true + message.matchRegex("§aYou earned §r§2(.*) GEXP §r§afrom playing SkyBlock!") -> true + message.matchRegex("§aYou earned §r§2(.*) GEXP §r§a\\+ §r§e(.*) Event EXP §r§afrom playing SkyBlock!") -> true + message == "§b§m-----------------------------------------------------" -> true + else -> false + } + + private fun welcome(message: String): Boolean = message == "§eWelcome to §r§aHypixel SkyBlock§r§e!" + + private fun warping(message: String): Boolean = when { + message.matchRegex("§7Sending to server (.*)\\.\\.\\.") -> true + message.matchRegex("§7Request join for Hub (.*)\\.\\.\\.") -> true + message.matchRegex("§7Request join for Dungeon Hub #(.*)\\.\\.\\.") -> true + message == "§7Warping..." -> true + message == "§7Warping you to your SkyBlock island..." -> true + message == "§7Warping using transfer token..." -> true + + //visiting other players + message == "§7Finding player..." -> true + message == "§7Sending a visit request..." -> true + + //warp portals on public islands (canvas room - flower house, election room - community center, void sepulture - the end) + message.matchRegex("§dWarped to (.*)§r§d!") -> true + else -> false + } + + private fun empty(message: String): Boolean = when (message) { + "§8 §r§8 §r§1 §r§3 §r§3 §r§7 §r§8 ", + + "§f §r§f §r§1 §r§0 §r§2 §r§4§r§f §r§f §r§2 §r§0 §r§4 §r§8§r§0§r§1§r§0§r§1§r§2§r§f§r§f§r§0§r§1§r§3§r§4§r§f§r§f§r§0§r§1§r§5§r§f§r§f§r§0§r§1§r§6§r§f§r§f§r§0§r§1§r§8§r§9§r§a§r§b§r§f§r§f§r§0§r§1§r§7§r§f§r§f§r§3 §r§9 §r§2 §r§0 §r§0 §r§1§r§3 §r§9 §r§2 §r§0 §r§0 §r§2§r§3 §r§9 §r§2 §r§0 §r§0 §r§3§r§0§r§0§r§1§r§f§r§e§r§0§r§0§r§2§r§f§r§e§r§0§r§0§r§3§r§4§r§5§r§6§r§7§r§8§r§f§r§e§r§3 §r§6 §r§3 §r§6 §r§3 §r§6 §r§e§r§3 §r§6 §r§3 §r§6 §r§3 §r§6 §r§d", + + "§f §r§r§r§f §r§r§r§1 §r§r§r§0 §r§r§r§2 §r§r§r§f §r§r§r§f §r§r§r§2 §r§r§r§0 §r§r§r§4 §r§r§r§3 §r§r§r§9 §r§r§r§2 §r§r§r§0 §r§r§r§0 §r§r§r§3 §r§r§r§9 §r§r§r§2 §r§r§r§0 §r§r§r§0 §r§r§r§3 §r§r§r§9 §r§r§r§2 §r§r§r§0 §r§r§r§0 ", + + "", + "§f", + "§c" -> true + else -> false + } +} diff --git a/src/main/java/at/hannibal2/skyhanni/chat/ChatManager.kt b/src/main/java/at/hannibal2/skyhanni/chat/ChatManager.kt new file mode 100644 index 000000000..c189caa3d --- /dev/null +++ b/src/main/java/at/hannibal2/skyhanni/chat/ChatManager.kt @@ -0,0 +1,51 @@ +package at.ha