Skip to content

Commit

Permalink
Nukkit pr/new-raknet fix (#5)
Browse files Browse the repository at this point in the history
  • Loading branch information
tuilakhanh authored Sep 27, 2020
1 parent f290954 commit 7f60645
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,7 @@ public void init(ChunkManager level, NukkitRandom random) {
fire.setAmount(1);
this.populators.add(fire);

PopulatorOre ores = new PopulatorOre(NETHERRACK);
ores.setOreTypes(new OreType[]{
PopulatorOre ores = new PopulatorOre(Block.NETHERRACK, new OreType[]{
new OreType(Block.get(LAVA), 32, 1, 0, 32, NETHERRACK),
new OreType(Block.get(QUARTZ_ORE), 13, 16, 10, 118, NETHERRACK),
new OreType(Block.get(MAGMA), 32, 16, 26, 37, NETHERRACK),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
import cn.wode490390.nukkit.vanillagenerator.populator.overworld.PopulatorSnowLayers;
import cn.wode490390.nukkit.vanillagenerator.scheduler.CLNoiseReleaseTask;
import cn.wode490390.nukkit.vanillagenerator.util.OpenCL;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import com.jogamp.opencl.CLBuffer;
Expand Down Expand Up @@ -138,8 +139,8 @@ protected static void setBiomeHeight(BiomeHeight height, int... biomes) {
}
}

protected final List<Populator> generationPopulators = Lists.newArrayList();
protected final List<Populator> populators = Lists.newArrayList();
protected List<Populator> generationPopulators = Lists.newArrayList();
protected List<Populator> populators = Lists.newArrayList();
protected ChunkManager level;
protected NukkitRandom nukkitRandom;
protected long localSeed1;
Expand Down Expand Up @@ -177,26 +178,24 @@ public void init(ChunkManager level, NukkitRandom random) {
this.localSeed2 = ThreadLocalRandom.current().nextLong();
this.nukkitRandom.setSeed(this.level.getSeed());

this.generationPopulators.add(new PopulatorCaves());

PopulatorOre ores = new PopulatorOre();
ores.setOreTypes(new OreType[]{
new OreType(Block.get(COAL_ORE), 20, 17, 0, 128),
new OreType(Block.get(IRON_ORE), 20, 9, 0, 64),
new OreType(Block.get(REDSTONE_ORE), 8, 8, 0, 16),
new OreType(Block.get(LAPIS_ORE), 1, 7, 0, 16),
new OreType(Block.get(GOLD_ORE), 2, 9, 0, 32),
new OreType(Block.get(DIAMOND_ORE), 1, 8, 0, 16),
new OreType(Block.get(DIRT), 10, 33, 0, 128),
new OreType(Block.get(GRAVEL), 8, 33, 0, 128),
new OreType(Block.get(STONE, BlockStone.GRANITE), 10, 33, 0, 80),
new OreType(Block.get(STONE, BlockStone.DIORITE), 10, 33, 0, 80),
new OreType(Block.get(STONE, BlockStone.ANDESITE), 10, 33, 0, 80)
});
this.populators.add(ores);

this.populators.add(new PopulatorSnowLayers());

this.generationPopulators = ImmutableList.of(new PopulatorCaves());

this.populators = ImmutableList.of(
new PopulatorOre(STONE, new OreType[]{
new OreType(Block.get(COAL_ORE), 20, 17, 0, 128),
new OreType(Block.get(IRON_ORE), 20, 9, 0, 64),
new OreType(Block.get(REDSTONE_ORE), 8, 8, 0, 16),
new OreType(Block.get(LAPIS_ORE), 1, 7, 0, 16),
new OreType(Block.get(GOLD_ORE), 2, 9, 0, 32),
new OreType(Block.get(DIAMOND_ORE), 1, 8, 0, 16),
new OreType(Block.get(DIRT), 10, 33, 0, 128),
new OreType(Block.get(GRAVEL), 8, 33, 0, 128),
new OreType(Block.get(STONE, BlockStone.GRANITE), 10, 33, 0, 80),
new OreType(Block.get(STONE, BlockStone.DIORITE), 10, 33, 0, 80),
new OreType(Block.get(STONE, BlockStone.ANDESITE), 10, 33, 0, 80)
}),
new PopulatorSnowLayers()
);
this.biomeGrid = MapLayer.initialize(level.getSeed(), this.getDimension(), this.getId());
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ protected void generateCaveNode(long seed, FullChunk chunk, double x, double y,
// If grass was just deleted, try to
// move it down
if (grassFound && (chunk.getBlockId(xx, yy - 1, zz) == Block.DIRT)) {
chunk.setBlock(xx, yy - 1, zz, ((CoveredBiome) biome).getSurfaceBlock(yy - 1));
chunk.setFullBlockId(xx, yy - 1, zz, ((CoveredBiome) biome).getSurfaceId(xx, yy - 1, zz));
}
}
}
Expand Down

0 comments on commit 7f60645

Please sign in to comment.