mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-02-16 10:30:42 +00:00
fix tree determinism issues
This commit is contained in:
@@ -24,7 +24,7 @@ public class TreeLayer extends PlaceableLayer<Tree> {
|
||||
for(int ignored : level) {
|
||||
current = current.getRelative(BlockFace.DOWN);
|
||||
if(item.getSpawnable().contains(current.getType())) {
|
||||
item.plant(current.getLocation().add(0, 1, 0), PopulationUtil.getRandom(chunk));
|
||||
item.plant(current.getLocation().add(0, 1, 0), PopulationUtil.getRandom(chunk, coords.hashCode()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -6,6 +6,10 @@ import com.dfsek.terra.api.util.FastRandom;
|
||||
|
||||
public final class PopulationUtil {
|
||||
public static FastRandom getRandom(Chunk c) {
|
||||
return new FastRandom(MathUtil.getCarverChunkSeed(c.getX(), c.getZ(), c.getWorld().getSeed()));
|
||||
return getRandom(c, 0);
|
||||
}
|
||||
|
||||
public static FastRandom getRandom(Chunk c, long salt) {
|
||||
return new FastRandom(MathUtil.getCarverChunkSeed(c.getX(), c.getZ(), c.getWorld().getSeed() + salt));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user