mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-18 06:10:16 +00:00
Use XoRoShiRo128PlusPlusRandom instead of XoRoShiRo128PlusRandom
This commit is contained in:
@@ -4,7 +4,7 @@ import com.dfsek.terra.procgen.GridSpawn;
|
||||
import com.dfsek.terra.procgen.voxel.DeformedSphere;
|
||||
import com.dfsek.terra.procgen.voxel.Tube;
|
||||
import com.dfsek.terra.procgen.voxel.VoxelGeometry;
|
||||
import it.unimi.dsi.util.XoRoShiRo128PlusRandom;
|
||||
import it.unimi.dsi.util.XoRoShiRo128PlusPlusRandom;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.util.Vector;
|
||||
@@ -24,7 +24,7 @@ public class Cavern {
|
||||
|
||||
public VoxelGeometry carveChunk(int chunkX, int chunkZ) {
|
||||
long seedC = MathUtil.getCarverChunkSeed(chunkX, chunkZ, seed);
|
||||
Random chunk = new XoRoShiRo128PlusRandom(seedC);
|
||||
Random chunk = new XoRoShiRo128PlusPlusRandom(seedC);
|
||||
Vector org = node.getNodeLocation((chunkX << 4) + 8, (chunkZ << 4) + 8).clone().setY(chunk.nextInt(128));
|
||||
VoxelGeometry carve = VoxelGeometry.getBlank();
|
||||
|
||||
@@ -34,7 +34,7 @@ public class Cavern {
|
||||
Bukkit.getLogger().info("Cavern: " + org.toString());
|
||||
carve.merge(new DeformedSphere(org.clone(), chunk.nextInt(4) + 3, 0.75, smpl));
|
||||
|
||||
Vector _00 = new Vector(org.getX() + 16, new XoRoShiRo128PlusRandom(MathUtil.getCarverChunkSeed(chunkX + 1, chunkZ, seed)).nextInt(128), org.getZ());
|
||||
Vector _00 = new Vector(org.getX() + 16, new XoRoShiRo128PlusPlusRandom(MathUtil.getCarverChunkSeed(chunkX + 1, chunkZ, seed)).nextInt(128), org.getZ());
|
||||
|
||||
carve.merge(new Tube(org, _00, 4));
|
||||
return carve;
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user