Skip to content

Commit

Permalink
Enable despawning of souls
Browse files Browse the repository at this point in the history
  • Loading branch information
ACGaming committed Jun 9, 2024
1 parent bc27ac0 commit 26aabc8
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main/java/mod/emt/harkenscythe/entities/HSSoul.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@

public class HSSoul extends Entity
{
private static final int DESPAWN_TIME = 6000;

public HSSoul(World worldIn)
{
super(worldIn);
Expand All @@ -40,7 +42,7 @@ public void onEntityUpdate()
{
if (!entityItem.isDead && entityItem.getItem().getItem() == HSItems.blunt_harken_blade)
{
this.world.playSound(null, this.getPosition(), HSSoundEvents.ITEM_ATHAME_CREATE, SoundCategory.PLAYERS, 1.0F, 1.5F / (this.world.rand.nextFloat() * 0.4F + 1.2F));
this.world.playSound(null, this.getPosition(), HSSoundEvents.ITEM_ATHAME_CREATE, 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);
entityItem.setDead();
this.setDead();
Expand All @@ -54,6 +56,12 @@ public void onEntityUpdate()
}
}
}
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);
this.setDead();
}
}

@Override
Expand Down

0 comments on commit 26aabc8

Please sign in to comment.