Skip to content

Commit

Permalink
1.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
wode490390 committed Jul 24, 2019
1 parent c94df4d commit 68fcaab
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>cn.wode490390.nukkit</groupId>
<artifactId>vanillagenerator</artifactId>
<version>1.0.0</version>
<version>1.0.1</version>
<name>BetterVanillaGenerator</name>
<description>Better vanilla generator plugin for Nukkit</description>
<inceptionYear>2018</inceptionYear>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import cn.nukkit.block.Block;
import cn.nukkit.level.ChunkManager;
import cn.nukkit.level.Level;
import cn.nukkit.level.biome.Biome;
import cn.nukkit.level.biome.EnumBiome;
import cn.nukkit.level.format.generic.BaseFullChunk;
import cn.nukkit.level.generator.Generator;
Expand Down Expand Up @@ -294,7 +295,7 @@ public void populateChunk(int chunkX, int chunkZ) {
this.populators.forEach((populator) -> {
populator.populate(this.level, chunkX, chunkZ, this.nukkitRandom, chunk);
});
EnumBiome.getBiome(chunk.getBiomeId(7, 7)).populateChunk(this.level, chunkX, chunkZ, this.nukkitRandom); //NOTE: Biome.getBiome(
Biome.getBiome(chunk.getBiomeId(7, 7)).populateChunk(this.level, chunkX, chunkZ, this.nukkitRandom);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,12 +217,12 @@ public void generateChunk(int chunkX, int chunkZ) {
double avgHeightScale = 0;
double avgHeightBase = 0;
double totalWeight = 0;
int biome = EnumBiome.getBiome(biomeGrid[i + 2 + (j + 2) * 10]).getId(); //NOTE: Biome.getBiome(
int biome = Biome.getBiome(biomeGrid[i + 2 + (j + 2) * 10]).getId();
BiomeHeight biomeHeight = HEIGHT_MAP.getOrDefault(biome, defaultHeight);
// Sampling an average height base and scale by visiting the neighborhood of the current biomegrid column.
for (int m = 0; m < 5; m++) {
for (int n = 0; n < 5; n++) {
int nearBiome = EnumBiome.getBiome(biomeGrid[i + m + (j + n) * 10]).getId(); //NOTE: Biome.getBiome(
int nearBiome = Biome.getBiome(biomeGrid[i + m + (j + n) * 10]).getId();
BiomeHeight nearBiomeHeight = HEIGHT_MAP.getOrDefault(nearBiome, defaultHeight);
double heightBase = biomeHeightOffset + nearBiomeHeight.getHeight() * biomeHeightWeight;
double heightScale = biomeScaleOffset + nearBiomeHeight.getScale() * biomeScaleWeight;
Expand Down Expand Up @@ -384,7 +384,7 @@ public void populateChunk(int chunkX, int chunkZ) {
this.populators.forEach((populator) -> {
populator.populate(this.level, chunkX, chunkZ, this.nukkitRandom, chunk);
});
EnumBiome.getBiome(chunk.getBiomeId(7, 7)).populateChunk(this.level, chunkX, chunkZ, this.nukkitRandom); //NOTE: Biome.getBiome(
Biome.getBiome(chunk.getBiomeId(7, 7)).populateChunk(this.level, chunkX, chunkZ, this.nukkitRandom);
}

@Override
Expand Down

0 comments on commit 68fcaab

Please sign in to comment.