Fix The End terrain load crash for 1.9+

Bug report by TNTUP, See #173
This commit is contained in:
ORelio 2016-07-22 23:48:14 +02:00
parent b99edee642
commit e8f51ca22b

View file

@ -629,6 +629,8 @@ namespace MinecraftClient.Protocol.Handlers
Chunk chunk = new Chunk();
if (dataArray.Length > 0)
{
for (int blockY = 0; blockY < Chunk.SizeY; blockY++)
{
for (int blockZ = 0; blockZ < Chunk.SizeZ; blockZ++)
@ -664,6 +666,7 @@ namespace MinecraftClient.Protocol.Handlers
}
}
}
}
//We have our chunk, save the chunk into the world
if (handler.GetWorld()[chunkX, chunkZ] == null)
@ -674,8 +677,8 @@ namespace MinecraftClient.Protocol.Handlers
readData((Chunk.SizeX * Chunk.SizeY * Chunk.SizeZ) / 2, cache);
//Skip sky light
if (this.currentDimension != -1)
// Sky light is not sent in the nether
if (this.currentDimension == 0)
// Sky light is not sent in the nether or the end
readData((Chunk.SizeX * Chunk.SizeY * Chunk.SizeZ) / 2, cache);
}
}