TeamPeril / Sculk-Horde

Sculk Hoard implements a new end-game era to your game that once activated, will force you to fight against the newly awaked ancient sculk hoard in order to survive. This ancient enemy seeks to infect and consume the world in it's entirety.
Apache License 2.0
24 stars 7 forks source link

Accessing LegacyRandomSource from multiple threads #33

Closed Mikeatron-User closed 7 months ago

Mikeatron-User commented 7 months ago

Minecraft 1.20.1 Forge 47.2.0 Sculk Horde 1.20.1-0.8.6

Crash Log: Here

Mikeatron-User commented 7 months ago

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);
}