mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-18 14:50:56 +00:00
reformat all code
This commit is contained in:
+2
-3
@@ -8,8 +8,6 @@
|
||||
package com.dfsek.terra.addons.chunkgenerator.generation;
|
||||
|
||||
|
||||
import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
|
||||
import net.jafama.FastMath;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
@@ -26,6 +24,7 @@ import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.chunk.generation.ChunkGenerator;
|
||||
import com.dfsek.terra.api.world.chunk.generation.ProtoChunk;
|
||||
import com.dfsek.terra.api.world.chunk.generation.util.Palette;
|
||||
import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
|
||||
|
||||
public class NoiseChunkGenerator3D implements ChunkGenerator {
|
||||
@@ -87,7 +86,7 @@ public class NoiseChunkGenerator3D implements ChunkGenerator {
|
||||
if(sampler.sample(x, y, z) > 0) {
|
||||
if(carver.sample(x, y, z) <= 0) {
|
||||
data = PaletteUtil.getPalette(x, y, z, sampler, paletteInfo, paletteLevel).get(paletteLevel, cx, y, cz,
|
||||
seed);
|
||||
seed);
|
||||
chunk.setBlock(x, y, z, data);
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -56,8 +56,8 @@ public class ChunkInterpolator {
|
||||
for(int x = 0; x < 5; x++) {
|
||||
for(int z = 0; z < 5; z++) {
|
||||
BiomeNoiseProperties generationSettings = provider.getBiome(xOrigin + (x << 2), zOrigin + (z << 2), seed)
|
||||
.getContext()
|
||||
.get(BiomeNoiseProperties.class);
|
||||
.getContext()
|
||||
.get(BiomeNoiseProperties.class);
|
||||
Map<BiomeNoiseProperties, MutableInteger> genMap = new HashMap<>();
|
||||
|
||||
int step = generationSettings.blendStep();
|
||||
|
||||
+3
-6
@@ -8,12 +8,8 @@
|
||||
package com.dfsek.terra.addons.chunkgenerator.generation.math.interpolation;
|
||||
|
||||
import com.dfsek.terra.addons.chunkgenerator.config.noise.BiomeNoiseProperties;
|
||||
import com.dfsek.terra.api.util.MathUtil;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
|
||||
|
||||
public class ElevationInterpolator {
|
||||
private final double[][] values = new double[18][18];
|
||||
@@ -39,10 +35,11 @@ public class ElevationInterpolator {
|
||||
|
||||
BiomeNoiseProperties center = gens[x + 1 + smooth][z + 1 + smooth];
|
||||
boolean same = true;
|
||||
|
||||
|
||||
for(int xi = -smooth; xi <= smooth; xi++) {
|
||||
for(int zi = -smooth; zi <= smooth; zi++) {
|
||||
if(gens[x + 1 + smooth + xi][z + 1 + smooth + zi] != center) { // test referential equality because thats all we need to know
|
||||
if(gens[x + 1 + smooth + xi][z + 1 + smooth + zi] !=
|
||||
center) { // test referential equality because thats all we need to know
|
||||
same = false;
|
||||
break;
|
||||
}
|
||||
|
||||
+7
-13
@@ -17,23 +17,16 @@
|
||||
|
||||
package com.dfsek.terra.addons.chunkgenerator.generation.math.samplers;
|
||||
|
||||
import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
|
||||
import com.google.common.cache.Cache;
|
||||
import com.google.common.cache.CacheBuilder;
|
||||
import com.google.common.cache.CacheLoader;
|
||||
import com.google.common.cache.LoadingCache;
|
||||
import net.jafama.FastMath;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.util.MathUtil;
|
||||
import com.dfsek.terra.api.util.generic.pair.Pair;
|
||||
import com.dfsek.terra.api.world.World;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
|
||||
import java.util.concurrent.ExecutionException;
|
||||
|
||||
import com.dfsek.terra.api.Platform;
|
||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||
import com.dfsek.terra.api.world.info.WorldProperties;
|
||||
|
||||
|
||||
public class SamplerProvider {
|
||||
private final Cache<WorldContext, Sampler3D> cache;
|
||||
@@ -53,8 +46,9 @@ 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());
|
||||
try {
|
||||
return cache.get(context, () -> new Sampler3D(context.cx, context.cz, context.seed, context.minHeight, context.maxHeight, provider,
|
||||
elevationSmooth));
|
||||
return cache.get(context,
|
||||
() -> new Sampler3D(context.cx, context.cz, context.seed, context.minHeight, context.maxHeight, provider,
|
||||
elevationSmooth));
|
||||
} catch(ExecutionException e) {
|
||||
throw new RuntimeException(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user