mirror of
https://github.com/PolyhedralDev/Terra.git
synced 2026-04-16 13:23:07 +00:00
Completely redo config
This commit is contained in:
@@ -1,49 +0,0 @@
|
||||
package com.dfsek.terra.generation;
|
||||
|
||||
import com.dfsek.terra.biome.TerraBiomeGrid;
|
||||
import com.dfsek.terra.biome.UserDefinedBiome;
|
||||
import com.dfsek.terra.config.genconfig.BiomeConfig;
|
||||
import org.bukkit.Bukkit;
|
||||
import org.bukkit.Material;
|
||||
import org.bukkit.World;
|
||||
import org.bukkit.block.BlockFace;
|
||||
import org.bukkit.block.data.BlockData;
|
||||
import org.bukkit.block.data.Waterlogged;
|
||||
import org.bukkit.block.data.type.Slab;
|
||||
import org.bukkit.block.data.type.Stairs;
|
||||
import org.bukkit.generator.ChunkGenerator;
|
||||
import org.bukkit.util.Vector;
|
||||
import org.polydev.gaea.generation.GenerationPhase;
|
||||
import org.polydev.gaea.generation.GenerationPopulator;
|
||||
import org.polydev.gaea.math.ChunkInterpolator;
|
||||
import org.polydev.gaea.world.palette.Palette;
|
||||
import org.polydev.gaea.world.palette.RandomPalette;
|
||||
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
|
||||
public class SlabGenerator extends GenerationPopulator {
|
||||
private static final BlockData AIR = Material.AIR.createBlockData();
|
||||
private static final BlockData WATER = Material.WATER.createBlockData();
|
||||
private static final Palette<BlockData> AIRPALETTE = new RandomPalette<BlockData>(new Random(2403)).add(AIR, 1);
|
||||
@Override
|
||||
public ChunkGenerator.ChunkData populate(World world, ChunkGenerator.ChunkData chunk, Random random, int chunkX, int chunkZ, ChunkInterpolator interp) {
|
||||
TerraBiomeGrid g = TerraBiomeGrid.fromWorld(world);
|
||||
for(byte x = 0; x < 16; x++) {
|
||||
for(byte z = 0; z < 16; z++) {
|
||||
int xi = (chunkX << 4) + x;
|
||||
int zi = (chunkZ << 4) + z;
|
||||
BiomeConfig config = BiomeConfig.fromBiome((UserDefinedBiome) g.getBiome(xi, zi, GenerationPhase.PALETTE_APPLY));
|
||||
if(config.getSlabs() == null) continue;
|
||||
double thresh = config.getSlabThreshold();
|
||||
for(int y = 0; y < world.getMaxHeight(); y++) {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
return chunk;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +1,11 @@
|
||||
package com.dfsek.terra.generation;
|
||||
|
||||
import com.dfsek.terra.Terra;
|
||||
import com.dfsek.terra.TerraWorld;
|
||||
import com.dfsek.terra.biome.TerraBiomeGrid;
|
||||
import com.dfsek.terra.biome.UserDefinedBiome;
|
||||
import com.dfsek.terra.config.TerraConfig;
|
||||
import com.dfsek.terra.config.base.WorldConfig;
|
||||
import com.dfsek.terra.config.genconfig.BiomeConfig;
|
||||
import com.dfsek.terra.population.CavePopulator;
|
||||
import com.dfsek.terra.population.FloraPopulator;
|
||||
@@ -59,6 +62,7 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
|
||||
if(needsLoad) load(world);
|
||||
StructureSpawnRequirement.putNoise(world, fastNoise); // Assign noise to world to be used for structures.
|
||||
ChunkData chunk = createChunkData(world);
|
||||
TerraConfig config = TerraWorld.getWorld(world).getConfig();
|
||||
int xOrig = (chunkX << 4);
|
||||
int zOrig = (chunkZ << 4);
|
||||
for(byte x = 0; x < 16; x++) {
|
||||
@@ -67,7 +71,7 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
|
||||
int cx = xOrig + x;
|
||||
int cz = zOrig + z;
|
||||
Biome b = getBiomeGrid(world).getBiome(xOrig+x, zOrig+z, GenerationPhase.PALETTE_APPLY);
|
||||
BiomeConfig c = BiomeConfig.fromBiome((UserDefinedBiome) b);
|
||||
BiomeConfig c = config.getBiome((UserDefinedBiome) b);
|
||||
int sea = c.getSeaLevel();
|
||||
Palette<BlockData> seaPalette = c.getOceanPalette();
|
||||
for(int y = world.getMaxHeight()-1; y >= 0; y--) {
|
||||
@@ -166,13 +170,13 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
|
||||
|
||||
@Override
|
||||
public List<GenerationPopulator> getGenerationPopulators(World world) {
|
||||
return Collections.singletonList(new SlabGenerator());
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public org.polydev.gaea.biome.BiomeGrid getBiomeGrid(World world) {
|
||||
return TerraBiomeGrid.fromWorld(world);
|
||||
return TerraWorld.getWorld(world).getGrid();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user