Use XoRoShiRo128PlusPlusRandom instead of XoRoShiRo128PlusRandom

This commit is contained in:
Bud Gidiere
2020-11-19 17:38:45 -06:00
parent 3915cad372
commit bb4ecee1f8
14 changed files with 32 additions and 43 deletions

View File

@@ -3,7 +3,7 @@ package com.dfsek.terra.carving;
import com.dfsek.terra.TerraWorld;
import com.dfsek.terra.biome.UserDefinedBiome;
import com.dfsek.terra.config.base.ConfigPack;
import it.unimi.dsi.util.XoRoShiRo128PlusRandom;
import it.unimi.dsi.util.XoRoShiRo128PlusPlusRandom;
import org.apache.commons.math3.util.FastMath;
import org.bukkit.World;
import org.bukkit.util.Vector;
@@ -41,7 +41,7 @@ public class UserDefinedCarver extends Carver {
@Override
public Worm getWorm(long l, Vector vector) {
Random r = new XoRoShiRo128PlusRandom(l + hash);
Random r = new XoRoShiRo128PlusPlusRandom(l + hash);
return new UserDefinedWorm(length.get(r) / 2, r, vector, radius.getMax(), topCut, bottomCut);
}
@@ -60,7 +60,7 @@ public class UserDefinedCarver extends Carver {
@Override
public boolean isChunkCarved(World w, int chunkX, int chunkZ, Random random) {
ConfigPack c = TerraWorld.getWorld(w).getConfig();
return new XoRoShiRo128PlusRandom(random.nextLong() + hash).nextInt(100) < c.getBiome((UserDefinedBiome) TerraWorld.getWorld(w).getGrid().getBiome(chunkX << 4, chunkZ << 4, GenerationPhase.POPULATE)).getCarverChance(this);
return new XoRoShiRo128PlusPlusRandom(random.nextLong() + hash).nextInt(100) < c.getBiome((UserDefinedBiome) TerraWorld.getWorld(w).getGrid().getBiome(chunkX << 4, chunkZ << 4, GenerationPhase.POPULATE)).getCarverChance(this);
}
private class UserDefinedWorm extends Worm {