diff options
author | Yasin <a.piri@hotmail.de> | 2024-06-30 17:27:11 +0200 |
---|---|---|
committer | Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> | 2024-07-26 15:09:00 +0800 |
commit | 1763cae9785d001a64672511fab5f63026ca8048 (patch) | |
tree | c98e0be1fd62be4bd9b9eb2f2e7af8a7e7640872 /src/main | |
parent | ba87c7ab14633102861a1d88838820635a3e9b4c (diff) | |
download | Skyblocker-1763cae9785d001a64672511fab5f63026ca8048.tar.gz Skyblocker-1763cae9785d001a64672511fab5f63026ca8048.tar.bz2 Skyblocker-1763cae9785d001a64672511fab5f63026ca8048.zip |
Update LividColor.java
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/dungeon/LividColor.java | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/LividColor.java b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/LividColor.java index 1032baf4..5b8e6347 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/dungeon/LividColor.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/dungeon/LividColor.java @@ -6,7 +6,6 @@ import de.hysky.skyblocker.skyblock.dungeon.secrets.DungeonManager; import de.hysky.skyblocker.utils.Constants; import de.hysky.skyblocker.utils.Utils; import de.hysky.skyblocker.utils.scheduler.MessageScheduler; -import net.fabricmc.fabric.api.client.message.v1.ClientReceiveMessageEvents; import net.fabricmc.fabric.api.client.networking.v1.ClientPlayConnectionEvents; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderContext; import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents; @@ -16,7 +15,6 @@ import net.minecraft.client.MinecraftClient; import net.minecraft.entity.effect.StatusEffects; import net.minecraft.registry.Registries; import net.minecraft.text.MutableText; -import net.minecraft.text.Text; import net.minecraft.util.Formatting; import net.minecraft.util.math.BlockPos; @@ -50,14 +48,12 @@ public class LividColor { public static final DungeonsConfig.Livid CONFIG = SkyblockerConfigManager.get().dungeons.livid; private static Formatting color; private static Block lastColor = Blocks.AIR; - private static boolean inBoss = false; private static boolean isInitialized = false; private static final long OFFSET_DURATION = 2000; private static long toggleTime = 0; public static void init() { - ClientReceiveMessageEvents.GAME.register(LividColor::onChatMessage); ClientPlayConnectionEvents.JOIN.register((handler, sender, client) -> LividColor.reset()); WorldRenderEvents.AFTER_ENTITIES.register(LividColor::update); } @@ -68,7 +64,7 @@ public class LividColor { MinecraftClient client = MinecraftClient.getInstance(); - if (!(Utils.isInDungeons() && inBoss && client.player != null && client.world != null)) return; + if (!(Utils.isInDungeons() && DungeonManager.isInBoss() && client.player != null && client.world != null)) return; Block currentColor = client.world.getBlockState(new BlockPos(5, 110, 42)).getBlock(); if (!(WOOL_TO_FORMATTING.containsKey(currentColor) && !currentColor.equals(lastColor))) return; @@ -117,18 +113,8 @@ public class LividColor { } private static void reset() { - inBoss = false; lastColor = Blocks.AIR; toggleTime = 0; isInitialized = false; } - - private static void onChatMessage(Text text, boolean overlay) { - DungeonsConfig.Livid config = SkyblockerConfigManager.get().dungeons.livid; - if (Utils.isInDungeons() && (config.enableLividColorText || config.enableLividColorTitle || config.enableLividColorGlow || config.enableLividColorBoundingBox) && !inBoss) { - String unformatted = Formatting.strip(text.getString()); - - inBoss = unformatted.equals("[BOSS] Livid: Welcome, you've arrived right on time. I am Livid, the Master of Shadows."); - } - } } |