aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/thatgravyboat/skyblockhud/api/sbentities
diff options
context:
space:
mode:
authorThatGravyBoat <thatgravyboat@gmail.com>2021-07-15 01:36:50 -0230
committerThatGravyBoat <thatgravyboat@gmail.com>2021-07-15 01:36:50 -0230
commit718740e85f48b57bf712a62f811cd4d34dd98450 (patch)
tree8d3c7751cf684fe98e513010233f7b7b46e3e351 /src/main/java/com/thatgravyboat/skyblockhud/api/sbentities
parent89fa98d85546eb93064ce4a2b66e79341750b577 (diff)
downloadSkyblockHud-Death-Defied-718740e85f48b57bf712a62f811cd4d34dd98450.tar.gz
SkyblockHud-Death-Defied-718740e85f48b57bf712a62f811cd4d34dd98450.tar.bz2
SkyblockHud-Death-Defied-718740e85f48b57bf712a62f811cd4d34dd98450.zip
Updated important locations
Updated Config System (Thanks Moulberry) Added Trackers Back with kill trackers
Diffstat (limited to 'src/main/java/com/thatgravyboat/skyblockhud/api/sbentities')
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeHelper.java18
-rw-r--r--src/main/java/com/thatgravyboat/skyblockhud/api/sbentities/EntityTypeRegistry.java4
2 files changed, 21 insertions, 1 deletions
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<Class<? extends Entity>, List<SkyBlockEntity>> 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) {