From 1036391bab98180a10aee525945f6a677f05b19a Mon Sep 17 00:00:00 2001 From: Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> Date: Mon, 12 Aug 2024 13:03:50 +0800 Subject: Apply MobGlow suggestions --- .../de/hysky/skyblocker/skyblock/entity/MobGlow.java | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'src/main/java/de') diff --git a/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java b/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java index eeb4005c..b0436dd1 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java @@ -40,7 +40,7 @@ public class MobGlow { private static final ConcurrentHashMap canSeeCache = new ConcurrentHashMap<>(); public static void init() { - Scheduler.INSTANCE.scheduleCyclic(MobGlow::clearCache, 300*20); + Scheduler.INSTANCE.scheduleCyclic(MobGlow::clearCache, 300 * 20); } public static boolean shouldMobGlow(Entity entity) { @@ -75,15 +75,6 @@ public class MobGlow { } private static boolean computeShouldMobGlow(Entity entity) { - - if (entity.isInvisible()) { - return switch (entity) { - case ArmorStandEntity armorStand when Utils.isInTheEnd() && SlayerUtils.isInSlayer() && isNukekubiHead(armorStand) -> - SkyblockerConfigManager.get().slayers.endermanSlayer.highlightNukekubiHeads; - default -> false; - }; - } - String name = entity.getName().getString(); // Dungeons @@ -123,6 +114,9 @@ public class MobGlow { case WolfEntity wolf when SlayerUtils.isInSlayerQuestType(SlayerUtils.SVEN) -> SlayerEntitiesGlow.shouldGlow(wolf.getUuid()); case BlazeEntity blaze when SlayerUtils.isInSlayerQuestType(SlayerUtils.DEMONLORD) -> SlayerEntitiesGlow.shouldGlow(blaze.getUuid()); + // Enderman Slayer's Nukekubi Skulls + case ArmorStandEntity armorStand when Utils.isInTheEnd() && SlayerUtils.isInSlayer() && isNukekubiHead(armorStand) -> SkyblockerConfigManager.get().slayers.endermanSlayer.highlightNukekubiHeads; + // Blaze Slayer's Demonic minions case WitherSkeletonEntity e when SkyblockerConfigManager.get().slayers.highlightBosses == SlayersConfig.HighlightSlayerEntities.GLOW -> SlayerUtils.isInSlayerType(SlayerUtils.DEMONLORD) && e.distanceTo(MinecraftClient.getInstance().player) <= 15; case ZombifiedPiglinEntity e when SkyblockerConfigManager.get().slayers.highlightBosses == SlayersConfig.HighlightSlayerEntities.GLOW -> SlayerUtils.isInSlayerType(SlayerUtils.DEMONLORD) && e.distanceTo(MinecraftClient.getInstance().player) <= 15; @@ -196,7 +190,7 @@ public class MobGlow { return Streams.stream(entity.getArmorItems()).map(ItemUtils::getHeadTexture).anyMatch(headTexture -> headTexture.contains(NUKEKUBI_HEAD_TEXTURE)); } - private record CacheEntry(boolean value, long timestamp){} + private record CacheEntry(boolean value, long timestamp) {} private static void clearCache() { canSeeCache.clear(); -- cgit