diff options
author | olim <bobq4582@gmail.com> | 2024-07-03 17:45:35 +0100 |
---|---|---|
committer | Kevinthegreat <92656833+kevinthegreat1@users.noreply.github.com> | 2024-07-05 11:21:01 +0800 |
commit | 6863c696e9ce34854aabdf0a4e2883e7ea8be0a8 (patch) | |
tree | 75caf94325de1d5eec27d359f46286765b249463 /src/main/java/de/hysky/skyblocker/skyblock/entity | |
parent | 6925e532474c393223023690d708ebe7e5e6bab0 (diff) | |
download | Skyblocker-6863c696e9ce34854aabdf0a4e2883e7ea8be0a8.tar.gz Skyblocker-6863c696e9ce34854aabdf0a4e2883e7ea8be0a8.tar.bz2 Skyblocker-6863c696e9ce34854aabdf0a4e2883e7ea8be0a8.zip |
clean code and implement requested changes
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/entity')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java | 14 |
1 files changed, 11 insertions, 3 deletions
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<ArmorStandEntity> 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<ArmorStandEntity> armorStands = getArmorStands(entity); if (armorStands.isEmpty()) { - return null; + return ""; } return armorStands.getFirst().getName().getString(); } |