diff options
author | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-15 01:36:50 -0230 |
---|---|---|
committer | ThatGravyBoat <thatgravyboat@gmail.com> | 2021-07-15 01:36:50 -0230 |
commit | 718740e85f48b57bf712a62f811cd4d34dd98450 (patch) | |
tree | 8d3c7751cf684fe98e513010233f7b7b46e3e351 /src/main/java/com/thatgravyboat/skyblockhud/api | |
parent | 89fa98d85546eb93064ce4a2b66e79341750b577 (diff) | |
download | SkyblockHud-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')
4 files changed, 28 insertions, 3 deletions
diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/KillTracking.java b/src/main/java/com/thatgravyboat/skyblockhud/api/KillTracking.java index 32feb1b..c13a7b8 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/api/KillTracking.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/api/KillTracking.java @@ -7,6 +7,7 @@ import java.util.HashSet; import java.util.Set; import java.util.UUID; import net.minecraft.client.Minecraft; +import net.minecraft.nbt.NBTTagCompound; import net.minecraft.util.DamageSource; import net.minecraftforge.common.MinecraftForge; import net.minecraftforge.event.entity.EntityJoinWorldEvent; @@ -32,7 +33,9 @@ public class KillTracking { System.out.println("----------------------------------------------------------------------------------------------------------------"); System.out.println("Name : " + event.entity.getName()); System.out.println("UUID : " + event.entity.getUniqueID()); - System.out.println("Tag : " + event.entity.serializeNBT()); + NBTTagCompound compound = new NBTTagCompound(); + event.entity.writeToNBT(compound); + System.out.println("Tag : " + compound); System.out.println("Damage : " + getDamageSourceString(event.source)); System.out.println("SBH Entity ID: " + EntityTypeRegistry.getEntityId(event.entity)); System.out.println("----------------------------------------------------------------------------------------------------------------"); diff --git a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SkyBlockEntityKilled.java b/src/main/java/com/thatgravyboat/skyblockhud/api/events/SkyBlockEntityKilled.java index 325781c..15fb01a 100644 --- a/src/main/java/com/thatgravyboat/skyblockhud/api/events/SkyBlockEntityKilled.java +++ b/src/main/java/com/thatgravyboat/skyblockhud/api/events/SkyBlockEntityKilled.java @@ -1,14 +1,16 @@ package com.thatgravyboat.skyblockhud.api.events; +import javax.annotation.Nullable; import net.minecraft.entity.Entity; import net.minecraftforge.fml.common.eventhandler.Event; public class SkyBlockEntityKilled extends Event { public String id; + @Nullable public Entity entity; - public SkyBlockEntityKilled(String id, Entity entity) { + public SkyBlockEntityKilled(String id, @Nullable Entity entity) { this.id = id; this.entity = entity; } 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) { |