mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-17 22:31:52 +00:00
reformat all code
This commit is contained in:
+7
-5
@@ -49,9 +49,9 @@ public class NoiseChunkGenerator3DAddon implements AddonInitializer {
|
||||
.getOrCreateRegistry(ChunkGeneratorProvider.class)
|
||||
.register(addon.key("NOISE_3D"),
|
||||
pack -> new NoiseChunkGenerator3D(pack, platform, config.getElevationBlend(),
|
||||
config.getHorizontalRes(),
|
||||
config.getVerticalRes(), noisePropertiesPropertyKey,
|
||||
paletteInfoPropertyKey));
|
||||
config.getHorizontalRes(),
|
||||
config.getVerticalRes(), noisePropertiesPropertyKey,
|
||||
paletteInfoPropertyKey));
|
||||
event.getPack()
|
||||
.applyLoader(SlantLayer.class, SlantLayer::new);
|
||||
})
|
||||
@@ -62,8 +62,10 @@ public class NoiseChunkGenerator3DAddon implements AddonInitializer {
|
||||
.register(addon, ConfigurationLoadEvent.class)
|
||||
.then(event -> {
|
||||
if(event.is(Biome.class)) {
|
||||
event.getLoadedObject(Biome.class).getContext().put(paletteInfoPropertyKey, event.load(new BiomePaletteTemplate(platform)).get());
|
||||
event.getLoadedObject(Biome.class).getContext().put(noisePropertiesPropertyKey, event.load(new BiomeNoiseConfigTemplate()).get());
|
||||
event.getLoadedObject(Biome.class).getContext().put(paletteInfoPropertyKey,
|
||||
event.load(new BiomePaletteTemplate(platform)).get());
|
||||
event.getLoadedObject(Biome.class).getContext().put(noisePropertiesPropertyKey,
|
||||
event.load(new BiomeNoiseConfigTemplate()).get());
|
||||
}
|
||||
})
|
||||
.failThrough();
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ public class ThreadLocalNoiseHolder {
|
||||
if(holder.init && holder.y == y && holder.z == z && holder.x == x && holder.seed == seed) {
|
||||
return holder.noise;
|
||||
}
|
||||
|
||||
|
||||
double noise = sampler.noise(seed, x, y, z);
|
||||
holder.noise = noise;
|
||||
holder.x = x;
|
||||
|
||||
+2
-1
@@ -83,6 +83,7 @@ public class BiomePaletteTemplate implements ObjectTemplate<PaletteInfo> {
|
||||
slantLayers.put(threshold, layer.getPalette());
|
||||
}
|
||||
|
||||
return new PaletteInfo(builder.build(), SlantHolder.of(slantLayers, minThreshold), oceanPalette, seaLevel, slantDepth, updatePalette);
|
||||
return new PaletteInfo(builder.build(), SlantHolder.of(slantLayers, minThreshold), oceanPalette, seaLevel, slantDepth,
|
||||
updatePalette);
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -87,10 +87,10 @@ public class ChunkInterpolator {
|
||||
for(int zi = -blend; zi <= blend; zi++) {
|
||||
int blendX = (xi * step);
|
||||
int blendZ = (zi * step);
|
||||
|
||||
|
||||
int localIndex = (scaledX + maxBlend + blendX) + maxBlendAndChunk * (scaledZ + maxBlend + blendZ);
|
||||
Column<Biome> column = columns[localIndex];
|
||||
|
||||
|
||||
if(column == null) {
|
||||
column = provider.getColumn(absoluteX + blendX, absoluteZ + blendZ, seed, min, max);
|
||||
columns[localIndex] = column;
|
||||
|
||||
+1
@@ -25,6 +25,7 @@ public class LazilyEvaluatedInterpolator {
|
||||
private final int min, max;
|
||||
|
||||
private final int zMul, yMul;
|
||||
|
||||
public LazilyEvaluatedInterpolator(BiomeProvider biomeProvider, int cx, int cz, int max,
|
||||
PropertyKey<BiomeNoiseProperties> noisePropertiesKey, int min, int horizontalRes, int verticalRes,
|
||||
long seed) {
|
||||
|
||||
+1
-1
@@ -53,7 +53,7 @@ public class SamplerProvider {
|
||||
public Sampler3D getChunk(int cx, int cz, WorldProperties world, BiomeProvider provider) {
|
||||
WorldContext context = new WorldContext(cx, cz, world.getSeed(), world.getMinHeight(), world.getMaxHeight());
|
||||
return cache.get(context, c -> new Sampler3D(c.cx, c.cz, c.seed, c.minHeight, c.maxHeight, provider,
|
||||
elevationSmooth, noisePropertiesKey, maxBlend));
|
||||
elevationSmooth, noisePropertiesKey, maxBlend));
|
||||
}
|
||||
|
||||
private record WorldContext(int cx, int cz, long seed, int minHeight, int maxHeight) {
|
||||
|
||||
Reference in New Issue
Block a user