Sculk Horde

Sculk Horde

633k Downloads

Accessing LegacyRandomSource from multiple threads

Mikeatron-User opened this issue ยท 1 comments

commented

Minecraft 1.20.1
Forge 47.2.0
Sculk Horde 1.20.1-0.8.6

Crash Log: Here

commented

Fixed by replacing

protected void spawnParticleEffects()
{
    this.level().addParticle(ParticleTypes.SCULK_SOUL, this.getRandomX(2.0D), this.getRandomY(), this.getRandomZ(2.0D), 0.0D, 0.0D, 0.0D);
}

with

protected void spawnParticleEffects()
{
  Random random = new Random();
  float maxOffset = 2;
  float randomXOffset = random.nextFloat(maxOffset * 2) - maxOffset;
  float randomYOffset = random.nextFloat(maxOffset * 2) - maxOffset;
  float randomZOffset = random.nextFloat(maxOffset * 2) - maxOffset;
  this.level().addParticle(ParticleTypes.SCULK_SOUL, getX() + randomXOffset, getY() + randomYOffset, getZ() + randomZOffset, randomXOffset * 0.1, randomYOffset * 0.1, randomZOffset * 0.1);
}