mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2025-07-03 08:25:31 +00:00
fix tree determinism issues
This commit is contained in:
parent
764344b4ef
commit
87f7af1e1b
@ -24,7 +24,7 @@ public class TreeLayer extends PlaceableLayer<Tree> {
|
|||||||
for(int ignored : level) {
|
for(int ignored : level) {
|
||||||
current = current.getRelative(BlockFace.DOWN);
|
current = current.getRelative(BlockFace.DOWN);
|
||||||
if(item.getSpawnable().contains(current.getType())) {
|
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 final class PopulationUtil {
|
||||||
public static FastRandom getRandom(Chunk c) {
|
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));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user