Skip to content

Commit

Permalink
Use tags for most spectral logic
Browse files Browse the repository at this point in the history
Doesn't sync properly to client side, needs to get looked into for rendering purposes
  • Loading branch information
ACGaming committed Jun 23, 2024
1 parent bce0005 commit 7b36e13
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ else if (this.getHealth() > this.getMaxHealth() * 0.25)
{
onSneakPhase();
}
if (this.getAttackTarget() != null && this.getAttackTarget().getCustomNameTag().contains("Spectral"))
if (this.getAttackTarget() != null && this.getAttackTarget().getEntityData().getBoolean("IsSpectral"))
{
this.setAttackTarget(null);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,16 +34,15 @@ public static void onScytheReap(LivingDeathEvent event)
World world = entity.getEntityWorld();
DamageSource damageSource = event.getSource();
Entity trueSource = damageSource.getTrueSource();
if (trueSource instanceof EntityPlayer && isPlayerReap((EntityPlayer) trueSource, damageSource) && !entity.getCustomNameTag().contains("Spectral"))
if (trueSource instanceof EntityPlayer && isPlayerReap((EntityPlayer) trueSource, damageSource) && !entity.getEntityData().getBoolean("IsSpectral"))
{
spawnSoul(world, entity);
}
else if (trueSource instanceof HSEntityHarbinger)
{
spawnSpectralEntity(world, entity, entity.getPosition());
}
// TODO: Set entity data to determine spectral variant
else if (!world.isRemote && entity.getCustomNameTag().contains("Spectral"))
else if (!world.isRemote && entity.getEntityData().getBoolean("IsSpectral"))
{
entity.dropItem(HSItems.soul_essence, 1);
}
Expand All @@ -64,7 +63,7 @@ public static void spawnSpectralEntity(World world, EntityLivingBase entity, Blo
// Reanimate original entity
if (isWhitelistedMob(entity))
{
// TODO: Set entity data to determine spectral variant
entity.getEntityData().setBoolean("IsSpectral", true);
entity.setCustomNameTag("Spectral " + entity.getName());
entity.setHealth(entity.getMaxHealth());
entity.deathTime = 0;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,7 @@ public class HSLivingDropsEvent
public static void onLivingDrops(LivingDropsEvent event)
{
EntityLivingBase entity = event.getEntityLiving();
// TODO: Set entity data to determine spectral variant
if (entity.getCustomNameTag().contains("Spectral"))
if (entity.getEntityData().getBoolean("IsSpectral"))
{
event.getDrops().clear();
}
Expand Down

0 comments on commit 7b36e13

Please sign in to comment.