mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-19 07:11:14 +00:00
make salt long
This commit is contained in:
+6
-1
@@ -1,5 +1,6 @@
|
||||
package com.dfsek.terra.addons.feature.distributor.config;
|
||||
|
||||
import com.dfsek.tectonic.annotations.Default;
|
||||
import com.dfsek.tectonic.annotations.Value;
|
||||
import com.dfsek.tectonic.loading.object.ObjectTemplate;
|
||||
import com.dfsek.terra.addons.feature.distributor.distributors.NoiseDistributor;
|
||||
@@ -10,8 +11,12 @@ public class NoiseDistributorTemplate implements ObjectTemplate<Distributor> {
|
||||
@Value("distribution")
|
||||
private NoiseSampler noise;
|
||||
|
||||
@Value("threshold")
|
||||
@Default
|
||||
private double threshold = 0;
|
||||
|
||||
@Override
|
||||
public Distributor get() {
|
||||
return new NoiseDistributor(noise);
|
||||
return new NoiseDistributor(noise, threshold);
|
||||
}
|
||||
}
|
||||
|
||||
+4
-2
@@ -6,12 +6,14 @@ import com.dfsek.terra.api.structure.feature.Distributor;
|
||||
public class NoiseDistributor implements Distributor {
|
||||
private final NoiseSampler sampler;
|
||||
|
||||
public NoiseDistributor(NoiseSampler sampler) {
|
||||
private final double threshold;
|
||||
public NoiseDistributor(NoiseSampler sampler, double threshold) {
|
||||
this.sampler = sampler;
|
||||
this.threshold = threshold;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean matches(int x, int z, long seed) {
|
||||
return sampler.getNoiseSeeded(seed, x, z) > 0;
|
||||
return sampler.getNoiseSeeded(seed, x, z) > threshold;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user