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 --- 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 ------------ 114 files changed, 10293 deletions(-) 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/at/lorenz/mod') diff --git a/src/main/java/at/lorenz/mod/LorenzMod.java b/src/main/java/at/lorenz/mod/LorenzMod.java deleted file mode 100644 index 781bec184..000000000 --- a/src/main/java/at/lorenz/mod/LorenzMod.java +++ /dev/null @@ -1,119 +0,0 @@ -package at.lorenz.mod; - -import at.lorenz.mod.bazaar.BazaarApi; -import at.lorenz.mod.bazaar.BazaarOrderHelper; -import at.lorenz.mod.chat.ChatFilter; -import at.lorenz.mod.chat.ChatManager; -import at.lorenz.mod.chat.PlayerChatFilter; -import at.lorenz.mod.config.Features; -import at.lorenz.mod.config.commands.Commands; -import at.lorenz.mod.dungeon.*; -import at.lorenz.mod.dungeon.damageindicator.DungeonBossDamageIndicator; -import at.lorenz.mod.items.HideNotClickableItems; -import at.lorenz.mod.items.ItemDisplayOverlayFeatures; -import at.lorenz.mod.items.abilitycooldown.ItemAbilityCooldown; -import at.lorenz.mod.misc.*; -import at.lorenz.mod.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 = LorenzMod.MODID, version = LorenzMod.VERSION) -public class LorenzMod { - - public static final String MODID = "lorenzmod"; - public static final String VERSION = "0.6"; - - 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/LorenzMod/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/lorenz/mod/bazaar/BazaarApi.kt b/src/main/java/at/lorenz/mod/bazaar/BazaarApi.kt deleted file mode 100644 index 28ce228e2..000000000 --- a/src/main/java/at/lorenz/mod/bazaar/BazaarApi.kt +++ /dev/null @@ -1,59 +0,0 @@ -package at.lorenz.mod.bazaar - -import at.lorenz.mod.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/lorenz/mod/bazaar/BazaarData.kt b/src/main/java/at/lorenz/mod/bazaar/BazaarData.kt deleted file mode 100644 index a9f75370c..000000000 --- a/src/main/java/at/lorenz/mod/bazaar/BazaarData.kt +++ /dev/null @@ -1,3 +0,0 @@ -package at.lorenz.mod.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/lorenz/mod/bazaar/BazaarDataGrabber.kt b/src/main/java/at/lorenz/mod/bazaar/BazaarDataGrabber.kt deleted file mode 100644 index 9a23eb47b..000000000 --- a/src/main/java/at/lorenz/mod/bazaar/BazaarDataGrabber.kt +++ /dev/null @@ -1,115 +0,0 @@ -package at.lorenz.mod.bazaar - -import at.lorenz.mod.utils.APIUtil -import at.lorenz.mod.utils.LorenzUtils -import at.lorenz.mod.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 = "lorenz-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) { -// LorenzUtils.warning("Bazaar buy order for $itemName not found!") - 0.0 - } - val buyPrice: Double = try { - itemData["buy_summary"].asJsonArray[0].asJsonObject["pricePerUnit"].asDouble.round(1) - } catch (e: Exception) { -// LorenzUtils.warning("Bazaar sell offers for $itemName not found!") - 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/lorenz/mod/bazaar/BazaarOrderHelper.kt b/src/main/java/at/lorenz/mod/bazaar/BazaarOrderHelper.kt deleted file mode 100644 index 829c61838..000000000 --- a/src/main/java/at/lorenz/mod/bazaar/BazaarOrderHelper.kt +++ /dev/null @@ -1,87 +0,0 @@ -package at.lorenz.mod.bazaar - -import at.lorenz.mod.events.GuiContainerEvent -import at.lorenz.mod.utils.ItemUtils.getLore -import at.lorenz.mod.utils.LorenzColor -import at.lorenz.mod.utils.RenderUtils.highlight -import at.lorenz.mod.LorenzMod -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 (!LorenzMod.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/lorenz/mod/chat/ChatFilter.kt b/src/main/java/at/lorenz/mod/chat/ChatFilter.kt deleted file mode 100644 index f31297100..000000000 --- a/src/main/java/at/lorenz/mod/chat/ChatFilter.kt +++ /dev/null @@ -1,284 +0,0 @@ -package at.lorenz.mod.chat - -import at.lorenz.mod.events.LorenzChatEvent -import at.lorenz.mod.utils.LorenzUtils -import at.lorenz.mod.utils.LorenzUtils.matchRegex -import at.lorenz.mod.LorenzMod -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) && LorenzMod.feature.chat.hypixelHub -> "lobby" - empty(message) && LorenzMod.feature.chat.empty -> "empty" - warping(message) && LorenzMod.feature.chat.warping -> "warping" - welcome(message) && LorenzMod.feature.chat.welcome -> "welcome" - guild(message) && LorenzMod.feature.chat.others -> "guild" - killCombo(message) && LorenzMod.feature.chat.others -> "kill_combo" - bazaarAndAHMiniMessages(message) && LorenzMod.feature.chat.others -> "bz_ah_minis" - watchdogAnnouncement(message) && LorenzMod.feature.chat.others -> "watchdog" - slayer(message) && LorenzMod.feature.chat.others -> "slayer" - slayerDrop(message) && LorenzMod.feature.chat.others -> "slayer_drop" - uselessDrop(message) && LorenzMod.feature.chat.others -> "useless_drop" - uselessNotification(message) && LorenzMod.feature.chat.others -> "useless_notification" - party(message) && LorenzMod.feature.chat.others -> "party" - money(message) && LorenzMod.feature.chat.others -> "money" - winterIsland(message) && LorenzMod.feature.chat.others -> "winter_island" - uselessWarning(message) && LorenzMod.feature.chat.others -> "useless_warning" - friendJoin(message) && LorenzMod.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/lorenz/mod/chat/ChatManager.kt b/src/main/java/at/lorenz/mod/chat/ChatManager.kt deleted file mode 100644 index c4ad5ee8d..000000000 --- a/src/main/java/at/lorenz/mod/chat/ChatManager.kt +++ /dev/null @@ -1,51 +0,0 @@ -package at.lorenz.mod.chat - -import at.lorenz.mod.events.LorenzActionBarEvent -import at.lorenz.mod.utils.LorenzLogger -import at.lorenz.mod.events.LorenzChatEvent -import at.lorenz.mod.events.PacketEvent -import at.lorenz.mod.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/lorenz/mod/chat/PlayerChatFilter.kt b/src/main/java/at/lorenz/mod/chat/PlayerChatFilter.kt deleted file mode 100644 index bee241b36..000000000 --- a/src/main/java/at/lorenz/mod/chat/PlayerChatFilter.kt +++ /dev/null @@ -1,90 +0,0 @@ -package at.lorenz.mod.chat - -import at.lorenz.mod.events.LorenzChatEvent -import at.lorenz.mod.utils.LorenzLogger -import at.lorenz.mod.utils.LorenzUtils -import at.lorenz.mod.utils.LorenzUtils.removeColorCodes -import at.lorenz.mod.events.PlayerSendChatEvent -import at.lorenz.mod.LorenzMod -import net.minecraftforge.fml.common.eventhandler.SubscribeEvent - -class PlayerChatFilter { - - @SubscribeEvent - fun onChatMessage(event: LorenzChatEvent) { - if (!LorenzUtils.isOnHypixel) return - if (!LorenzMod.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.removeColorCodes(), message.removeColorCodes()) - 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/lorenz/mod/chat/PlayerMessageChannel.kt b/src/main/java/at/lorenz/mod/chat/PlayerMessageChannel.kt deleted file mode 100644 index 0e44b88f0..000000000 --- a/src/main/java/at/lorenz/mod/chat/PlayerMessageChannel.kt +++ /dev/null @@ -1,10 +0,0 @@ -package at.lorenz.mod.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/lorenz/mod/config/Features.java b/src/main/java/at/lorenz/mod/config/Features.java deleted file mode 100644 index cd7846394..000000000 --- a/src/main/java/at/lorenz/mod/config/Features.java +++ /dev/null @@ -1,274 +0,0 @@ -package at.lorenz.mod.config; - -import at.lorenz.mod.LorenzMod; -import at.lorenz.mod.config.config.ConfigEditor; -import at.lorenz.mod.config.core.GuiElement; -import at.lorenz.mod.config.core.GuiScreenElementWrapper; -import at.lorenz.mod.config.core.config.Position; -import at.lorenz.mod.config.core.config.annotations.*; -import at.lorenz.mod.config.core.config.gui.GuiPositionEditor; -import com.google.gson.annotations.Expose; -import net.minecraft.client.Minecraft; - -public class Features { - - private void editOverlay(String activeConfig, int width, int height, Position position) { - Minecraft.getMinecraft().displayGuiScreen(new GuiPositionEditor(position, width, height, () -> {}, () -> {}, () -> LorenzMod.screenToOpen = new GuiScreenElementWrapper(new ConfigEditor(LorenzMod.feature, activeConfig)))); - } - - public void executeRunnable(String runnableId) { - String activeConfigCategory = null; - if (Minecraft.getMinecraft().currentScreen instanceof GuiScreenElementWrapper) { - GuiScreenElementWrapper wrapper = (GuiScreenElementWrapper) Minecraft.getMinecraft().currentScreen; - GuiElement element = wrapper.element; - if (element instanceof ConfigEditor) { - activeConfigCategory = ((ConfigEditor) element).getSelectedCategoryName(); - } - } - - if (runnableId.equals("petDisplay")) { - editOverlay(activeConfigCategory, 200, 16, misc.petDisplayPos); - return; - } - - if (runnableId.equals("testPos")) { - editOverlay(activeConfigCategory, 200, 16, debug.testPos); - return; - } - - if (runnableId.equals("dungeonMilestoneDisplay")) { - editOverlay(activeConfigCategory, 200, 16, dungeon.milestoneDisplayPos); - return; - } - - if (runnableId.equals("dungeonDeathCounter")) { - editOverlay(activeConfigCategory, 200, 16, dungeon.deathCounterDisplay); - return; - } - } - - @Expose - @Category(name = "Chat", desc = "Chat related features.") - public Chat chat = new Chat(); - - @Expose - @Category(name = "Dungeon", desc = "Features that change the catacombs dungeon experience.") - public Dungeon dungeon = new Dungeon(); - - @Expose - @Category(name = "Items", desc = "Changing the behavior around items and the inventory.") - public Items items = new Items(); - - @Expose - @Category(name = "Bazaar", desc = "Bazaar settings.") - public Bazaar bazaar = new Bazaar(); - - @Expose - @Category(name = "Misc", desc = "Settings without a category.") - public Misc misc = new Misc(); - - @Expose - @Category(name = "Debug", desc = "Debug and test stuff.") - public Debug debug = new Debug(); - - public static class Chat { - - @Expose - @ConfigOption(name = "Chat Filter Types", desc = "") - @ConfigEditorAccordion(id = 1) - public boolean filterTypes = false; - - @Expose - @ConfigOption(name = "HyPixel Hub", desc = "Block messages outside SkyBlock in the HyPixel lobby: player joins, loot boxes, prototype lobby messages, radiating generosity and HyPixel tournaments.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean hypixelHub = false; - - @Expose - @ConfigOption(name = "Empty", desc = "Hide all the empty messages from the chat.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean empty = false; - - @Expose - @ConfigOption(name = "Warping", desc = "Block 'sending request to join ..' and 'warping ..' messages.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean warping = false; - - @Expose - @ConfigOption(name = "Welcome", desc = "Hide the 'welcome to skyblock' message.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean welcome = false; - - //TODO remove - @Expose - @ConfigOption(name = "Others", desc = "Hide other annoying messages.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 1) - public boolean others = false; - - @Expose - @ConfigOption(name = "Player Messages", desc = "Add a fancy new chat format for player messages.") - @ConfigEditorBoolean - public boolean playerMessages = false; - - @Expose - @ConfigOption(name = "Dungeon Filter", desc = "Hide annoying messages inside dungeon.") - @ConfigEditorBoolean - public boolean dungeonMessages = false; - - @Expose - @ConfigOption(name = "Dungeon Boss Messages", desc = "Hide messages from watcher and bosses inside dungeon.") - @ConfigEditorBoolean - public boolean dungeonBossMessages = false; - } - - public static class Dungeon { - - @Expose - @ConfigOption(name = "Clicked Blocks", desc = "Highlight the following blocks when clicked in dungeon: Lever, Chest, Wither Essence") - @ConfigEditorBoolean - public boolean highlightClickedBlocks = false; - - @Expose - @ConfigOption(name = "Boss Damage Indicator", desc = "Show the missing health of a boss in the dungeon and the cooldown time until the boss becomes attackable.") - @ConfigEditorBoolean - public boolean bossDamageIndicator = false; - - @Expose - @ConfigOption(name = "Milestone Display", desc = "Show the current milestone inside Dungeons.") - @ConfigEditorBoolean - public boolean showMilestoneDisplay = false; - - @Expose - @ConfigOption(name = "Milestone Display Position", desc = "") - @ConfigEditorButton(runnableId = "dungeonMilestoneDisplay", buttonText = "Edit") - public Position milestoneDisplayPos = new Position(10, 10, false, true); - - @Expose - @ConfigOption(name = "Death Counter", desc = "Display the total amount of deaths in the current dungeon.") - @ConfigEditorBoolean - public boolean deathCounter = false; - - @Expose - @ConfigOption(name = "Death Counter Position", desc = "") - @ConfigEditorButton(runnableId = "dungeonDeathCounter", buttonText = "Edit") - public Position deathCounterDisplay = new Position(10, 10, false, true); - - @Expose - @ConfigOption(name = "Clean End", desc = "Hide entities and particles after the boss in Floor 1 - 6 has died.") - @ConfigEditorBoolean - public boolean cleanEnd = false; - - @Expose - @ConfigOption(name = "Ignore Guardians", desc = "Ignore F3 and M3 guardians from the clean end feature when sneaking. Makes it easier to kill them after the boss died already. Thanks hypixel.") - @ConfigEditorBoolean - public boolean cleanEndF3IgnoreGuardians = false; - } - - public static class Items { - - @Expose - @ConfigOption(name = "Not Clickable Items", desc = "Hide items that are not clickable in " + "the current inventory: ah, bz, accessory bag, etc") - @ConfigEditorBoolean - public boolean hideNotClickableItems = false; - - @Expose - @ConfigOption(name = "Item number as stack size", desc = "") - @ConfigEditorAccordion(id = 2) - public boolean filterTypes = false; - - @Expose - @ConfigOption(name = "Master Star Number", desc = "Show the Tier of the Master Star.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean displayMasterStarNumber = false; - - @Expose - @ConfigOption(name = "Master Skull Number", desc = "Show the tier of the Master Skull accessory.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean displayMasterSkullNumber = false; - - @Expose - @ConfigOption(name = "Dungeon Head Floor", desc = "Show the correct floor for golden and diamond heads.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean displayDungeonHeadFloor = false; - - @Expose - @ConfigOption(name = "New Year Cake", desc = "Show the Number of the Year of New Year Cakes.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean displayNewYearCakeNumber = false; - - @Expose - @ConfigOption(name = "Pet Level", desc = "Show the level of the pet when not maxed.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean displayPetLevel = false; - - @Expose - @ConfigOption(name = "Sack Name", desc = "Show an abbreviation of the Sack name.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean displaySackName = false; - - @Expose - @ConfigOption(name = "Minion Tier", desc = "Show the Minion Tier over Items.") - @ConfigEditorBoolean - @ConfigAccordionId(id = 2) - public boolean displayMinionTier = false; - - @Expose - @ConfigOption(name = "Ability Cooldown", desc = "Show the cooldown of item abilities.") - @ConfigEditorBoolean - public boolean itemAbilityCooldown = false; - } - - public static class Bazaar { - - @Expose - @ConfigOption(name = "Order Helper", desc = "Show visual hints inside the Bazaar Manage Order view when items are ready to pickup or outbid.") - @ConfigEditorBoolean - public boolean orderHelper = false; - } - - public static class Misc { - - @Expose - @ConfigOption(name = "Pet Display", desc = "Show the currently active pet.") - @ConfigEditorBoolean - public boolean petDisplay = false; - - @Expose - @ConfigOption(name = "Pet Display Position", desc = "") - @ConfigEditorButton(runnableId = "petDisplay", buttonText = "Edit") - public Position petDisplayPos = new Position(10, 10, false, true); - - @Expose - @ConfigOption(name = "Exp Bottles", desc = "Hides all the experience bottles lying on the ground.") - @ConfigEditorBoolean - public boolean hideExpBottles = false; - - @Expose - @ConfigOption(name = "Config Button", desc = "Add a button to the pause menu to configure the Lorenz mod.") - @ConfigEditorBoolean - public boolean configButtonOnPause = true; - } - - public static class Debug { - - @Expose - @ConfigOption(name = "Enable Test", desc = "Enable Test logic") - @ConfigEditorBoolean - public boolean enabled = false; - - @Expose - @ConfigOption(name = "Test Location", desc = "") - @ConfigEditorButton(runnableId = "testPos", buttonText = "Edit") - public Position testPos = new Position(10, 10, false, true); - } -} diff --git a/src/main/java/at/lorenz/mod/config/GuiTextures.java b/src/main/java/at/lorenz/mod/config/GuiTextures.java deleted file mode 100644 index e24f1879d..000000000 --- a/src/main/java/at/lorenz/mod/config/GuiTextures.java +++ /dev/null @@ -1,32 +0,0 @@ -package at.lorenz.mod.config; - -import net.minecraft.util.ResourceLocation; - -public class GuiTextures { - - private GuiTextures() {} - - public static final ResourceLocation DISCORD = new ResourceLocation("lorenzmod:discord.png"); - - public static final ResourceLocation button_tex = new ResourceLocation("lorenzmod:button.png"); - - public static final ResourceLocation button_white = new ResourceLocation("lorenzmod:button_white.png"); - - public static final ResourceLocation BAR = new ResourceLocation("lorenzmod:core/bar.png"); - public static final ResourceLocation OFF = new Resour