From a9aa80a1764054eda7fef37417aed868130ad890 Mon Sep 17 00:00:00 2001 From: Aaron <51387595+AzureAaron@users.noreply.github.com> Date: Sat, 11 Nov 2023 03:25:13 -0500 Subject: Repackage MobGlow I forgot to put the new entity package under skyblock --- .../java/de/hysky/skyblocker/entity/MobGlow.java | 83 ---------------------- .../hysky/skyblocker/mixin/WorldRendererMixin.java | 2 +- .../hysky/skyblocker/skyblock/entity/MobGlow.java | 83 ++++++++++++++++++++++ 3 files changed, 84 insertions(+), 84 deletions(-) delete mode 100644 src/main/java/de/hysky/skyblocker/entity/MobGlow.java create mode 100644 src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java (limited to 'src/main/java/de/hysky') diff --git a/src/main/java/de/hysky/skyblocker/entity/MobGlow.java b/src/main/java/de/hysky/skyblocker/entity/MobGlow.java deleted file mode 100644 index 0c7dd3f4..00000000 --- a/src/main/java/de/hysky/skyblocker/entity/MobGlow.java +++ /dev/null @@ -1,83 +0,0 @@ -package de.hysky.skyblocker.entity; - -import java.util.List; - -import de.hysky.skyblocker.config.SkyblockerConfigManager; -import de.hysky.skyblocker.skyblock.dungeon.LividColor; -import de.hysky.skyblocker.utils.Utils; -import de.hysky.skyblocker.utils.render.culling.OcclusionCulling; -import net.minecraft.entity.Entity; -import net.minecraft.entity.decoration.ArmorStandEntity; -import net.minecraft.entity.passive.BatEntity; -import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.predicate.entity.EntityPredicates; -import net.minecraft.util.Formatting; -import net.minecraft.util.math.Box; -import net.minecraft.world.World; - -public class MobGlow { - public static boolean shouldMobGlow(Entity entity) { - Box box = entity.getBoundingBox(); - - if (!entity.isInvisible() && OcclusionCulling.isVisible(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ)) { - String name = entity.getName().getString(); - - // Dungeons - if (Utils.isInDungeons()) { - - // Minibosses - if (entity instanceof PlayerEntity) { - switch (name) { - case "Lost Adventurer", "Shadow Assassin", "Diamond Guy": return SkyblockerConfigManager.get().locations.dungeons.starredMobGlow; - case "Arcade Livid", "Crossed Livid", "Doctor Livid", "Frog Livid", "Hockey Livid", - "Purple Livid", "Scream Livid", "Smile Livid", "Vendetta Livid": return LividColor.shouldGlow(name); - } - } - - // Regular Mobs - if (!(entity instanceof ArmorStandEntity)) { - List armorStands = getArmorStands(entity.getWorld(), box); - - if (!armorStands.isEmpty() && armorStands.get(0).getName().getString().contains("✯")) return SkyblockerConfigManager.get().locations.dungeons.starredMobGlow; - } - - // Bats - return SkyblockerConfigManager.get().locations.dungeons.starredMobGlow && entity instanceof BatEntity; - } - - // Rift - if (Utils.isInTheRift()) { - if (entity instanceof PlayerEntity) { - switch (name) { - // They have a space in their name for some reason... - case "Blobbercyst ": return SkyblockerConfigManager.get().locations.rift.blobbercystGlow; - } - } - } - } - - return false; - } - - private static List getArmorStands(World world, Box box) { - return world.getEntitiesByClass(ArmorStandEntity.class, box.expand(0, 2, 0), EntityPredicates.NOT_MOUNTED); - } - - public static int getGlowColor(Entity entity) { - String name = entity.getName().getString(); - - if (entity instanceof PlayerEntity) { - return switch (name) { - case "Lost Adventurer" -> 0xfee15c; - case "Shadow Assassin" -> 0x5b2cb2; - case "Diamond Guy" -> 0x57c2f7; - case "Arcade Livid", "Crossed Livid", "Doctor Livid", "Frog Livid", "Hockey Livid", - "Purple Livid", "Scream Livid", "Smile Livid", "Vendetta Livid" -> LividColor.getGlowColor(name); - case "Blobbercyst " -> Formatting.GREEN.getColorValue(); - default -> 0xf57738; - }; - } - - return 0xf57738; - } -} diff --git a/src/main/java/de/hysky/skyblocker/mixin/WorldRendererMixin.java b/src/main/java/de/hysky/skyblocker/mixin/WorldRendererMixin.java index 03c8f93f..42601546 100644 --- a/src/main/java/de/hysky/skyblocker/mixin/WorldRendererMixin.java +++ b/src/main/java/de/hysky/skyblocker/mixin/WorldRendererMixin.java @@ -9,7 +9,7 @@ import com.llamalad7.mixinextras.sugar.Local; import com.llamalad7.mixinextras.sugar.Share; import com.llamalad7.mixinextras.sugar.ref.LocalBooleanRef; -import de.hysky.skyblocker.entity.MobGlow; +import de.hysky.skyblocker.skyblock.entity.MobGlow; import net.minecraft.client.render.WorldRenderer; import net.minecraft.entity.Entity; diff --git a/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java b/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java new file mode 100644 index 00000000..5e0995e6 --- /dev/null +++ b/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java @@ -0,0 +1,83 @@ +package de.hysky.skyblocker.skyblock.entity; + +import java.util.List; + +import de.hysky.skyblocker.config.SkyblockerConfigManager; +import de.hysky.skyblocker.skyblock.dungeon.LividColor; +import de.hysky.skyblocker.utils.Utils; +import de.hysky.skyblocker.utils.render.culling.OcclusionCulling; +import net.minecraft.entity.Entity; +import net.minecraft.entity.decoration.ArmorStandEntity; +import net.minecraft.entity.passive.BatEntity; +import net.minecraft.entity.player.PlayerEntity; +import net.minecraft.predicate.entity.EntityPredicates; +import net.minecraft.util.Formatting; +import net.minecraft.util.math.Box; +import net.minecraft.world.World; + +public class MobGlow { + public static boolean shouldMobGlow(Entity entity) { + Box box = entity.getBoundingBox(); + + if (!entity.isInvisible() && OcclusionCulling.isVisible(box.minX, box.minY, box.minZ, box.maxX, box.maxY, box.maxZ)) { + String name = entity.getName().getString(); + + // Dungeons + if (Utils.isInDungeons()) { + + // Minibosses + if (entity instanceof PlayerEntity) { + switch (name) { + case "Lost Adventurer", "Shadow Assassin", "Diamond Guy": return SkyblockerConfigManager.get().locations.dungeons.starredMobGlow; + case "Arcade Livid", "Crossed Livid", "Doctor Livid", "Frog Livid", "Hockey Livid", + "Purple Livid", "Scream Livid", "Smile Livid", "Vendetta Livid": return LividColor.shouldGlow(name); + } + } + + // Regular Mobs + if (!(entity instanceof ArmorStandEntity)) { + List armorStands = getArmorStands(entity.getWorld(), box); + + if (!armorStands.isEmpty() && armorStands.get(0).getName().getString().contains("✯")) return SkyblockerConfigManager.get().locations.dungeons.starredMobGlow; + } + + // Bats + return SkyblockerConfigManager.get().locations.dungeons.starredMobGlow && entity instanceof BatEntity; + } + + // Rift + if (Utils.isInTheRift()) { + if (entity instanceof PlayerEntity) { + switch (name) { + // They have a space in their name for some reason... + case "Blobbercyst ": return SkyblockerConfigManager.get().locations.rift.blobbercystGlow; + } + } + } + } + + return false; + } + + private static List getArmorStands(World world, Box box) { + return world.getEntitiesByClass(ArmorStandEntity.class, box.expand(0, 2, 0), EntityPredicates.NOT_MOUNTED); + } + + public static int getGlowColor(Entity entity) { + String name = entity.getName().getString(); + + if (entity instanceof PlayerEntity) { + return switch (name) { + case "Lost Adventurer" -> 0xfee15c; + case "Shadow Assassin" -> 0x5b2cb2; + case "Diamond Guy" -> 0x57c2f7; + case "Arcade Livid", "Crossed Livid", "Doctor Livid", "Frog Livid", "Hockey Livid", + "Purple Livid", "Scream Livid", "Smile Livid", "Vendetta Livid" -> LividColor.getGlowColor(name); + case "Blobbercyst " -> Formatting.GREEN.getColorValue(); + default -> 0xf57738; + }; + } + + return 0xf57738; + } +} -- cgit