mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-20 23:30:29 +00:00
That's quite the commit you got there
This commit is contained in:
@@ -26,7 +26,7 @@ public class BiomeZone {
|
||||
this.noise.setNoiseType(FastNoiseLite.NoiseType.OpenSimplex2);
|
||||
this.noise.setFractalType(FastNoiseLite.FractalType.FBm);
|
||||
this.noise.setFractalOctaves(4);
|
||||
this.noise.setFrequency(wc.getConfig().zoneFreq);
|
||||
this.noise.setFrequency(wc.getConfig().getTemplate().getZoneFreq());
|
||||
this.grids = grids;
|
||||
imageLoader = wc.imageLoader;
|
||||
useImage = wc.fromImage;
|
||||
|
||||
4
src/main/java/com/dfsek/terra/biome/OreEntry.java
Normal file
4
src/main/java/com/dfsek/terra/biome/OreEntry.java
Normal file
@@ -0,0 +1,4 @@
|
||||
package com.dfsek.terra.biome;
|
||||
|
||||
public class OreEntry {
|
||||
}
|
||||
10
src/main/java/com/dfsek/terra/biome/PaletteHolder.java
Normal file
10
src/main/java/com/dfsek/terra/biome/PaletteHolder.java
Normal file
@@ -0,0 +1,10 @@
|
||||
package com.dfsek.terra.biome;
|
||||
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.polydev.gaea.world.palette.Palette;
|
||||
|
||||
public class PaletteHolder {
|
||||
public Palette<BlockData> getPalette(int y) {
|
||||
return null; // TODO: implementation
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,8 @@
|
||||
package com.dfsek.terra.biome;
|
||||
|
||||
import com.dfsek.terra.config.genconfig.biome.BiomeConfig;
|
||||
import com.dfsek.terra.config.genconfig.biome.GeneratorOptions;
|
||||
import com.dfsek.terra.WorldObject;
|
||||
import com.dfsek.terra.config.builder.GeneratorBuilder;
|
||||
import com.dfsek.terra.config.templates.BiomeTemplate;
|
||||
import com.dfsek.terra.generation.UserDefinedDecorator;
|
||||
import org.bukkit.World;
|
||||
import org.polydev.gaea.biome.Biome;
|
||||
@@ -14,16 +15,16 @@ import java.util.List;
|
||||
/**
|
||||
* Class representing a config-defined biome
|
||||
*/
|
||||
public class UserDefinedBiome implements Biome {
|
||||
private final GeneratorOptions gen;
|
||||
public class UserDefinedBiome implements Biome, WorldObject {
|
||||
private final GeneratorBuilder gen;
|
||||
private final UserDefinedDecorator decorator;
|
||||
private final org.bukkit.block.Biome vanilla;
|
||||
private final String id;
|
||||
private final BiomeConfig config;
|
||||
private final BiomeTemplate config;
|
||||
private final boolean erode;
|
||||
|
||||
|
||||
public UserDefinedBiome(org.bukkit.block.Biome vanilla, UserDefinedDecorator dec, GeneratorOptions gen, boolean erode, BiomeConfig config) {
|
||||
public UserDefinedBiome(org.bukkit.block.Biome vanilla, UserDefinedDecorator dec, GeneratorBuilder gen, boolean erode, BiomeTemplate config) {
|
||||
this.vanilla = vanilla;
|
||||
this.decorator = dec;
|
||||
this.gen = gen;
|
||||
@@ -49,7 +50,7 @@ public class UserDefinedBiome implements Biome {
|
||||
*/
|
||||
@Override
|
||||
public Generator getGenerator() {
|
||||
return gen.getGenerator(0);
|
||||
return gen.build(0);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -80,12 +81,12 @@ public class UserDefinedBiome implements Biome {
|
||||
return erode;
|
||||
}
|
||||
|
||||
public BiomeConfig getConfig() {
|
||||
public BiomeTemplate getConfig() {
|
||||
return config;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Generator getGenerator(World w) {
|
||||
return gen.getGenerator(w.getSeed());
|
||||
return gen.build(w.getSeed());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
package com.dfsek.terra.biome.grid;
|
||||
|
||||
import org.bukkit.Location;
|
||||
import org.bukkit.World;
|
||||
import org.polydev.gaea.biome.Biome;
|
||||
import org.polydev.gaea.biome.BiomeGrid;
|
||||
import org.polydev.gaea.generation.GenerationPhase;
|
||||
|
||||
/**
|
||||
* BiomeGrid implementation that holds a single biome.
|
||||
*/
|
||||
public class SingleBiomeGrid extends BiomeGrid {
|
||||
private final Biome biome;
|
||||
|
||||
public SingleBiomeGrid(World w, Biome biome) {
|
||||
super(w, 0, 0, 1, 1);
|
||||
this.biome = biome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Biome getBiome(int x, int z, GenerationPhase phase) {
|
||||
return biome;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Biome getBiome(Location l) {
|
||||
return biome;
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import com.dfsek.terra.biome.UserDefinedBiome;
|
||||
import com.dfsek.terra.biome.postprocessing.CoordinatePerturb;
|
||||
import com.dfsek.terra.biome.postprocessing.ErosionNoise;
|
||||
import com.dfsek.terra.config.base.ConfigPack;
|
||||
import com.dfsek.terra.config.base.ConfigPackTemplate;
|
||||
import com.dfsek.terra.config.base.PluginConfig;
|
||||
import com.dfsek.terra.config.lang.LangUtil;
|
||||
import com.dfsek.terra.procgen.math.Vector2;
|
||||
@@ -21,16 +22,17 @@ public class TerraBiomeGrid extends BiomeGrid {
|
||||
private final BiomeZone zone;
|
||||
private CoordinatePerturb perturb;
|
||||
private ErosionNoise erode;
|
||||
private UserDefinedGrid erosionGrid;
|
||||
private BiomeGrid erosionGrid;
|
||||
|
||||
public TerraBiomeGrid(World w, double freq1, double freq2, BiomeZone zone, ConfigPack c, UserDefinedGrid erosion) {
|
||||
public TerraBiomeGrid(World w, double freq1, double freq2, BiomeZone zone, ConfigPack c, BiomeGrid erosion) {
|
||||
super(w, freq1, freq2, 0, 0);
|
||||
if(c.biomeBlend) {
|
||||
perturb = new CoordinatePerturb(c.blendFreq, c.blendAmp, w.getSeed());
|
||||
ConfigPackTemplate t = c.getTemplate();
|
||||
if(c.getTemplate().isBlend()) {
|
||||
perturb = new CoordinatePerturb(t.getBlendFreq(), t.getBlendAmp(), w.getSeed());
|
||||
}
|
||||
this.zone = zone;
|
||||
if(c.erosionEnable) {
|
||||
erode = new ErosionNoise(c.erosionFreq, c.erosionThresh, c.erosionOctaves, w.getSeed());
|
||||
if(c.getTemplate().isErode()) {
|
||||
erode = new ErosionNoise(t.getErodeFreq(), t.getErodeThresh(), t.getErodeOctaves(), w.getSeed());
|
||||
this.erosionGrid = erosion;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
package com.dfsek.terra.biome.grid;
|
||||
|
||||
import com.dfsek.terra.biome.UserDefinedBiome;
|
||||
import com.dfsek.terra.config.base.WorldConfig;
|
||||
import com.dfsek.terra.image.ImageLoader;
|
||||
import org.bukkit.Location;
|
||||
@@ -16,7 +15,7 @@ public class UserDefinedGrid extends BiomeGrid {
|
||||
private final ImageLoader.Channel channelX;
|
||||
private final ImageLoader.Channel channelZ;
|
||||
|
||||
public UserDefinedGrid(World w, double freq1, double freq2, UserDefinedBiome[][] b, WorldConfig c) {
|
||||
public UserDefinedGrid(World w, double freq1, double freq2, Biome[][] b, WorldConfig c) {
|
||||
super(w, freq1, freq2, b.length, b[0].length);
|
||||
super.setGrid(b);
|
||||
imageLoader = c.imageLoader;
|
||||
|
||||
@@ -9,7 +9,7 @@ import org.polydev.gaea.math.FastNoiseLite;
|
||||
public class CoordinatePerturb {
|
||||
private final FastNoiseLite perturbX;
|
||||
private final FastNoiseLite perturbZ;
|
||||
private final int amplitude;
|
||||
private final double amplitude;
|
||||
|
||||
/**
|
||||
* Create a CoordinatePerturb object with a given frequency, amplitude, and seed.
|
||||
@@ -18,7 +18,7 @@ public class CoordinatePerturb {
|
||||
* @param amplitude Offset amplitude
|
||||
* @param seed Noise seed
|
||||
*/
|
||||
public CoordinatePerturb(double frequency, int amplitude, long seed) {
|
||||
public CoordinatePerturb(double frequency, double amplitude, long seed) {
|
||||
perturbX = new FastNoiseLite((int) seed);
|
||||
perturbX.setNoiseType(FastNoiseLite.NoiseType.OpenSimplex2);
|
||||
perturbX.setFrequency(frequency);
|
||||
|
||||
Reference in New Issue
Block a user