use of net.minecraft.world.biome.BiomeContainer in project LoliServer by Loli-Server.
the class CraftChunk method getEmptyChunkSnapshot.
public static ChunkSnapshot getEmptyChunkSnapshot(int x, int z, CraftWorld world, boolean includeBiome, boolean includeBiomeTempRain) {
BiomeContainer biome = null;
if (includeBiome || includeBiomeTempRain) {
BiomeProvider wcm = world.getHandle().getChunkSource().getGenerator().getBiomeSource();
biome = new BiomeContainer(world.getHandle().registryAccess().registryOrThrow(Registry.BIOME_REGISTRY), new ChunkPos(x, z), wcm);
}
/* Fill with empty data */
int hSection = world.getMaxHeight() >> 4;
PalettedContainer[] blockIDs = new PalettedContainer[hSection];
byte[][] skyLight = new byte[hSection][];
byte[][] emitLight = new byte[hSection][];
boolean[] empty = new boolean[hSection];
for (int i = 0; i < hSection; i++) {
blockIDs[i] = emptyBlockIDs;
skyLight[i] = emptyLight;
emitLight[i] = emptyLight;
empty[i] = true;
}
return new CraftChunkSnapshot(x, z, world.getName(), world.getFullTime(), blockIDs, skyLight, emitLight, empty, new Heightmap(null, Heightmap.Type.MOTION_BLOCKING), biome);
}
Aggregations