diff options
Diffstat (limited to 'src/main/java/de/hysky/skyblocker/skyblock/entity')
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/entity/MobBoundingBoxes.java | 2 | ||||
-rw-r--r-- | src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java | 24 |
2 files changed, 12 insertions, 14 deletions
diff --git a/src/main/java/de/hysky/skyblocker/skyblock/entity/MobBoundingBoxes.java b/src/main/java/de/hysky/skyblocker/skyblock/entity/MobBoundingBoxes.java index b7b3e0e0..f005fc06 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/entity/MobBoundingBoxes.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/entity/MobBoundingBoxes.java @@ -32,7 +32,7 @@ public class MobBoundingBoxes { return switch (entity) { case PlayerEntity _p when name.equals("Lost Adventurer") || name.equals("Shadow Assassin") || name.equals("Diamond Guy") -> SkyblockerConfigManager.get().dungeons.starredMobBoundingBoxes; - case PlayerEntity p when entity.getId() == LividColor.getLividID() -> LividColor.shouldDrawBoundingBox(name); + case PlayerEntity p when entity.getId() == LividColor.getCorrectLividId() -> LividColor.shouldDrawBoundingBox(name); case ArmorStandEntity _armorStand -> false; // Regular Mobs 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 1322004e..0438a8ce 100644 --- a/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java +++ b/src/main/java/de/hysky/skyblocker/skyblock/entity/MobGlow.java @@ -1,5 +1,6 @@ package de.hysky.skyblocker.skyblock.entity; +import com.google.common.collect.Streams; import de.hysky.skyblocker.config.SkyblockerConfigManager; import de.hysky.skyblocker.skyblock.crimson.dojo.DojoManager; import de.hysky.skyblocker.skyblock.dungeon.LividColor; @@ -14,7 +15,6 @@ import net.minecraft.entity.mob.EndermanEntity; import net.minecraft.entity.mob.ZombieEntity; import net.minecraft.entity.passive.BatEntity; import net.minecraft.entity.player.PlayerEntity; -import net.minecraft.item.ItemStack; import net.minecraft.predicate.entity.EntityPredicates; import net.minecraft.util.Formatting; import net.minecraft.util.math.Box; @@ -23,6 +23,10 @@ import net.minecraft.world.World; import java.util.List; public class MobGlow { + /** + * The Nukekubi head texture id is eb07594e2df273921a77c101d0bfdfa1115abed5b9b2029eb496ceba9bdbb4b3. + */ + public static final String NUKEKUBI_HEAD_TEXTURE = "eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWIwNzU5NGUyZGYyNzM5MjFhNzdjMTAxZDBiZmRmYTExMTVhYmVkNWI5YjIwMjllYjQ5NmNlYmE5YmRiYjRiMyJ9fX0="; public static boolean shouldMobGlow(Entity entity) { Box box = entity.getBoundingBox(); @@ -36,7 +40,7 @@ public class MobGlow { return switch (entity) { // Minibosses case PlayerEntity p when name.equals("Lost Adventurer") || name.equals("Shadow Assassin") || name.equals("Diamond Guy") -> SkyblockerConfigManager.get().dungeons.starredMobGlow; - case PlayerEntity p when entity.getId() == LividColor.getLividID() -> LividColor.shouldGlow(name); + case PlayerEntity p when entity.getId() == LividColor.getCorrectLividId() -> LividColor.shouldGlow(name); // Bats case BatEntity b -> SkyblockerConfigManager.get().dungeons.starredMobGlow || SkyblockerConfigManager.get().dungeons.starredMobBoundingBoxes; @@ -110,7 +114,7 @@ public class MobGlow { case PlayerEntity p when name.equals("Lost Adventurer") -> 0xfee15c; case PlayerEntity p when name.equals("Shadow Assassin") -> 0x5b2cb2; case PlayerEntity p when name.equals("Diamond Guy") -> 0x57c2f7; - case PlayerEntity p when entity.getId() == LividColor.getLividID() -> LividColor.getGlowColor(name); + case PlayerEntity p when entity.getId() == LividColor.getCorrectLividId() -> LividColor.getGlowColor(name); case PlayerEntity p when name.equals("Blobbercyst ") -> Formatting.GREEN.getColorValue(); case EndermanEntity enderman when TheEnd.isSpecialZealot(enderman) -> Formatting.RED.getColorValue(); @@ -121,16 +125,10 @@ public class MobGlow { }; } + /** + * Compares the armor items of an armor stand to the Nukekubi head texture to determine if it is a Nukekubi head. + */ private static boolean isNukekubiHead(ArmorStandEntity entity) { - boolean armorfound = false; - for (ItemStack armorItem : entity.getArmorItems()) { - // eb07594e2df273921a77c101d0bfdfa1115abed5b9b2029eb496ceba9bdbb4b3 is texture id for the nukekubi head, - // compare against it to exclusively find armorstands that are nukekubi heads - // get the texture of the nukekubi head item itself and compare it - String texture = ItemUtils.getHeadTexture(armorItem); - - armorfound |= texture.contains("eyJ0ZXh0dXJlcyI6eyJTS0lOIjp7InVybCI6Imh0dHA6Ly90ZXh0dXJlcy5taW5lY3JhZnQubmV0L3RleHR1cmUvZWIwNzU5NGUyZGYyNzM5MjFhNzdjMTAxZDBiZmRmYTExMTVhYmVkNWI5YjIwMjllYjQ5NmNlYmE5YmRiYjRiMyJ9fX0="); - } - return armorfound; + return Streams.stream(entity.getArmorItems()).map(ItemUtils::getHeadTexture).anyMatch(headTexture -> headTexture.contains(NUKEKUBI_HEAD_TEXTURE)); } } |