Skip to content

Commit

Permalink
Add globin spawning for despawning essences
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Jul 11, 2024
1 parent aac5451 commit 0b56b94
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 deletions.
17 changes: 16 additions & 1 deletion src/main/java/mod/emt/harkenscythe/entities/HSEntityEssence.java
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,25 @@ public void onEntityUpdate()
}
}
}
if (this.ticksExisted > DESPAWN_TIME)
if (this.ticksExisted >= DESPAWN_TIME)
{
this.world.playSound(null, this.getPosition(), SoundEvents.ENTITY_GENERIC_EXTINGUISH_FIRE, SoundCategory.NEUTRAL, 1.0F, 1.5F / (this.world.rand.nextFloat() * 0.4F + 1.2F));
this.world.spawnParticle(EnumParticleTypes.CLOUD, this.posX, this.posY + 1.5D, this.posZ, 0.0D, 0.1D, 0.0D);
if (!this.world.isRemote)
{
if (this instanceof HSEntityBlood)
{
HSEntityHemoglobin hemoglobin = new HSEntityHemoglobin(this.world);
hemoglobin.setPosition(this.posX, this.posY, this.posZ);
this.world.spawnEntity(hemoglobin);
}
else if (this instanceof HSEntitySoul)
{
HSEntityEctoglobin ectoglobin = new HSEntityEctoglobin(this.world);
ectoglobin.setPosition(this.posX, this.posY, this.posZ);
this.world.spawnEntity(ectoglobin);
}
}
this.setDead();
}
++this.innerRotation;
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/mod/emt/harkenscythe/entities/HSEntitySoul.java
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,8 @@ public void readEntityFromNBT(NBTTagCompound compound)
if (compound.hasKey("OriginalEntity"))
{
NBTTagCompound originalEntityNBT = compound.getCompoundTag("OriginalEntity");
Entity originalEntity = EntityList.createEntityFromNBT(originalEntityNBT, this.world);
if (originalEntity instanceof EntityLivingBase) setOriginalEntity((EntityLivingBase) originalEntity);
Entity entityFromNBT = EntityList.createEntityFromNBT(originalEntityNBT, this.world);
if (entityFromNBT instanceof EntityLivingBase) setOriginalEntity((EntityLivingBase) entityFromNBT);
}
}

Expand Down

0 comments on commit 0b56b94

Please sign in to comment.