From 6863c696e9ce34854aabdf0a4e2883e7ea8be0a8 Mon Sep 17 00:00:00 2001 From: olim Date: Wed, 3 Jul 2024 17:45:35 +0100 Subject: clean code and implement requested changes --- .../java/de/hysky/skyblocker/skyblock/entity/MobGlow.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/main/java/de/hysky/skyblocker/skyblock/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 index 152c09a3..81e328ca 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java @@ -62,7 +62,7 @@ public class MobGlow { case EndermanEntity enderman when Utils.isInTheEnd() && !entity.isInvisible() -> TheEnd.isSpecialZealot(enderman); //dojo - case ZombieEntity zombie when Utils.isInCrimson() && DojoManager.inArena -> DojoManager.shouldGlow(getArmourStandName(zombie)); + case ZombieEntity zombie when Utils.isInCrimson() && DojoManager.inArena -> DojoManager.shouldGlow(getArmorStandName(zombie)); default -> false; }; @@ -73,6 +73,7 @@ public class MobGlow { /** * Checks if an entity is starred by checking if its armor stand contains a star in its name. + * * @param entity the entity to check. * @return true if the entity is starred, false otherwise */ @@ -80,10 +81,17 @@ public class MobGlow { List armorStands = getArmorStands(entity); return !armorStands.isEmpty() && armorStands.getFirst().getName().getString().contains("✯"); } - public static String getArmourStandName(Entity entity) { + + /** + * Returns name of entity by finding closed armor stand and getting name of that + * + * @param entity the entity to check + * @return the name string of the entities label + */ + public static String getArmorStandName(Entity entity) { List armorStands = getArmorStands(entity); if (armorStands.isEmpty()) { - return null; + return ""; } return armorStands.getFirst().getName().getString(); } -- cgit