From 09a73d352c2ecc18a4265c70f9bf3dea1559df5c Mon Sep 17 00:00:00 2001
From: Mike Primm <mike@primmhome.com>
Date: Tue, 20 Mar 2012 15:04:37 -0500
Subject: [PATCH] [Bleeding] Make sure biome data is initialized during
 generate - prevent uninitialized data being sent to client. Fixes BUKKIT-871

---
 .../java/net/minecraft/server/ChunkProviderGenerate.java    | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
index fc91383a52..66d77c7673 100644
--- a/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
+++ b/src/main/java/net/minecraft/server/ChunkProviderGenerate.java
@@ -192,6 +192,12 @@ public class ChunkProviderGenerate implements IChunkProvider {
         }
 
         Chunk chunk = new Chunk(this.p, abyte, i, j);
+        // CraftBukkit start - prime biome data to prevent uninitialized values racing to client
+        byte[] biomes = chunk.l();
+        for(int idx = 0; idx < biomes.length; idx++) {
+            biomes[idx] = (byte) this.y[idx].id;
+        }
+        // CraftBukkit end
 
         chunk.initLighting();
         return chunk;