mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-06-18 06:40:55 +00:00
fully implement resolution in BiomeExtrusionProvider
This commit is contained in:
+14
-14
@@ -1,16 +1,14 @@
|
|||||||
package com.dfsek.terra.addons.biome.extrusion;
|
package com.dfsek.terra.addons.biome.extrusion;
|
||||||
|
|
||||||
import com.dfsek.terra.addons.biome.extrusion.api.Extrusion;
|
|
||||||
import com.dfsek.terra.api.util.Column;
|
|
||||||
import com.dfsek.terra.api.world.biome.Biome;
|
|
||||||
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
|
||||||
import com.dfsek.terra.api.world.info.WorldProperties;
|
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
import java.util.Optional;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import com.dfsek.terra.addons.biome.extrusion.api.Extrusion;
|
||||||
|
import com.dfsek.terra.api.world.biome.Biome;
|
||||||
|
import com.dfsek.terra.api.world.biome.generation.BiomeProvider;
|
||||||
|
|
||||||
|
|
||||||
public class BiomeExtrusionProvider implements BiomeProvider {
|
public class BiomeExtrusionProvider implements BiomeProvider {
|
||||||
private final BiomeProvider delegate;
|
private final BiomeProvider delegate;
|
||||||
@@ -28,6 +26,14 @@ public class BiomeExtrusionProvider implements BiomeProvider {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Biome getBiome(int x, int y, int z, long seed) {
|
public Biome getBiome(int x, int y, int z, long seed) {
|
||||||
|
x /= resolution;
|
||||||
|
y /= resolution;
|
||||||
|
z /= resolution;
|
||||||
|
|
||||||
|
x *= resolution;
|
||||||
|
y *= resolution;
|
||||||
|
z *= resolution;
|
||||||
|
|
||||||
Biome delegated = delegate.getBiome(x, y, z, seed);
|
Biome delegated = delegate.getBiome(x, y, z, seed);
|
||||||
|
|
||||||
for(Extrusion extrusion : extrusions) {
|
for(Extrusion extrusion : extrusions) {
|
||||||
@@ -42,19 +48,13 @@ public class BiomeExtrusionProvider implements BiomeProvider {
|
|||||||
return delegate.getBaseBiome(x, z, seed);
|
return delegate.getBaseBiome(x, z, seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Biome getBiome(int x, int y, int z, long seed, Biome biome) {
|
|
||||||
for(Extrusion extrusion : extrusions) {
|
|
||||||
biome = extrusion.extrude(biome, x, y, z, seed);
|
|
||||||
}
|
|
||||||
return biome;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Iterable<Biome> getBiomes() {
|
public Iterable<Biome> getBiomes() {
|
||||||
return biomes;
|
return biomes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getResolution() {
|
@Override
|
||||||
|
public int resolution() {
|
||||||
return resolution;
|
return resolution;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+2
-3
@@ -86,9 +86,8 @@ public class BiomePipelineProvider implements BiomeProvider {
|
|||||||
z += mutator.noise(seed + 2, x, z) * noiseAmp;
|
z += mutator.noise(seed + 2, x, z) * noiseAmp;
|
||||||
|
|
||||||
|
|
||||||
x = FastMath.floorDiv(x, resolution);
|
x /= resolution;
|
||||||
|
z /= resolution;
|
||||||
z = FastMath.floorDiv(z, resolution);
|
|
||||||
|
|
||||||
int fdX = FastMath.floorDiv(x, pipeline.getSize());
|
int fdX = FastMath.floorDiv(x, pipeline.getSize());
|
||||||
int fdZ = FastMath.floorDiv(z, pipeline.getSize());
|
int fdZ = FastMath.floorDiv(z, pipeline.getSize());
|
||||||
|
|||||||
Reference in New Issue
Block a user