From 718740e85f48b57bf712a62f811cd4d34dd98450 Mon Sep 17 00:00:00 2001 From: ThatGravyBoat Date: Thu, 15 Jul 2021 01:36:50 -0230 Subject: Updated important locations Updated Config System (Thanks Moulberry) Added Trackers Back with kill trackers --- .../skyblockhud/api/sbentities/EntityTypeHelper.java | 18 ++++++++++++++++++ .../skyblockhud/api/sbentities/EntityTypeRegistry.java | 4 +++- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/thatgravyboat/skyblockhud/api/sbentities') diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeHelper.java b/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeHelper.java index d1ad8d2..8dc63c8 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeHelper.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeHelper.java @@ -4,7 +4,9 @@ import com.thatgravyboat.skyblockhud.location.LocationHandler; import com.thatgravyboat.skyblockhud.location.Locations; import net.minecraft.entity.Entity; import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntityZombie; import net.minecraft.init.Blocks; +import net.minecraft.init.Items; public class EntityTypeHelper { @@ -18,4 +20,20 @@ public class EntityTypeHelper { } return false; } + + public static boolean isCrypt(Entity entity){ + if (entity instanceof EntityZombie) { + EntityZombie zombie = ((EntityZombie) entity); + double maxHealthBase = zombie.getAttributeMap().getAttributeInstanceByName("generic.maxHealth").getBaseValue(); + if (maxHealthBase != 2000d) return false; + if (zombie.getEquipmentInSlot(0) == null || !zombie.getEquipmentInSlot(0).getItem().equals(Items.iron_sword)) + return false; + if (zombie.getEquipmentInSlot(1) == null || !zombie.getEquipmentInSlot(1).getItem().equals(Items.chainmail_boots)) + return false; + if (zombie.getEquipmentInSlot(2) == null || !zombie.getEquipmentInSlot(2).getItem().equals(Items.chainmail_leggings)) + return false; + return zombie.getEquipmentInSlot(3) != null && zombie.getEquipmentInSlot(3).getItem().equals(Items.chainmail_chestplate); + } + return false; + } } diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeRegistry.java b/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeRegistry.java index 952aaa7..6ff88fa 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeRegistry.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeRegistry.java @@ -6,13 +6,15 @@ import java.util.List; import java.util.Map; import net.minecraft.entity.Entity; import net.minecraft.entity.monster.EntityEnderman; +import net.minecraft.entity.monster.EntityZombie; public class EntityTypeRegistry { private static final Map, List> entities = Maps.newHashMap(); static { - entities.put(EntityEnderman.class, ImmutableList.of(SkyBlockEntity.of("zealot", EntityTypeHelper::isZealot))); + entities.put(EntityEnderman.class, ImmutableList.of(SkyBlockEntity.of("ZEALOT", EntityTypeHelper::isZealot))); + entities.put(EntityZombie.class, ImmutableList.of(SkyBlockEntity.of("CRYPT_GHOUL", EntityTypeHelper::isCrypt))); } public static String getEntityId(Entity entity) { -- cgit