From efbf06263d6fbf5de5a815fe5583ddd02710470f Mon Sep 17 00:00:00 2001 From: Lorenz Date: Wed, 17 Aug 2022 03:05:34 +0200 Subject: moving packets around --- .../at/hannibal2/skyhanni/ItemRenderBackground.kt | 47 -- .../java/at/hannibal2/skyhanni/SkyHanniMod.java | 47 +- .../java/at/hannibal2/skyhanni/bazaar/BazaarApi.kt | 59 --- .../skyhanni/bazaar/BazaarBestSellMethod.kt | 79 --- .../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 | 301 ----------- .../java/at/hannibal2/skyhanni/chat/ChatManager.kt | 51 -- .../at/hannibal2/skyhanni/chat/NewChatFilter.kt | 18 - .../at/hannibal2/skyhanni/chat/PlayerChatFilter.kt | 90 ---- .../skyhanni/chat/PlayerMessageChannel.kt | 10 - .../skyhanni/damageindicator/BossFinder.kt | 569 --------------------- .../hannibal2/skyhanni/damageindicator/BossType.kt | 70 --- .../skyhanni/damageindicator/DamageCounter.kt | 10 - .../damageindicator/DamageIndicatorManager.kt | 544 -------------------- .../skyhanni/damageindicator/EntityData.kt | 22 - .../skyhanni/damageindicator/EntityResult.kt | 8 - .../skyhanni/damageindicator/OldDamage.kt | 4 - .../java/at/hannibal2/skyhanni/data/ApiData.kt | 90 ++++ .../java/at/hannibal2/skyhanni/data/HypixelData.kt | 106 ++++ .../skyhanni/data/ItemRenderBackground.kt | 47 ++ .../at/hannibal2/skyhanni/data/ScoreboardData.kt | 48 ++ .../at/hannibal2/skyhanni/data/repo/RepoManager.kt | 172 +++++++ .../at/hannibal2/skyhanni/data/repo/RepoUtils.kt | 102 ++++ .../skyhanni/diana/GriffinBurrowFinder.kt | 159 ------ .../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 ---- .../skyhanni/events/PlayerSendChatEvent.kt | 2 +- .../skyhanni/events/RepositoryReloadEvent.kt | 2 +- .../hannibal2/skyhanni/features/ButtonOnPause.kt | 51 ++ .../skyhanni/features/CurrentPetDisplay.kt | 47 ++ .../skyhanni/features/ExpBottleOnGroundHider.kt | 19 + .../skyhanni/features/SummoningSoulsName.kt | 135 +++++ .../skyhanni/features/anvil/AnvilCombineHelper.kt | 82 +++ .../skyhanni/features/bazaar/BazaarApi.kt | 59 +++ .../features/bazaar/BazaarBestSellMethod.kt | 79 +++ .../skyhanni/features/bazaar/BazaarData.kt | 3 + .../skyhanni/features/bazaar/BazaarDataGrabber.kt | 113 ++++ .../skyhanni/features/bazaar/BazaarOrderHelper.kt | 87 ++++ .../hannibal2/skyhanni/features/chat/ChatFilter.kt | 301 +++++++++++ .../skyhanni/features/chat/ChatManager.kt | 51 ++ .../skyhanni/features/chat/NewChatFilter.kt | 18 + .../skyhanni/features/chat/PlayerChatFilter.kt | 90 ++++ .../skyhanni/features/chat/PlayerMessageChannel.kt | 10 + .../features/damageindicator/BossFinder.kt | 569 +++++++++++++++++++++ .../skyhanni/features/damageindicator/BossType.kt | 70 +++ .../features/damageindicator/DamageCounter.kt | 10 + .../damageindicator/DamageIndicatorManager.kt | 544 ++++++++++++++++++++ .../features/damageindicator/EntityData.kt | 22 + .../features/damageindicator/EntityResult.kt | 8 + .../skyhanni/features/damageindicator/OldDamage.kt | 4 + .../skyhanni/features/diana/GriffinBurrowFinder.kt | 159 ++++++ .../features/dungeon/DungeonBossMessages.kt | 51 ++ .../skyhanni/features/dungeon/DungeonChatFilter.kt | 224 ++++++++ .../skyhanni/features/dungeon/DungeonCleanEnd.kt | 130 +++++ .../skyhanni/features/dungeon/DungeonData.kt | 46 ++ .../features/dungeon/DungeonDeathCounter.kt | 97 ++++ .../dungeon/DungeonHighlightClickedBlocks.kt | 99 ++++ .../features/dungeon/DungeonMilestoneDisplay.kt | 96 ++++ .../skyhanni/features/fishing/SeaCreature.kt | 18 + .../features/fishing/SeaCreatureManager.kt | 64 +++ .../fishing/SeaCreatureMessageShortener.kt | 24 + .../features/fishing/TrophyFishMessages.kt | 71 +++ .../features/items/HideNotClickableItems.kt | 416 +++++++++++++++ .../features/items/ItemDisplayOverlayFeatures.kt | 121 +++++ .../skyhanni/features/items/VanillaItemManager.kt | 53 ++ .../items/abilitycooldown/ItemAbilityCooldown.kt | 215 ++++++++ .../items/abilitycooldown/WitherImpactDetection.kt | 74 +++ .../nether/ashfang/AshfangFreezeCooldown.kt | 43 ++ .../nether/ashfang/AshfangNextResetCooldown.kt | 53 ++ .../at/hannibal2/skyhanni/fishing/SeaCreature.kt | 18 - .../skyhanni/fishing/SeaCreatureManager.kt | 64 --- .../fishing/SeaCreatureMessageShortener.kt | 24 - .../skyhanni/fishing/TrophyFishMessages.kt | 71 --- .../skyhanni/inventory/anvil/AnvilCombineHelper.kt | 83 --- .../skyhanni/items/HideNotClickableItems.kt | 416 --------------- .../skyhanni/items/ItemDisplayOverlayFeatures.kt | 121 ----- .../hannibal2/skyhanni/items/VanillaItemManager.kt | 54 -- .../items/abilitycooldown/ItemAbilityCooldown.kt | 215 -------- .../items/abilitycooldown/WitherImpactDetection.kt | 74 --- .../java/at/hannibal2/skyhanni/misc/ApiData.kt | 90 ---- .../at/hannibal2/skyhanni/misc/ButtonOnPause.kt | 51 -- .../hannibal2/skyhanni/misc/CurrentPetDisplay.kt | 47 -- .../skyhanni/misc/ExpBottleOnGroundHider.kt | 19 - .../java/at/hannibal2/skyhanni/misc/HypixelData.kt | 106 ---- .../at/hannibal2/skyhanni/misc/ScoreboardData.kt | 48 -- .../hannibal2/skyhanni/misc/SummoningSoulsName.kt | 135 ----- .../misc/nether/ashfang/AshfangFreezeCooldown.kt | 43 -- .../nether/ashfang/AshfangNextResetCooldown.kt | 53 -- .../skyhanni/mixinhooks/GuiContainerHook.kt | 61 --- .../mixinhooks/NetHandlerPlayClientHook.kt | 9 - .../skyhanni/mixinhooks/NetworkManagerHook.kt | 10 - .../skyhanni/mixinhooks/RenderItemHook.kt | 33 -- .../skyhanni/mixinhooks/RenderManagerHook.kt | 25 - .../render/BlockRendererDispatcherHook.kt | 25 - .../skyhanni/mixins/hooks/GuiContainerHook.kt | 61 +++ .../mixins/hooks/NetHandlerPlayClientHook.kt | 9 + .../skyhanni/mixins/hooks/NetworkManagerHook.kt | 10 + .../skyhanni/mixins/hooks/RenderItemHook.kt | 33 ++ .../skyhanni/mixins/hooks/RenderManagerHook.kt | 25 + .../hooks/render/BlockRendererDispatcherHook.kt | 25 + .../transformers/MixinNetHandlerPlayClient.java | 2 +- .../mixins/transformers/MixinNetworkManager.java | 2 +- .../mixins/transformers/MixinRenderItem.java | 2 +- .../mixins/transformers/MixinRenderManager.java | 2 +- .../mixins/transformers/gui/MixinGuiContainer.java | 2 +- .../java/at/hannibal2/skyhanni/repo/RepoManager.kt | 172 ------- .../java/at/hannibal2/skyhanni/repo/RepoUtils.kt | 102 ---- .../at/hannibal2/skyhanni/utils/LorenzUtils.kt | 2 +- 115 files changed, 5189 insertions(+), 5184 deletions(-) delete mode 100644 src/main/java/at/hannibal2/skyhanni/ItemRenderBackground.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/bazaar/BazaarApi.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/bazaar/BazaarBestSellMethod.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/bazaar/BazaarData.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/bazaar/BazaarDataGrabber.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/bazaar/BazaarOrderHelper.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/chat/ChatFilter.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/chat/ChatManager.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/chat/NewChatFilter.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/chat/PlayerChatFilter.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/chat/PlayerMessageChannel.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/damageindicator/BossFinder.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/damageindicator/BossType.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/damageindicator/DamageCounter.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/damageindicator/DamageIndicatorManager.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/damageindicator/EntityData.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/damageindicator/EntityResult.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/damageindicator/OldDamage.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/data/ApiData.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/data/HypixelData.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/data/ItemRenderBackground.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/data/ScoreboardData.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/data/repo/RepoManager.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/data/repo/RepoUtils.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/diana/GriffinBurrowFinder.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonBossMessages.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonChatFilter.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonCleanEnd.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonData.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonDeathCounter.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonHighlightClickedBlocks.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/dungeon/DungeonMilestoneDisplay.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/ButtonOnPause.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/CurrentPetDisplay.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/ExpBottleOnGroundHider.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/SummoningSoulsName.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/anvil/AnvilCombineHelper.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarApi.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarBestSellMethod.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarData.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarDataGrabber.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/bazaar/BazaarOrderHelper.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/chat/ChatFilter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/chat/ChatManager.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/chat/NewChatFilter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/chat/PlayerChatFilter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/chat/PlayerMessageChannel.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossFinder.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/damageindicator/BossType.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageCounter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/damageindicator/DamageIndicatorManager.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/damageindicator/EntityData.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/damageindicator/EntityResult.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/damageindicator/OldDamage.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/diana/GriffinBurrowFinder.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonBossMessages.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonChatFilter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonCleanEnd.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonData.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonDeathCounter.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonHighlightClickedBlocks.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/dungeon/DungeonMilestoneDisplay.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreature.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureManager.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/fishing/SeaCreatureMessageShortener.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/fishing/TrophyFishMessages.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/items/HideNotClickableItems.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/items/ItemDisplayOverlayFeatures.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/items/VanillaItemManager.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/items/abilitycooldown/ItemAbilityCooldown.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/items/abilitycooldown/WitherImpactDetection.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangFreezeCooldown.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/features/nether/ashfang/AshfangNextResetCooldown.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/fishing/SeaCreature.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/fishing/SeaCreatureManager.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/fishing/SeaCreatureMessageShortener.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/fishing/TrophyFishMessages.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/inventory/anvil/AnvilCombineHelper.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/items/HideNotClickableItems.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/items/ItemDisplayOverlayFeatures.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/items/VanillaItemManager.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/items/abilitycooldown/ItemAbilityCooldown.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/items/abilitycooldown/WitherImpactDetection.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/misc/ApiData.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/misc/ButtonOnPause.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/misc/CurrentPetDisplay.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/misc/ExpBottleOnGroundHider.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/misc/HypixelData.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/misc/ScoreboardData.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/misc/SummoningSoulsName.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/misc/nether/ashfang/AshfangFreezeCooldown.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/misc/nether/ashfang/AshfangNextResetCooldown.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixinhooks/GuiContainerHook.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixinhooks/NetHandlerPlayClientHook.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixinhooks/NetworkManagerHook.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixinhooks/RenderItemHook.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixinhooks/RenderManagerHook.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/mixinhooks/render/BlockRendererDispatcherHook.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/hooks/GuiContainerHook.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/hooks/NetHandlerPlayClientHook.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/hooks/NetworkManagerHook.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderItemHook.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/hooks/RenderManagerHook.kt create mode 100644 src/main/java/at/hannibal2/skyhanni/mixins/hooks/render/BlockRendererDispatcherHook.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/repo/RepoManager.kt delete mode 100644 src/main/java/at/hannibal2/skyhanni/repo/RepoUtils.kt diff --git a/src/main/java/at/hannibal2/skyhanni/ItemRenderBackground.kt b/src/main/java/at/hannibal2/skyhanni/ItemRenderBackground.kt deleted file mode 100644 index bd30ed597..000000000 --- a/src/main/java/at/hannibal2/skyhanni/ItemRenderBackground.kt +++ /dev/null @@ -1,47 +0,0 @@ -package at.hannibal2.skyhanni - -import at.hannibal2.skyhanni.events.RenderRealOverlayEvent -import at.hannibal2.skyhanni.utils.LorenzUtils -import net.minecraft.client.Minecraft -import net.minecraft.client.gui.Gui -import net.minecraft.client.renderer.GlStateManager -import net.minecraft.item.ItemStack -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class ItemRenderBackground { - - companion object { - - val map = mutableMapOf() - val mapTime = mutableMapOf() - - var ItemStack.background: Int - get() { - if (System.currentTimeMillis() > mapTime.getOrDefault(this, 0) + 100) return -1 - return map.getOrDefault(this, -1) - } - set(value) { - map[this] = value - mapTime[this] = System.currentTimeMillis() - } - } - - - @SubscribeEvent - fun renderOverlayLol(event: RenderRealOverlayEvent) { - val stack = event.stack - if (LorenzUtils.inSkyblock) { - if (stack != null) { - val color = stack.background - if (color != -1) { - GlStateManager.pushMatrix() - GlStateManager.translate(0f, 0f, 110 + Minecraft.getMinecraft().renderItem.zLevel) - val x = event.x - val y = event.y - Gui.drawRect(x, y, x + 16, y + 16, color) - GlStateManager.popMatrix() - } - } - } - } -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java index 848d45421..c614cba01 100644 --- a/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java +++ b/src/main/java/at/hannibal2/skyhanni/SkyHanniMod.java @@ -1,27 +1,34 @@ package at.hannibal2.skyhanni; -import at.hannibal2.skyhanni.bazaar.BazaarApi; -import at.hannibal2.skyhanni.bazaar.BazaarBestSellMethod; -import at.hannibal2.skyhanni.bazaar.BazaarOrderHelper; -import at.hannibal2.skyhanni.chat.ChatFilter; -import at.hannibal2.skyhanni.chat.ChatManager; -import at.hannibal2.skyhanni.chat.NewChatFilter; -import at.hannibal2.skyhanni.chat.PlayerChatFilter; import at.hannibal2.skyhanni.config.Features; import at.hannibal2.skyhanni.config.gui.commands.Commands; -import at.hannibal2.skyhanni.damageindicator.DamageIndicatorManager; -import at.hannibal2.skyhanni.dungeon.*; -import at.hannibal2.skyhanni.fishing.SeaCreatureManager; -import at.hannibal2.skyhanni.fishing.SeaCreatureMessageShortener; -import at.hannibal2.skyhanni.fishing.TrophyFishMessages; -import at.hannibal2.skyhanni.inventory.anvil.AnvilCombineHelper; -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.misc.nether.ashfang.AshfangFreezeCooldown; -import at.hannibal2.skyhanni.misc.nether.ashfang.AshfangNextResetCooldown; -import at.hannibal2.skyhanni.repo.RepoManager; +import at.hannibal2.skyhanni.data.ApiData; +import at.hannibal2.skyhanni.data.HypixelData; +import at.hannibal2.skyhanni.data.ItemRenderBackground; +import at.hannibal2.skyhanni.data.ScoreboardData; +import at.hannibal2.skyhanni.data.repo.RepoManager; +import at.hannibal2.skyhanni.features.ButtonOnPause; +import at.hannibal2.skyhanni.features.CurrentPetDisplay; +import at.hannibal2.skyhanni.features.ExpBottleOnGroundHider; +import at.hannibal2.skyhanni.features.SummoningSoulsName; +import at.hannibal2.skyhanni.features.anvil.AnvilCombineHelper; +import at.hannibal2.skyhanni.features.bazaar.BazaarApi; +import at.hannibal2.skyhanni.features.bazaar.BazaarBestSellMethod; +import at.hannibal2.skyhanni.features.bazaar.BazaarOrderHelper; +import at.hannibal2.skyhanni.features.chat.ChatFilter; +import at.hannibal2.skyhanni.features.chat.ChatManager; +import at.hannibal2.skyhanni.features.chat.NewChatFilter; +import at.hannibal2.skyhanni.features.chat.PlayerChatFilter; +import at.hannibal2.skyhanni.features.damageindicator.DamageIndicatorManager; +import at.hannibal2.skyhanni.features.dungeon.*; +import at.hannibal2.skyhanni.features.fishing.SeaCreatureManager; +import at.hannibal2.skyhanni.features.fishing.SeaCreatureMessageShortener; +import at.hannibal2.skyhanni.features.fishing.TrophyFishMessages; +import at.hannibal2.skyhanni.features.items.HideNotClickableItems; +import at.hannibal2.skyhanni.features.items.ItemDisplayOverlayFeatures; +import at.hannibal2.skyhanni.features.items.abilitycooldown.ItemAbilityCooldown; +import at.hannibal2.skyhanni.features.nether.ashfang.AshfangFreezeCooldown; +import at.hannibal2.skyhanni.features.nether.ashfang.AshfangNextResetCooldown; import at.hannibal2.skyhanni.test.LorenzTest; import com.google.gson.Gson; import com.google.gson.GsonBuilder; diff --git a/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarApi.kt b/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarApi.kt deleted file mode 100644 index cbebe951c..000000000 --- a/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarApi.kt +++ /dev/null @@ -1,59 +0,0 @@ -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/BazaarBestSellMethod.kt b/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarBestSellMethod.kt deleted file mode 100644 index 56c264312..000000000 --- a/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarBestSellMethod.kt +++ /dev/null @@ -1,79 +0,0 @@ -package at.hannibal2.skyhanni.bazaar - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.GuiContainerEvent -import at.hannibal2.skyhanni.utils.GuiRender.renderString -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.NumberUtil -import net.minecraft.client.gui.inventory.GuiChest -import net.minecraft.inventory.ContainerChest -import net.minecraftforge.client.event.GuiScreenEvent -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class BazaarBestSellMethod { - - companion object { - private var textToRender = "" - } - - @SubscribeEvent - fun onBackgroundDrawn(event: GuiContainerEvent.CloseWindowEvent) { - textToRender = "" - } - - @SubscribeEvent - fun onGuiDrawEvent(event: GuiScreenEvent.DrawScreenEvent.Post) { - if (!isEnabled()) return - textToRender = getNewText(event) - } - - private fun getNewText(event: GuiScreenEvent.DrawScreenEvent.Post): String { - try { - if (event.gui !is GuiChest) return "" - val chest = (event.gui as GuiChest).inventorySlots as ContainerChest - - val inv = chest.lowerChestInventory ?: return "" - - val buyInstantly = inv.getStackInSlot(10) - if (buyInstantly == null || buyInstantly.displayName != "§aBuy Instantly") return "" - val bazaarItem = inv.getStackInSlot(13) ?: return "" - var name = bazaarItem.displayName - name = BazaarApi.getCleanBazaarName(name) - val data = BazaarApi.getBazaarDataForName(name) - - var having = 0 - 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 - if (BazaarApi.getCleanBazaarName(displayName) == name) { - having += stack.stackSize - } - } - - if (having <= 0) return "" - - val totalDiff = (data.buyPrice - data.sellPrice) * having - val result = NumberUtil.format(totalDiff.toInt()) - - return "§b$name§f sell difference: §e$result coins" - } catch (e: Error) { - e.printStackTrace() - return "" - } - } - - @SubscribeEvent(priority = EventPriority.LOWEST) - fun renderOverlay(event: GuiScreenEvent.BackgroundDrawnEvent) { - if (!isEnabled()) return - - SkyHanniMod.feature.bazaar.bestSellMethodPos.renderString(textToRender) - } - - private fun isEnabled(): Boolean { - return LorenzUtils.inSkyblock && SkyHanniMod.feature.bazaar.bestSellMethod - } -} \ 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 deleted file mode 100644 index 01300e67c..000000000 --- a/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarData.kt +++ /dev/null @@ -1,3 +0,0 @@ -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 deleted file mode 100644 index 1f2f1171a..000000000 --- a/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarDataGrabber.kt +++ /dev/null @@ -1,113 +0,0 @@ -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 deleted file mode 100644 index eec055253..000000000 --- a/src/main/java/at/hannibal2/skyhanni/bazaar/BazaarOrderHelper.kt +++ /dev/null @@ -1,87 +0,0 @@ -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 deleted file mode 100644 index 7efbf2ff6..000000000 --- a/src/main/java/at/hannibal2/skyhanni/chat/ChatFilter.kt +++ /dev/null @@ -1,301 +0,0 @@ -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" - annoyingSpam(message) && SkyHanniMod.feature.chat.others -> "annoying_spam" - - - else -> "" - } - - //TODO split into others - private fun annoyingSpam(message: String): Boolean { - if (message.matchRegex("§7Your Implosion hit (.*) for §r§c(.*) §r§7damage.")) return true - if (message.matchRegex("§7Your Molten Wave hit (.*) for §r§c(.*) §r§7damage.")) return true - if (message == "§cThere are blocks in the way!") return true - if (message == "§aYour Blessing enchant got you double drops!") return true - if (message == "§cYou can't use the wardrobe in combat!") return true - if (message == "§6§lGOOD CATCH! §r§bYou found a §r§fFish Bait§r§b.") return true - if (message == "§6§lGOOD CATCH! §r§bYou found a §r§aGrand Experience Bottle§r§b.") return true - if (message == "§6§lGOOD CATCH! §r§bYou found a §r§aBlessed Bait§r§b.") return true - if (message == "§6§lGOOD CATCH! §r§bYou found a §r§fDark Bait§r§b.") return true - if (message == "§6§lGOOD CATCH! §r§bYou found a §r§fLight Bait§r§b.") return true - if (message == "§6§lGOOD CATCH! §r§bYou found a §r§aHot Bait§r§b.") return true - if (message == "§6§lGOOD CATCH! §r§bYou found a §r§fSpooky Bait§r§b.") return true - - return false - } - - 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 deleted file mode 100644 index c189caa3d..000000000 --- a/src/main/java/at/hannibal2/skyhanni/chat/ChatManager.kt +++ /dev/null @@ -1,51 +0,0 @@ -package at.hannibal2.skyhanni.chat - -import at.hannibal2.skyhanni.events.LorenzActionBarEvent -import at.hannibal2.skyhanni.utils.LorenzLogger -import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.PacketEvent -import at.hannibal2.skyhanni.utils.LorenzUtils -import net.minecraft.network.play.server.S02PacketChat -import net.minecraftforge.fml.common.eventhandler.EventPriority -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class ChatManager { - - private val loggerAll = LorenzLogger("chat/filter_all") - private val loggerFiltered = LorenzLogger("chat/filter_blocked") - private val loggerAllowed = LorenzLogger("chat/filter_allowed") - private val loggerFilteredTypes = mutableMapOf() - - @SubscribeEvent(priority = EventPriority.LOW, receiveCanceled = true) - fun onChatPacket(event: PacketEvent.ReceiveEvent) { - val packet = event.packet - if (packet !is S02PacketChat) return - val messageComponent = packet.chatComponent - - val message = LorenzUtils.stripVanillaMessage(messageComponent.formattedText) - if (packet.type.toInt() == 2) { - val actionBarEvent = LorenzActionBarEvent(message) - actionBarEvent.postAndCatch() - } else { - - val chatEvent = LorenzChatEvent(message, messageComponent) - chatEvent.postAndCatch() - - val blockReason = chatEvent.blockedReason.uppercase() - if (blockReason != "") { - event.isCanceled = true - loggerFiltered.log("[$blockReason] $message") - loggerAll.log("[$blockReason] $message") - loggerFilteredTypes.getOrPut(blockReason) { LorenzLogger("chat/filter_blocked/$blockReason") } - .log(message) - return - } - - if (!message.startsWith("§f{\"server\":\"")) { - loggerAllowed.log(message) - loggerAll.log("[allowed] $message") - } - - } - } -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/chat/NewChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/chat/NewChatFilter.kt deleted file mode 100644 index b72f4fd4b..000000000 --- a/src/main/java/at/hannibal2/skyhanni/chat/NewChatFilter.kt +++ /dev/null @@ -1,18 +0,0 @@ -package at.hannibal2.skyhanni.chat - -import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.utils.LorenzUtils -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class NewChatFilter { - - @SubscribeEvent - fun onChatMessage(event: LorenzChatEvent) { - if (!LorenzUtils.isOnHypixel) return - -// val blockReason = block(event.message) -// if (blockReason != "") { -// event.blockedReason = blockReason -// } - } -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/chat/PlayerChatFilter.kt b/src/main/java/at/hannibal2/skyhanni/chat/PlayerChatFilter.kt deleted file mode 100644 index dde648a55..000000000 --- a/src/main/java/at/hannibal2/skyhanni/chat/PlayerChatFilter.kt +++ /dev/null @@ -1,90 +0,0 @@ -package at.hannibal2.skyhanni.chat - -import at.hannibal2.skyhanni.SkyHanniMod -import at.hannibal2.skyhanni.events.LorenzChatEvent -import at.hannibal2.skyhanni.events.PlayerSendChatEvent -import at.hannibal2.skyhanni.utils.LorenzLogger -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.removeColor -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class PlayerChatFilter { - - @SubscribeEvent - fun onChatMessage(event: LorenzChatEvent) { - if (!LorenzUtils.isOnHypixel) return - if (!SkyHanniMod.feature.chat.playerMessages) return - - if (shouldBlock(event.message)) { - event.blockedReason = "player_chat" - } - } - - val loggerPlayerChat = LorenzLogger("chat/player") - - fun shouldBlock(originalMessage: String): Boolean { - val split: List = if (originalMessage.contains("§7§r§7: ")) { - originalMessage.split("§7§r§7: ") - } else if (originalMessage.contains("§f: ")) { - originalMessage.split("§f: ") - } else { - return false - } - - var rawName = split[0] - val message = split[1] - - val channel: PlayerMessageChannel - if (rawName.startsWith("§9Party §8> ")) { - channel = PlayerMessageChannel.PARTY - rawName = rawName.substring(12) - } else if (rawName.startsWith("§2Guild > ")) { - channel = PlayerMessageChannel.GUILD - rawName = rawName.substring(10) - } else if (rawName.startsWith("§bCo-op > ")) { - channel = PlayerMessageChannel.COOP - rawName = rawName.substring(10) - } else { - channel = PlayerMessageChannel.ALL - } - - val nameSplit = rawName.split(" ") - val first = nameSplit[0] - - val last = nameSplit.last() - val name = if (last.endsWith("]")) { - nameSplit[nameSplit.size - 2] - } else { - last - } - - if (first != name) { - if (!first.contains("VIP") && !first.contains("MVP")) { - //TODO support yt + admin - return false - } - } - - send(channel, name.removeColor(), message.removeColor()) - return true - } - - private fun send(channel: PlayerMessageChannel, name: String, message: String) { - loggerPlayerChat.log("[$channel] $name: $message") - val event = PlayerSendChatEvent(channel, name, message) - event.postAndCatch() - - if (event.cancelledReason != "") { - loggerPlayerChat.log("cancelled: " + event.cancelledReason) - } else { - val finalMessage = event.message - if (finalMessage != message) { - loggerPlayerChat.log("message changed: $finalMessage") - } - - val prefix = channel.prefix - LorenzUtils.chat("$prefix §b$name §f$finalMessage") - } - } - -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/chat/PlayerMessageChannel.kt b/src/main/java/at/hannibal2/skyhanni/chat/PlayerMessageChannel.kt deleted file mode 100644 index 826b490de..000000000 --- a/src/main/java/at/hannibal2/skyhanni/chat/PlayerMessageChannel.kt +++ /dev/null @@ -1,10 +0,0 @@ -package at.hannibal2.skyhanni.chat - -enum class PlayerMessageChannel(val prefix: String) { - - ALL("§fA>"), - ALL_ADVERTISEMENT("§8A>"), - PARTY("§9P>"), - GUILD("§2G>"), - COOP("§bCC>"), -} \ No newline at end of file diff --git a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossFinder.kt b/src/main/java/at/hannibal2/skyhanni/damageindicator/BossFinder.kt deleted file mode 100644 index 37cb085d1..000000000 --- a/src/main/java/at/hannibal2/skyhanni/damageindicator/BossFinder.kt +++ /dev/null @@ -1,569 +0,0 @@ -package at.hannibal2.skyhanni.damageindicator - -import at.hannibal2.skyhanni.dungeon.DungeonData -import at.hannibal2.skyhanni.utils.LorenzUtils -import at.hannibal2.skyhanni.utils.LorenzUtils.baseMaxHealth -import at.hannibal2.skyhanni.utils.LorenzUtils.matchRegex -import at.hannibal2.skyhanni.utils.LorenzVec -import at.hannibal2.skyhanni.utils.getLorenzVec -import net.minecraft.client.Minecraft -import net.minecraft.client.entity.EntityOtherPlayerMP -import net.minecraft.entity.Entity -import net.minecraft.entity.EntityLiving -import net.minecraft.entity.EntityLivingBase -import net.minecraft.entity.boss.EntityDragon -import net.minecraft.entity.boss.EntityWither -import net.minecraft.entity.item.EntityArmorStand -import net.minecraft.entity.monster.* -import net.minecraft.entity.passive.EntityHorse -import net.minecraft.entity.passive.EntityWolf -import net.minecraft.util.AxisAlignedBB -import java.util.* - -class BossFinder { - - //F1 - private var floor1bonzo1 = false - private var floor1bonzo1SpawnTime = 0L - private var floor1bonzo2 = false - private var floor1bonzo2SpawnTime = 0L - - //F2 - private var floor2summons1 = false - private var floor2summons1SpawnTime = 0L - private var floor2summonsDiedOnce = mutableListOf() - private var floor2secondPhase = false - private var floor2secondPhaseSpawnTime = 0L - - //F3 - private var floor3GuardianShield = false - private var floor3GuardianShieldSpawnTime = 0L - private var guardians = mutableListOf() - private var floor3Professor = false - private var floor3ProfessorSpawnTime = 0L - private var floor3ProfessorGuardianPrepare = false - private var floor3ProfessorGuardianPrepareSpawnTime = 0L - private var floor3ProfessorGuardian = false - private var floor3ProfessorGuardianEntity: EntityGuardian? = null - - //F5 - private var floor5lividEntity: EntityOtherPlayerMP? = null - private var floor5lividEntitySpawnTime = 0L - - //F6 - private var floor6Giants = false - private var floor6GiantsSpawnTime = 0L - private var floor6GiantsSeparateDelay = mutableMapOf() - private var floor6Sadan = false - private var floor6SadanSpawnTime = 0L - - internal fun tryAdd(entity: EntityLivingBase): EntityResult? { - if (LorenzUtils.inDungeons) { - if (DungeonData.isOneOf("F1", "M1")) { - if (floor1bonzo1) { - if (entity is EntityOtherPlayerMP) { - if (entity.name == "Bonzo ") { - return EntityResult(floor1bonzo1SpawnTime) - } - } - } - if (floor1bonzo2) { - if (entity is EntityOtherPlayerMP) { - if (entity.name == "Bonzo ") { - return EntityResult(floor1bonzo2SpawnTime, finalDungeonBoss = true) - } - } - } - } - - if (DungeonData.isOneOf("F2", "M2")) { - if (entity.name == "Summon ") { - if (entity is EntityOtherPlayerMP) { - if (floor2summons1) { - if (!floor2summonsDiedOnce.contains(entity)) { - if (entity.health.toInt() != 0) { - return EntityResult(floor2summons1SpawnTime) - } else { - floor2summonsDiedOnce.add(entity) - } - } - } - if (floor2secondPhase) { - return EntityResult(floor2secondPhaseSpawnTime) - } - } - } - - if (floor2secondPhase) { - if (entity is EntityOtherPlayerMP) { - //TODO only show scarf after (all/at least x) summons are dead? - val result = entity.name == "Scarf " - if (result) { - return EntityResult(floor2secondPhaseSpawnTime, finalDungeonBoss = true) - } - } - } - } - - if (DungeonData.isOneOf("F3", "M3")) { - if (entity is EntityGuardian) { - if (floor3GuardianShield) { - if (guardians.size == 4) { - var totalHealth = 0 - for (guardian in guardians) { - totalHealth += guardian.health.toInt() - } - if (totalHealth == 0) { - floor3GuardianShield = false - guardians.clear() - } - } else { - findGuardians() - } - if (guardians.contains(entity)) { - return EntityResult(floor3GuardianShieldSpawnTime, true) - } - } - } - - if (floor3Professor) { - if (entity is EntityOtherPlayerMP) { - if (entity.name == "The Professor") { - return EntityResult( - floor3ProfessorSpawnTime, - floor3ProfessorSpawnTime + 1_000 > System.currentTimeMillis() - ) - } - } - } - if (floor3ProfessorGuardianPrepare)