Merge tree and flora population, increase performance of both.

This commit is contained in:
dfsek
2020-10-13 18:25:22 -07:00
parent 49045eca06
commit 064a30190c
8 changed files with 42 additions and 88 deletions

View File

@@ -13,10 +13,8 @@ import com.dfsek.terra.population.FloraPopulator;
import com.dfsek.terra.population.OrePopulator;
import com.dfsek.terra.population.SnowPopulator;
import com.dfsek.terra.population.StructurePopulator;
import com.dfsek.terra.population.TreePopulator;
import com.dfsek.terra.structure.StructureSpawnRequirement;
import com.dfsek.terra.util.DataUtil;
import org.bukkit.Bukkit;
import org.bukkit.Chunk;
import org.bukkit.Material;
import org.bukkit.World;
@@ -55,7 +53,6 @@ public class TerraChunkGenerator extends GaeaChunkGenerator {
public TerraChunkGenerator() {
super(ChunkInterpolator.InterpolationType.TRILINEAR);
popMan.attach(new TreePopulator());
popMan.attach(new FloraPopulator());
popMan.attach(new OrePopulator());
popMan.attach(new SnowPopulator());

View File

@@ -11,15 +11,13 @@ public class UserDefinedDecorator extends Decorator {
private final ProbabilityCollection<Flora> flora;
private final ProbabilityCollection<Tree> trees;
private final int floraChance;
private final int treeChance;
private final int treeDensity;
public UserDefinedDecorator(ProbabilityCollection<Flora> flora, ProbabilityCollection<Tree> trees, int floraChance, int treeChance, int treeDensity) {
public UserDefinedDecorator(ProbabilityCollection<Flora> flora, ProbabilityCollection<Tree> trees, int floraChance, int treeDensity) {
this.flora = flora;
this.trees = trees;
this.floraChance = floraChance;
this.treeChance = treeChance;
this.treeDensity = treeDensity;
}
@@ -28,10 +26,6 @@ public class UserDefinedDecorator extends Decorator {
return trees;
}
public int getTreeChance() {
return treeChance;
}
@Override
public int getTreeDensity() {
return treeDensity;