make SeededBuilder use unboxed long

This commit is contained in:
dfsek
2021-07-17 21:50:12 -07:00
parent 3a94c5287c
commit ec28f613d3
38 changed files with 73 additions and 79 deletions
@@ -219,19 +219,19 @@ public class BiomeTemplate implements AbstractableTemplate, ValidatedConfigTempl
//pack.getTemplate().getNoiseBuilderMap().forEach((id, builder) -> tester.registerFunction(id, new BlankFunction(builder.getDimensions()))); // Register dummy functions
try {
noiseEquation.apply(0L);
noiseEquation.build(0L);
} catch(Exception e) {
throw new ValidationException("Invalid noise sampler: ", e);
}
try {
carvingEquation.apply(0L);
carvingEquation.build(0L);
} catch(Exception e) {
throw new ValidationException("Invalid carving sampler: ", e);
}
try {
elevationEquation.apply(0L);
elevationEquation.build(0L);
} catch(Exception e) {
throw new ValidationException("Invalid elevation sampler: ", e);
}
@@ -19,11 +19,11 @@ public class UserDefinedSeededTerraBiome implements SeededTerraBiome {
}
@Override
public UserDefinedBiome apply(Long seed) {
public UserDefinedBiome build(long seed) {
synchronized(biomeMap) {
return biomeMap.computeIfAbsent(seed,
s -> {
UserDefinedGenerator generator = new UserDefinedGenerator(template.getNoiseEquation().apply(seed), template.getElevationEquation().apply(seed), template.getCarvingEquation().apply(seed), template.getBiomeNoise().apply(seed), template.getElevationWeight(),
UserDefinedGenerator generator = new UserDefinedGenerator(template.getNoiseEquation().build(seed), template.getElevationEquation().build(seed), template.getCarvingEquation().build(seed), template.getBiomeNoise().build(seed), template.getElevationWeight(),
template.getBlendDistance(), template.getBlendStep(), template.getBlendWeight());
return new UserDefinedBiome(template.getVanilla(), generator, template, context);
}