public void HandleMultiBlockChange(MinecraftClient client, IPacket packet) { var myPacket = (CBMultiBlockChange)packet; int chunkID = client.MinecraftWorld.GetChunk(myPacket.ChunkX, myPacket.ChunkZ); if (chunkID == -1) { client.RaiseError(this, "Attempted to access uninitialized chunk"); return; } var thisChunk = client.MinecraftWorld.worldChunks[chunkID]; for (int i = 0; i < myPacket.Recordcount - 1; i++) { var thisRecord = myPacket.Records[i]; thisChunk.UpdateBlock(thisRecord.X, thisRecord.Y, thisRecord.Z, thisRecord.BlockID); thisChunk.SetBlockData(thisRecord.X, thisRecord.Y, thisRecord.Z, thisRecord.Metadata); } client.RaiseMultiBlockChange(myPacket.ChunkX, myPacket.ChunkX); }